@sdcorejs/angular 21.3.5 → 21.3.6

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 (235) hide show
  1. package/assets/STYLE-GUIDE.md +78 -1
  2. package/assets/THEME.md +45 -3
  3. package/assets/scss/core/_popover-panel.scss +90 -0
  4. package/assets/scss/core/form.scss +5 -2
  5. package/assets/scss/core/utilities/_grid.scss +15 -0
  6. package/assets/scss/core/utilities/_sizing.scss +4 -0
  7. package/assets/scss/themes/_component-tokens.scss +9 -4
  8. package/assets/scss/themes/_semantic.scss +6 -5
  9. package/fesm2022/sdcorejs-angular-components-anchor.mjs +62 -3
  10. package/fesm2022/sdcorejs-angular-components-anchor.mjs.map +1 -1
  11. package/fesm2022/sdcorejs-angular-components-button.mjs +14 -6
  12. package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
  13. package/fesm2022/sdcorejs-angular-components-calendar.mjs +2479 -0
  14. package/fesm2022/sdcorejs-angular-components-calendar.mjs.map +1 -0
  15. package/fesm2022/sdcorejs-angular-components-card.mjs +486 -23
  16. package/fesm2022/sdcorejs-angular-components-card.mjs.map +1 -1
  17. package/fesm2022/sdcorejs-angular-components-editor-engine.mjs +1 -1
  18. package/fesm2022/sdcorejs-angular-components-editor-engine.mjs.map +1 -1
  19. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs +4 -18
  20. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -1
  21. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +7 -7
  22. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  23. package/fesm2022/sdcorejs-angular-components-import-excel.mjs +1 -1
  24. package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
  25. package/fesm2022/sdcorejs-angular-components-kanban.mjs +833 -154
  26. package/fesm2022/sdcorejs-angular-components-kanban.mjs.map +1 -1
  27. package/fesm2022/sdcorejs-angular-components-modal.mjs +23 -7
  28. package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
  29. package/fesm2022/sdcorejs-angular-components-query-bar.mjs +1312 -220
  30. package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
  31. package/fesm2022/sdcorejs-angular-components-quick-action.mjs +68 -2
  32. package/fesm2022/sdcorejs-angular-components-quick-action.mjs.map +1 -1
  33. package/fesm2022/sdcorejs-angular-components-scheduler.mjs +1932 -0
  34. package/fesm2022/sdcorejs-angular-components-scheduler.mjs.map +1 -0
  35. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -2
  36. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
  37. package/fesm2022/sdcorejs-angular-components-tab-router.mjs +126 -26
  38. package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
  39. package/fesm2022/sdcorejs-angular-components-tab.mjs +31 -2
  40. package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
  41. package/fesm2022/sdcorejs-angular-components-table.mjs +615 -104
  42. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  43. package/fesm2022/sdcorejs-angular-components-timeline.mjs +473 -0
  44. package/fesm2022/sdcorejs-angular-components-timeline.mjs.map +1 -0
  45. package/fesm2022/sdcorejs-angular-components-tree.mjs +597 -36
  46. package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
  47. package/fesm2022/sdcorejs-angular-components-upload-file.mjs +2 -4
  48. package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
  49. package/fesm2022/sdcorejs-angular-components.mjs +3 -1
  50. package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
  51. package/fesm2022/sdcorejs-angular-directives.mjs +109 -22
  52. package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
  53. package/fesm2022/sdcorejs-angular-forms-date.mjs +140 -42
  54. package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
  55. package/fesm2022/sdcorejs-angular-forms-datetime.mjs +70 -21
  56. package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
  57. package/fesm2022/sdcorejs-angular-forms-directives.mjs +4 -3
  58. package/fesm2022/sdcorejs-angular-forms-directives.mjs.map +1 -1
  59. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +1 -1
  60. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -1
  61. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +1 -1
  62. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -1
  63. package/fesm2022/sdcorejs-angular-i18n.mjs +622 -52
  64. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  65. package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-BR6jxyYd.mjs → sdcorejs-angular-modules-generic-generic-configuration.page-BfvRoiKg.mjs} +3 -3
  66. package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-BR6jxyYd.mjs.map → sdcorejs-angular-modules-generic-generic-configuration.page-BfvRoiKg.mjs.map} +1 -1
  67. package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-BsEL-y-M.mjs → sdcorejs-angular-modules-generic-generic-form-host.page-C9jW2AkB.mjs} +2 -2
  68. package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-BsEL-y-M.mjs.map → sdcorejs-angular-modules-generic-generic-form-host.page-C9jW2AkB.mjs.map} +1 -1
  69. package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-qTFKh4UG.mjs → sdcorejs-angular-modules-generic-generic-list.page-BwGHv8k-.mjs} +3 -3
  70. package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-qTFKh4UG.mjs.map → sdcorejs-angular-modules-generic-generic-list.page-BwGHv8k-.mjs.map} +1 -1
  71. package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-Cq0GFfo1.mjs → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-BhUf_wyg.mjs} +4 -4
  72. package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-Cq0GFfo1.mjs.map → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-BhUf_wyg.mjs.map} +1 -1
  73. package/fesm2022/sdcorejs-angular-modules-generic.mjs +1 -1
  74. package/fesm2022/sdcorejs-angular-modules-layout.mjs +7 -2
  75. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  76. package/fesm2022/{sdcorejs-angular-modules-pattern-base-api.service-5uIBONB3.mjs → sdcorejs-angular-modules-pattern-base-api.service-VnxHofZl.mjs} +2 -2
  77. package/fesm2022/{sdcorejs-angular-modules-pattern-base-api.service-5uIBONB3.mjs.map → sdcorejs-angular-modules-pattern-base-api.service-VnxHofZl.mjs.map} +1 -1
  78. package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-CCHeD5tf.mjs → sdcorejs-angular-modules-pattern-create.component-7VOgxRio.mjs} +11 -7
  79. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-7VOgxRio.mjs.map +1 -0
  80. package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-B35CvNrI.mjs → sdcorejs-angular-modules-pattern-create.component-COnQ3U15.mjs} +2 -2
  81. package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-B35CvNrI.mjs.map → sdcorejs-angular-modules-pattern-create.component-COnQ3U15.mjs.map} +1 -1
  82. package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-Cvxx5s1o.mjs → sdcorejs-angular-modules-pattern-create.component-CggApoVx.mjs} +2 -2
  83. package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-Cvxx5s1o.mjs.map → sdcorejs-angular-modules-pattern-create.component-CggApoVx.mjs.map} +1 -1
  84. package/fesm2022/{sdcorejs-angular-modules-pattern-customer.service-5hBM9st3.mjs → sdcorejs-angular-modules-pattern-customer.service-5th_X0wz.mjs} +2 -2
  85. package/fesm2022/{sdcorejs-angular-modules-pattern-customer.service-5hBM9st3.mjs.map → sdcorejs-angular-modules-pattern-customer.service-5th_X0wz.mjs.map} +1 -1
  86. package/fesm2022/{sdcorejs-angular-modules-pattern-detail.component-BuvAy1by.mjs → sdcorejs-angular-modules-pattern-detail.component-BBqMMusi.mjs} +2 -2
  87. package/fesm2022/{sdcorejs-angular-modules-pattern-detail.component-BuvAy1by.mjs.map → sdcorejs-angular-modules-pattern-detail.component-BBqMMusi.mjs.map} +1 -1
  88. package/fesm2022/{sdcorejs-angular-modules-pattern-detail.component-BcxxJCVt.mjs → sdcorejs-angular-modules-pattern-detail.component-LS8QNECh.mjs} +58 -55
  89. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-LS8QNECh.mjs.map +1 -0
  90. package/fesm2022/{sdcorejs-angular-modules-pattern-flow.component-BDixzOA6.mjs → sdcorejs-angular-modules-pattern-flow.component-CQajWHBR.mjs} +3 -3
  91. package/fesm2022/{sdcorejs-angular-modules-pattern-flow.component-BDixzOA6.mjs.map → sdcorejs-angular-modules-pattern-flow.component-CQajWHBR.mjs.map} +1 -1
  92. package/fesm2022/{sdcorejs-angular-modules-pattern-index.component-iRIG7WQo.mjs → sdcorejs-angular-modules-pattern-index.component-DHRtqSRm.mjs} +2 -2
  93. package/fesm2022/{sdcorejs-angular-modules-pattern-index.component-iRIG7WQo.mjs.map → sdcorejs-angular-modules-pattern-index.component-DHRtqSRm.mjs.map} +1 -1
  94. package/fesm2022/{sdcorejs-angular-modules-pattern-lines-table-form.component-BqKJDK9M.mjs → sdcorejs-angular-modules-pattern-lines-table-form.component-DBPMTKqD.mjs} +5 -5
  95. package/fesm2022/{sdcorejs-angular-modules-pattern-lines-table-form.component-BqKJDK9M.mjs.map → sdcorejs-angular-modules-pattern-lines-table-form.component-DBPMTKqD.mjs.map} +1 -1
  96. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CIkZmM47.mjs +501 -0
  97. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CIkZmM47.mjs.map +1 -0
  98. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CgKUBP46.mjs +506 -0
  99. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CgKUBP46.mjs.map +1 -0
  100. package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-Cj03DgF1.mjs → sdcorejs-angular-modules-pattern-list.component-Co22ltOo.mjs} +30 -39
  101. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Co22ltOo.mjs.map +1 -0
  102. package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-DH3CroK1.mjs → sdcorejs-angular-modules-pattern-list.component-D1Q69_3M.mjs} +3 -3
  103. package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-DH3CroK1.mjs.map → sdcorejs-angular-modules-pattern-list.component-D1Q69_3M.mjs.map} +1 -1
  104. package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-BMpOXn7E.mjs → sdcorejs-angular-modules-pattern-list.component-DBnStJM_.mjs} +3 -3
  105. package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-BMpOXn7E.mjs.map → sdcorejs-angular-modules-pattern-list.component-DBnStJM_.mjs.map} +1 -1
  106. package/fesm2022/{sdcorejs-angular-modules-pattern-mock-backend.factory-DnB5_C1D.mjs → sdcorejs-angular-modules-pattern-mock-backend.factory-DexrG-bI.mjs} +2 -2
  107. package/fesm2022/{sdcorejs-angular-modules-pattern-mock-backend.factory-DnB5_C1D.mjs.map → sdcorejs-angular-modules-pattern-mock-backend.factory-DexrG-bI.mjs.map} +1 -1
  108. package/fesm2022/{sdcorejs-angular-modules-pattern-pattern-source-viewer-BqHwKfoc.mjs → sdcorejs-angular-modules-pattern-pattern-source-viewer-DuhyXsGn.mjs} +4 -22
  109. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-DuhyXsGn.mjs.map +1 -0
  110. package/fesm2022/{sdcorejs-angular-modules-pattern-pattern-source.generated-CIiLOizq.mjs → sdcorejs-angular-modules-pattern-pattern-source.generated-bfpj85ke.mjs} +26 -27
  111. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-bfpj85ke.mjs.map +1 -0
  112. package/fesm2022/{sdcorejs-angular-modules-pattern-product.service-DZ3fY-yQ.mjs → sdcorejs-angular-modules-pattern-product.service-DG1pe8fb.mjs} +2 -2
  113. package/fesm2022/{sdcorejs-angular-modules-pattern-product.service-DZ3fY-yQ.mjs.map → sdcorejs-angular-modules-pattern-product.service-DG1pe8fb.mjs.map} +1 -1
  114. package/fesm2022/{sdcorejs-angular-modules-pattern-profile.component-DVYnHOtn.mjs → sdcorejs-angular-modules-pattern-profile.component-CLvjGnbA.mjs} +24 -14
  115. package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-CLvjGnbA.mjs.map +1 -0
  116. package/fesm2022/sdcorejs-angular-modules-pattern-routes-B8ceLXT4.mjs +65 -0
  117. package/fesm2022/sdcorejs-angular-modules-pattern-routes-B8ceLXT4.mjs.map +1 -0
  118. package/fesm2022/sdcorejs-angular-modules-pattern-routes-C1YBKLdb.mjs +56 -0
  119. package/fesm2022/sdcorejs-angular-modules-pattern-routes-C1YBKLdb.mjs.map +1 -0
  120. package/fesm2022/{sdcorejs-angular-modules-pattern-routes-BGZzmwY2.mjs → sdcorejs-angular-modules-pattern-routes-CntNjuzb.mjs} +3 -3
  121. package/fesm2022/{sdcorejs-angular-modules-pattern-routes-BGZzmwY2.mjs.map → sdcorejs-angular-modules-pattern-routes-CntNjuzb.mjs.map} +1 -1
  122. package/fesm2022/{sdcorejs-angular-modules-pattern-routes-CdSiqJCz.mjs → sdcorejs-angular-modules-pattern-routes-CwfyLo_V.mjs} +5 -5
  123. package/fesm2022/{sdcorejs-angular-modules-pattern-routes-CdSiqJCz.mjs.map → sdcorejs-angular-modules-pattern-routes-CwfyLo_V.mjs.map} +1 -1
  124. package/fesm2022/{sdcorejs-angular-modules-pattern-routes-B8i5MUtz.mjs → sdcorejs-angular-modules-pattern-routes-DAw75sbm.mjs} +8 -8
  125. package/fesm2022/{sdcorejs-angular-modules-pattern-routes-B8i5MUtz.mjs.map → sdcorejs-angular-modules-pattern-routes-DAw75sbm.mjs.map} +1 -1
  126. package/fesm2022/{sdcorejs-angular-modules-pattern-routes-C_CLbNSs.mjs → sdcorejs-angular-modules-pattern-routes-DZmBTvxf.mjs} +3 -3
  127. package/fesm2022/{sdcorejs-angular-modules-pattern-routes-C_CLbNSs.mjs.map → sdcorejs-angular-modules-pattern-routes-DZmBTvxf.mjs.map} +1 -1
  128. package/fesm2022/{sdcorejs-angular-modules-pattern-routes-uRsy0zag.mjs → sdcorejs-angular-modules-pattern-routes-Dp3-TMG3.mjs} +4 -4
  129. package/fesm2022/{sdcorejs-angular-modules-pattern-routes-uRsy0zag.mjs.map → sdcorejs-angular-modules-pattern-routes-Dp3-TMG3.mjs.map} +1 -1
  130. package/fesm2022/{sdcorejs-angular-modules-pattern-routes-p7lQcGGX.mjs → sdcorejs-angular-modules-pattern-routes-WyOa9Q3H.mjs} +3 -3
  131. package/fesm2022/{sdcorejs-angular-modules-pattern-routes-p7lQcGGX.mjs.map → sdcorejs-angular-modules-pattern-routes-WyOa9Q3H.mjs.map} +1 -1
  132. package/fesm2022/{sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-els-Wxch.mjs → sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-CsipDO_7.mjs} +12 -12
  133. package/fesm2022/{sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-els-Wxch.mjs.map → sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-CsipDO_7.mjs.map} +1 -1
  134. package/fesm2022/{sdcorejs-angular-modules-pattern-shell.component-5G4lKoLv.mjs → sdcorejs-angular-modules-pattern-shell.component-Dy1a9seQ.mjs} +4 -4
  135. package/fesm2022/{sdcorejs-angular-modules-pattern-shell.component-5G4lKoLv.mjs.map → sdcorejs-angular-modules-pattern-shell.component-Dy1a9seQ.mjs.map} +1 -1
  136. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-CBpuQnHp.mjs +480 -0
  137. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-CBpuQnHp.mjs.map +1 -0
  138. package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-CpGbjd_m.mjs → sdcorejs-angular-modules-pattern-update.component-B8N158up.mjs} +2 -2
  139. package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-CpGbjd_m.mjs.map → sdcorejs-angular-modules-pattern-update.component-B8N158up.mjs.map} +1 -1
  140. package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-Bwsqvl4A.mjs → sdcorejs-angular-modules-pattern-update.component-BBktRBkQ.mjs} +9 -6
  141. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-BBktRBkQ.mjs.map +1 -0
  142. package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-Bq_5H0xM.mjs → sdcorejs-angular-modules-pattern-update.component-C9Wf6jhW.mjs} +2 -2
  143. package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-Bq_5H0xM.mjs.map → sdcorejs-angular-modules-pattern-update.component-C9Wf6jhW.mjs.map} +1 -1
  144. package/fesm2022/sdcorejs-angular-modules-pattern.mjs +1 -1
  145. package/fesm2022/sdcorejs-angular-services-confirm.mjs +171 -158
  146. package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
  147. package/fesm2022/sdcorejs-angular-services-query-params.mjs +226 -0
  148. package/fesm2022/sdcorejs-angular-services-query-params.mjs.map +1 -0
  149. package/fesm2022/sdcorejs-angular-utilities-extensions.mjs +24 -1
  150. package/fesm2022/sdcorejs-angular-utilities-extensions.mjs.map +1 -1
  151. package/modules/pattern/README.md +5 -4
  152. package/modules/pattern/docs/detail.md +18 -9
  153. package/modules/pattern/docs/drawer.md +185 -83
  154. package/modules/pattern/docs/header-actions.md +1 -1
  155. package/modules/pattern/docs/list.md +3 -3
  156. package/modules/pattern/docs/states.md +1 -1
  157. package/modules/pattern/features/category/components/create-side-drawer/create-side-drawer.component.ts +12 -16
  158. package/modules/pattern/features/category/components/update-side-drawer/update-side-drawer.component.ts +58 -29
  159. package/modules/pattern/features/category/pages/list/list.component.html +11 -3
  160. package/modules/pattern/features/category/pages/list/list.component.ts +36 -10
  161. package/modules/pattern/features/category/routes.ts +5 -22
  162. package/modules/pattern/features/customer/components/create-side-drawer/create-side-drawer.component.ts +7 -11
  163. package/modules/pattern/features/customer/components/detail-side-drawer/detail-side-drawer.component.ts +70 -27
  164. package/modules/pattern/features/customer/components/summary-cards/summary-cards.component.ts +9 -53
  165. package/modules/pattern/features/customer/components/update-side-drawer/update-side-drawer.component.ts +53 -19
  166. package/modules/pattern/features/customer/entity.resolver.ts +1 -1
  167. package/modules/pattern/features/customer/pages/list/list.component.html +18 -3
  168. package/modules/pattern/features/customer/pages/list/list.component.ts +43 -16
  169. package/modules/pattern/features/customer/pages/profile/profile.component.ts +17 -8
  170. package/modules/pattern/features/customer/routes.ts +6 -27
  171. package/modules/pattern/features/order/components/approval-steps/approval-steps.component.ts +37 -56
  172. package/modules/pattern/features/order/components/summary-cards/summary-cards.component.ts +14 -76
  173. package/modules/pattern/features/order/pages/create/create.component.ts +7 -3
  174. package/modules/pattern/features/order/pages/detail/detail.component.ts +1 -1
  175. package/modules/pattern/features/order/pages/update/update.component.ts +5 -2
  176. package/package.json +17 -5
  177. package/types/sdcorejs-angular-components-anchor.d.ts +6 -1
  178. package/types/sdcorejs-angular-components-button.d.ts +7 -1
  179. package/types/sdcorejs-angular-components-calendar.d.ts +1092 -0
  180. package/types/sdcorejs-angular-components-card.d.ts +247 -9
  181. package/types/sdcorejs-angular-components-kanban.d.ts +191 -74
  182. package/types/sdcorejs-angular-components-modal.d.ts +10 -1
  183. package/types/sdcorejs-angular-components-query-bar.d.ts +176 -36
  184. package/types/sdcorejs-angular-components-quick-action.d.ts +65 -1
  185. package/types/sdcorejs-angular-components-scheduler.d.ts +544 -0
  186. package/types/sdcorejs-angular-components-tab.d.ts +6 -1
  187. package/types/sdcorejs-angular-components-table.d.ts +56 -7
  188. package/types/sdcorejs-angular-components-timeline.d.ts +216 -0
  189. package/types/sdcorejs-angular-components-tree.d.ts +119 -6
  190. package/types/sdcorejs-angular-components.d.ts +3 -1
  191. package/types/sdcorejs-angular-directives.d.ts +4 -2
  192. package/types/sdcorejs-angular-forms-date.d.ts +2 -0
  193. package/types/sdcorejs-angular-forms-directives.d.ts +1 -1
  194. package/types/sdcorejs-angular-i18n.d.ts +121 -9
  195. package/types/sdcorejs-angular-modules-layout.d.ts +2 -1
  196. package/types/sdcorejs-angular-services-confirm.d.ts +22 -81
  197. package/types/sdcorejs-angular-services-query-params.d.ts +67 -0
  198. package/types/sdcorejs-angular-utilities-extensions.d.ts +10 -1
  199. package/fesm2022/sdcorejs-angular-components-history.mjs +0 -54
  200. package/fesm2022/sdcorejs-angular-components-history.mjs.map +0 -1
  201. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-7d4hJjAo.mjs +0 -144
  202. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-7d4hJjAo.mjs.map +0 -1
  203. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CGkdzJ-A.mjs +0 -145
  204. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CGkdzJ-A.mjs.map +0 -1
  205. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-CCHeD5tf.mjs.map +0 -1
  206. package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs +0 -18
  207. package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs.map +0 -1
  208. package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-Bza4JOdZ.mjs +0 -148
  209. package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-Bza4JOdZ.mjs.map +0 -1
  210. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-BcxxJCVt.mjs.map +0 -1
  211. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-B9vCzIT6.mjs +0 -232
  212. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-B9vCzIT6.mjs.map +0 -1
  213. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BnROr-Wg.mjs +0 -87
  214. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BnROr-Wg.mjs.map +0 -1
  215. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-Cbwdhc0Z.mjs +0 -70
  216. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-Cbwdhc0Z.mjs.map +0 -1
  217. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-B6_x5N3F.mjs +0 -164
  218. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-B6_x5N3F.mjs.map +0 -1
  219. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Cj03DgF1.mjs.map +0 -1
  220. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-D-pHPHFP.mjs +0 -118
  221. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-D-pHPHFP.mjs.map +0 -1
  222. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BqHwKfoc.mjs.map +0 -1
  223. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-CIiLOizq.mjs.map +0 -1
  224. package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-DVYnHOtn.mjs.map +0 -1
  225. package/fesm2022/sdcorejs-angular-modules-pattern-routes-BPofy0Oq.mjs +0 -99
  226. package/fesm2022/sdcorejs-angular-modules-pattern-routes-BPofy0Oq.mjs.map +0 -1
  227. package/fesm2022/sdcorejs-angular-modules-pattern-routes-CYeHFGl1.mjs +0 -74
  228. package/fesm2022/sdcorejs-angular-modules-pattern-routes-CYeHFGl1.mjs.map +0 -1
  229. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-BF0hAVrv.mjs +0 -132
  230. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-BF0hAVrv.mjs.map +0 -1
  231. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-DJeQxfDA.mjs +0 -143
  232. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-DJeQxfDA.mjs.map +0 -1
  233. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-Bwsqvl4A.mjs.map +0 -1
  234. package/modules/pattern/features/category/entity.resolver.ts +0 -27
  235. package/types/sdcorejs-angular-components-history.d.ts +0 -23
@@ -1,17 +1,22 @@
1
- import { CommonModule, NgTemplateOutlet } from '@angular/common';
1
+ import { DOCUMENT, CommonModule, NgTemplateOutlet } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { inject, computed, input, output, signal, effect, ChangeDetectionStrategy, Component, booleanAttribute, model, viewChild, isSignal, Injector, afterNextRender, ElementRef, viewChildren, untracked } from '@angular/core';
4
- import * as i1$1 from '@angular/forms';
5
- import { FormsModule } from '@angular/forms';
6
- import * as i1 from '@angular/material/menu';
7
- import { MatMenuModule, MatMenu, MatMenuTrigger } from '@angular/material/menu';
8
- import * as i2 from '@angular/material/tooltip';
3
+ import { Injectable, inject, TemplateRef, ViewContainerRef, Injector, input, computed, output, signal, DestroyRef, afterNextRender, Directive, ElementRef, effect, ChangeDetectorRef, booleanAttribute, viewChild, ChangeDetectionStrategy, Component, model, isSignal, linkedSignal, viewChildren, untracked } from '@angular/core';
4
+ import { ɵSdSearchField as _SdSearchField, ɵSdSearchFieldInputDirective as _SdSearchFieldInputDirective } from '@sdcorejs/angular/forms/directives';
5
+ import * as i1 from '@angular/material/tooltip';
9
6
  import { MatTooltipModule } from '@angular/material/tooltip';
10
7
  import { I18nService } from '@sdcorejs/angular/i18n';
11
8
  import { SdDateTimeService } from '@sdcorejs/angular/services/date-time';
12
9
  import { Utilities } from '@sdcorejs/utils/fns';
13
10
  import { SdIcon } from '@sdcorejs/angular/modules/icon';
14
11
  import { SdConfirmService } from '@sdcorejs/angular/services/confirm';
12
+ import { SdNotifyService } from '@sdcorejs/angular/services/notify';
13
+ import { InteractivityChecker } from '@angular/cdk/a11y';
14
+ import { Directionality } from '@angular/cdk/bidi';
15
+ import { hasModifierKey } from '@angular/cdk/keycodes';
16
+ import { Overlay, OverlayContainer } from '@angular/cdk/overlay';
17
+ import { _getEventTarget } from '@angular/cdk/platform';
18
+ import { TemplatePortal } from '@angular/cdk/portal';
19
+ import { Subject, isObservable, firstValueFrom } from 'rxjs';
15
20
  import { SdOperator } from '@sdcorejs/angular/components/operator';
16
21
  import { SdDate } from '@sdcorejs/angular/forms/date';
17
22
  import { SdDateRange } from '@sdcorejs/angular/forms/date-range';
@@ -20,81 +25,539 @@ import { SdInput } from '@sdcorejs/angular/forms/input';
20
25
  import { SdInputNumber } from '@sdcorejs/angular/forms/input-number';
21
26
  import { SdSelect } from '@sdcorejs/angular/forms/select';
22
27
  import { SdInlineText } from '@sdcorejs/angular/forms/inline-text';
23
- import { isObservable, firstValueFrom } from 'rxjs';
28
+ import { FormsModule } from '@angular/forms';
24
29
  import { SdButton } from '@sdcorejs/angular/components/button';
25
30
  import { sdNormalizeSearchText } from '@sdcorejs/angular/utilities/extensions';
26
- import { take } from 'rxjs/operators';
27
31
 
32
+ // why: thứ tự vị trí như Action Popover của sd-button (`components/button/src/action-popover.ts`) — dưới trước, thiếu
33
+ // chỗ thì lật lên, cách trigger 4px — nhưng mặc định canh trái (start); bộ lọc đã lưu canh phải như `xPosition="before"`.
34
+ const START_POSITIONS = [
35
+ { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },
36
+ { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },
37
+ { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 4 },
38
+ { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -4 },
39
+ ];
40
+ const END_POSITIONS = [
41
+ { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 4 },
42
+ { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -4 },
43
+ { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },
44
+ { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },
45
+ ];
46
+ let nextPanelId = 0;
47
+ const TABBABLE = 'a[href], button, input, select, textarea, [tabindex], [contenteditable="true"]';
48
+ // A layer stacked above the panel holding one of these is the popup of a control (sd-select panel, date picker,
49
+ // sd-operator menu): Escape belongs to it. A tooltip holds none of them.
50
+ const INTERACTIVE = `${TABBABLE}, [role="listbox"], [role="menu"], [role="dialog"], [role="grid"], [role="tree"]`;
51
+ const FIRST_OPTION = '[role="option"]:not([aria-disabled="true"]), [role="menuitem"]:not(:disabled):not([aria-disabled="true"])';
52
+ /**
53
+ * One open panel per query bar: opening a panel closes the other one first (handoff section 2.2, "Nhiều panel").
54
+ * Provided by `SdQueryBar`; a panel without a group only closes itself.
55
+ */
56
+ class ɵSdQueryPanelGroup {
57
+ #open;
58
+ activate(panel) {
59
+ if (this.#open && this.#open !== panel)
60
+ this.#open.close('switch');
61
+ this.#open = panel;
62
+ }
63
+ release(panel) {
64
+ if (this.#open === panel)
65
+ this.#open = undefined;
66
+ }
67
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ɵSdQueryPanelGroup, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
68
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ɵSdQueryPanelGroup });
69
+ }
70
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ɵSdQueryPanelGroup, decorators: [{
71
+ type: Injectable
72
+ }] });
73
+ /**
74
+ * Content of a query bar panel, rendered in a CDK overlay next to its trigger: field picker (`listbox`), chip popover
75
+ * (`dialog`) and saved filters (`menu`). Replaces the Material menu the bar used before (handoff section 2.2).
76
+ *
77
+ * The template has one root element carrying `sd-query-panel`, its modifier and its role; the panel gives it the `id`
78
+ * the trigger's `aria-controls` points to (unless `sdQueryPanelControls` names the element inside that has the role)
79
+ * and `tabindex="-1"`. A form panel marks the wrapper of its first value control
80
+ * with `data-sd-query-panel-initial`.
81
+ *
82
+ * Internal (`ɵ`): not part of SemVer.
83
+ */
84
+ class ɵSdQueryPanelDirective {
85
+ id = `sd-query-panel-${nextPanelId++}`;
86
+ #template = inject(TemplateRef);
87
+ #views = inject(ViewContainerRef);
88
+ #overlay = inject(Overlay);
89
+ #container = inject(OverlayContainer);
90
+ #checker = inject(InteractivityChecker);
91
+ #injector = inject(Injector);
92
+ #document = inject(DOCUMENT);
93
+ #dir = inject(Directionality, { optional: true });
94
+ #group = inject(ɵSdQueryPanelGroup, { optional: true });
95
+ /** Popup type: `listbox` and `menu` are lists, `dialog` is a form. */
96
+ role = input.required({ ...(ngDevMode ? { debugName: "role" } : /* istanbul ignore next */ {}), alias: 'sdQueryPanel' });
97
+ /** Horizontal alignment with the trigger; flips when there is no room. */
98
+ align = input('start', { ...(ngDevMode ? { debugName: "align" } : /* istanbul ignore next */ {}), alias: 'sdQueryPanelAlign' });
99
+ /**
100
+ * Id of the element inside the panel that carries the popup role, when it is not the root (the field picker's listbox
101
+ * sits under its find box). The trigger's `aria-controls` points there.
102
+ */
103
+ controls = input(undefined, { ...(ngDevMode ? { debugName: "controls" } : /* istanbul ignore next */ {}), alias: 'sdQueryPanelControls' });
104
+ /** Id the trigger's `aria-controls` names. */
105
+ controlledId = computed(() => this.controls() ?? this.id, ...(ngDevMode ? [{ debugName: "controlledId" }] : /* istanbul ignore next */ []));
106
+ /** The panel opened and took focus. */
107
+ opened = output();
108
+ /**
109
+ * The panel closed; `reason` says how. Not emitted for `detach`: the panel or its trigger is being destroyed, and
110
+ * outputs of a destroyed view must not fire (NG0953).
111
+ */
112
+ closed = output();
113
+ #isOpen = signal(false, ...(ngDevMode ? [{ debugName: "#isOpen" }] : /* istanbul ignore next */ []));
114
+ #origin = signal(undefined, ...(ngDevMode ? [{ debugName: "#origin" }] : /* istanbul ignore next */ []));
115
+ /** Whether the panel is open. */
116
+ isOpen = this.#isOpen.asReadonly();
117
+ /** The trigger the panel is open for (kept until `closed` has been emitted). */
118
+ origin = this.#origin.asReadonly();
119
+ #kind = computed(() => (this.role() === 'dialog' ? 'form' : 'list'), ...(ngDevMode ? [{ debugName: "#kind" }] : /* istanbul ignore next */ []));
120
+ /** @internal Triggers listen here, so an opening made through `open()` still reaches the trigger it uses. */
121
+ ɵopening = new Subject();
122
+ /** @internal */
123
+ ɵclosing = new Subject();
124
+ #ref;
125
+ #root;
126
+ #returnFocusTo;
127
+ #teardown = [];
128
+ #destroyed = false;
129
+ constructor() {
130
+ inject(DestroyRef).onDestroy(() => {
131
+ // why: output của directive đã huỷ không được phát nữa (NG0953) — đóng im lặng.
132
+ this.#destroyed = true;
133
+ this.close('detach');
134
+ this.ɵopening.complete();
135
+ this.ɵclosing.complete();
136
+ });
137
+ }
138
+ /** The panel's root element while open. */
139
+ element() {
140
+ return this.#root;
141
+ }
142
+ /** Opens the panel next to `origin`. Open for another trigger: closes for that one first (`switch`). */
143
+ open(origin, options = {}) {
144
+ if (this.#destroyed)
145
+ return;
146
+ if (this.#ref && this.#origin() === origin) {
147
+ this.#returnFocusTo = options.returnFocusTo ?? undefined;
148
+ return;
149
+ }
150
+ this.close('switch');
151
+ this.#group?.activate(this);
152
+ this.#returnFocusTo = options.returnFocusTo ?? undefined;
153
+ this.#origin.set(origin);
154
+ // why: phát trước khi gắn nội dung — chip popover seed field/giá trị ở đây, nên nội dung vẽ lần đầu và focus đầu
155
+ // tiên đã đúng field (không vẽ field cũ rồi đổi).
156
+ this.ɵopening.next(origin);
157
+ const ref = this.#overlay.create({
158
+ positionStrategy: this.#overlay
159
+ .position()
160
+ .flexibleConnectedTo(origin)
161
+ .withPositions(this.align() === 'end' ? END_POSITIONS : START_POSITIONS)
162
+ .withViewportMargin(8)
163
+ .withPush(true)
164
+ .withFlexibleDimensions(true),
165
+ scrollStrategy: this.#overlay.scrollStrategies.reposition(),
166
+ panelClass: 'sd-query-panel-pane',
167
+ maxWidth: 'calc(100vw - 16px)',
168
+ maxHeight: 'calc(100dvh - 16px)',
169
+ direction: this.#dir?.value,
170
+ });
171
+ this.#ref = ref;
172
+ this.#isOpen.set(true);
173
+ ref.attach(new TemplatePortal(this.#template, this.#views)).detectChanges();
174
+ ref.updatePosition();
175
+ this.#root = ref.overlayElement.querySelector('.sd-query-panel') ?? undefined;
176
+ if (this.#root) {
177
+ this.#root.id = this.id;
178
+ if (!this.#root.hasAttribute('tabindex'))
179
+ this.#root.tabIndex = -1;
180
+ }
181
+ this.#listen(ref, origin);
182
+ const keyboard = !!options.keyboard;
183
+ // why: nội dung chưa vẽ xong (binding của cha chưa chạy) thì thử lại sau lượt render kế tiếp.
184
+ if (options.focus !== false && !this.#focusInitial(keyboard)) {
185
+ afterNextRender(() => {
186
+ if (this.#ref === ref)
187
+ this.#focusInitial(keyboard, true);
188
+ }, { injector: this.#injector });
189
+ }
190
+ this.opened.emit();
191
+ }
192
+ /** Closes the panel. Focus returns to `returnFocusTo` or the trigger, except as described for each reason. */
193
+ close(reason = 'close') {
194
+ this.#close(reason);
195
+ }
196
+ #close(reason, focusMoved = false) {
197
+ const ref = this.#ref;
198
+ const origin = this.#origin();
199
+ if (!ref || !origin)
200
+ return;
201
+ const active = this.#document.activeElement;
202
+ // why: bấm ra ngoài vào một phần tử nhận focus thì focus đã ở đó — không kéo về; bấm vào chỗ trống thì focus còn
203
+ // trong panel (hoặc rơi về body) nên trả về trigger như Esc. `focusMoved`: focus đang chuyển sang phần tử khác.
204
+ const restore = reason === 'switch' || reason === 'detach' || focusMoved
205
+ ? false
206
+ : reason === 'outside'
207
+ ? !active || active === this.#document.body || ref.overlayElement.contains(active)
208
+ : true;
209
+ const returnTo = this.#returnFocusTo ?? origin;
210
+ this.#ref = undefined;
211
+ this.#root = undefined;
212
+ this.#returnFocusTo = undefined;
213
+ for (const stop of this.#teardown.splice(0))
214
+ stop();
215
+ ref.dispose();
216
+ this.#isOpen.set(false);
217
+ this.#group?.release(this);
218
+ if (restore && returnTo.isConnected && !returnTo.disabled)
219
+ returnTo.focus();
220
+ if (!this.#destroyed)
221
+ this.ɵclosing.next({ origin, reason });
222
+ if (!this.#destroyed && reason !== 'detach')
223
+ this.closed.emit(reason);
224
+ // why: một listener của `closed` có thể đã mở lại panel (cho trigger khác) — khi đó giữ origin mới.
225
+ if (!this.#ref)
226
+ this.#origin.set(undefined);
227
+ }
228
+ #listen(ref, origin) {
229
+ const outside = ref.outsidePointerEvents().subscribe(event => {
230
+ const target = _getEventTarget(event);
231
+ if (target && (origin.contains(target) || this.#returnFocusTo?.contains(target) || this.#inStackedLayer(target)))
232
+ return;
233
+ this.close('outside');
234
+ });
235
+ const pane = ref.overlayElement;
236
+ // why: Esc bắt ở hai nơi. Focus luôn ở trong panel nên keydown của pane nhận trước — tooltip của một nút khác (gắn sau
237
+ // panel, nằm trên cùng) không nuốt được Esc qua OverlayKeyboardDispatcher (R1 · N-1). keydownEvents() chỉ còn cho
238
+ // trường hợp focus ở ngoài pane (bấm vào chỗ trống); phím gõ trong popup của một control (menu của sd-operator, lịch
239
+ // của sd-date) là của popup đó.
240
+ const keys = ref.keydownEvents().subscribe(event => {
241
+ const target = _getEventTarget(event);
242
+ if (target && (pane.contains(target) || this.#inStackedLayer(target)))
243
+ return;
244
+ this.#escape(event);
245
+ });
246
+ const onKeydown = (event) => {
247
+ if (event.key === 'Escape')
248
+ this.#escape(event);
249
+ // why: nội dung đã dùng Tab (bộ lọc đã lưu: nút áp → nút xoá của cùng hàng) thì không đóng.
250
+ else if (event.key === 'Tab' && !event.defaultPrevented && this.#leavesByTab(event))
251
+ this.close('tab');
252
+ };
253
+ const onFocusOut = (event) => {
254
+ const next = event.relatedTarget;
255
+ // why: relatedTarget null = focus rơi về body hoặc cửa sổ mất focus — bấm ra ngoài đã có outsidePointerEvents.
256
+ if (!next || pane.contains(next) || origin.contains(next) || this.#returnFocusTo?.contains(next) || this.#inStackedLayer(next))
257
+ return;
258
+ this.#close('outside', true);
259
+ };
260
+ pane.addEventListener('keydown', onKeydown);
261
+ pane.addEventListener('focusout', onFocusOut);
262
+ this.#teardown.push(() => outside.unsubscribe(), () => keys.unsubscribe(), () => pane.removeEventListener('keydown', onKeydown), () => pane.removeEventListener('focusout', onFocusOut));
263
+ }
264
+ /**
265
+ * Escape closes the panel unless the popup of a control is open above it (an sd-select panel closes first).
266
+ * why: không dựa vào `defaultPrevented` — sd-input-number chặn mọi phím ngoài danh sách cho phép (cả Esc) bằng
267
+ * preventDefault, nên cờ đó không nói control đã dùng Esc; popup tương tác chồng lên trên mới nói được.
268
+ */
269
+ #escape(event) {
270
+ if (event.key !== 'Escape' || !this.#ref || hasModifierKey(event) || this.#interactiveLayerAbove())
271
+ return;
272
+ event.preventDefault();
273
+ this.close('escape');
274
+ }
275
+ /** An overlay layer stacked above this panel that a user can interact with (not a tooltip). */
276
+ #interactiveLayerAbove() {
277
+ const host = this.#ref?.hostElement;
278
+ if (!host)
279
+ return false;
280
+ return Array.from(this.#container.getContainerElement().children).some(layer => layer !== host && !!(host.compareDocumentPosition(layer) & Node.DOCUMENT_POSITION_FOLLOWING) && !!layer.querySelector(INTERACTIVE));
281
+ }
282
+ /**
283
+ * Tab leaves a list at once (focus goes back to the trigger and the browser moves on from there, like the Action
284
+ * Popover). In a form it leaves from the last control, Shift+Tab from the first.
285
+ */
286
+ #leavesByTab(event) {
287
+ if (this.#kind() === 'list')
288
+ return true;
289
+ const root = this.#root;
290
+ if (!root)
291
+ return true;
292
+ const tabbables = this.#tabbables(root);
293
+ const target = event.target;
294
+ if (!tabbables.length)
295
+ return true;
296
+ return event.shiftKey ? target === tabbables[0] || target === root : target === tabbables[tabbables.length - 1];
297
+ }
298
+ #focusInitial(keyboard, last = false) {
299
+ const root = this.#root;
300
+ if (!root)
301
+ return false;
302
+ let target;
303
+ if (this.#kind() === 'form') {
304
+ const marked = root.querySelector('[data-sd-query-panel-initial]');
305
+ target = marked ? this.#tabbables(marked)[0] : this.#tabbables(root)[0];
306
+ if (!target && !last)
307
+ return false;
308
+ }
309
+ else {
310
+ target = root.querySelector('input:not([disabled])');
311
+ if (!target && keyboard)
312
+ target = root.querySelector(FIRST_OPTION);
313
+ }
314
+ (target ?? root).focus();
315
+ return true;
316
+ }
317
+ #tabbables(root) {
318
+ return Array.from(root.querySelectorAll(TABBABLE)).filter(element => this.#checker.isFocusable(element) && this.#checker.isTabbable(element));
319
+ }
320
+ /**
321
+ * Whether `node` sits in an overlay layer stacked above this panel: the panel of an sd-select, a date picker, the menu
322
+ * of sd-operator. Clicks and focus there belong to a control of the panel, so they are not "outside". Layers below it
323
+ * (a dialog that hosts the bar) are outside.
324
+ */
325
+ #inStackedLayer(node) {
326
+ const host = this.#ref?.hostElement;
327
+ const container = this.#container.getContainerElement();
328
+ if (!host || !container.contains(node) || host.contains(node))
329
+ return false;
330
+ let layer = node;
331
+ while (layer && layer.parentNode !== container)
332
+ layer = layer.parentNode;
333
+ return !!layer && !!(host.compareDocumentPosition(layer) & Node.DOCUMENT_POSITION_FOLLOWING);
334
+ }
335
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ɵSdQueryPanelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
336
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.17", type: ɵSdQueryPanelDirective, isStandalone: true, selector: "ng-template[sdQueryPanel]", inputs: { role: { classPropertyName: "role", publicName: "sdQueryPanel", isSignal: true, isRequired: true, transformFunction: null }, align: { classPropertyName: "align", publicName: "sdQueryPanelAlign", isSignal: true, isRequired: false, transformFunction: null }, controls: { classPropertyName: "controls", publicName: "sdQueryPanelControls", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "opened", closed: "closed" }, exportAs: ["sdQueryPanel"], ngImport: i0 });
337
+ }
338
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ɵSdQueryPanelDirective, decorators: [{
339
+ type: Directive,
340
+ args: [{
341
+ selector: 'ng-template[sdQueryPanel]',
342
+ exportAs: 'sdQueryPanel',
343
+ standalone: true,
344
+ }]
345
+ }], ctorParameters: () => [], propDecorators: { role: [{ type: i0.Input, args: [{ isSignal: true, alias: "sdQueryPanel", required: true }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "sdQueryPanelAlign", required: false }] }], controls: [{ type: i0.Input, args: [{ isSignal: true, alias: "sdQueryPanelControls", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
28
346
  /**
29
- * Saved-filters dropdown for `sd-query-bar`.
347
+ * Button (or `div[role=button]`) that opens a `ɵSdQueryPanelDirective`: click, Enter, Space. Sets `aria-haspopup`,
348
+ * `aria-expanded` and `aria-controls`; a second activation closes the panel.
30
349
  *
31
- * Self-contained: persists the list to `localStorage` under
32
- * `sd-query-bar:savedFilters:<key>` whenever the host passes a `[key]`. Without a
33
- * key the dropdown still renders (host can still preview the menu) but the
34
- * trigger stays disabled.
350
+ * Internal (`ɵ`): not part of SemVer.
351
+ */
352
+ class ɵSdQueryPanelTriggerDirective {
353
+ #host = inject(ElementRef).nativeElement;
354
+ #pointer = false;
355
+ #destroyed = false;
356
+ panel = input(undefined, { ...(ngDevMode ? { debugName: "panel" } : /* istanbul ignore next */ {}), alias: 'sdQueryPanelTrigger' });
357
+ /** The panel is opening for this trigger — emitted before its content renders. */
358
+ panelOpened = output();
359
+ /** The panel closed for this trigger. */
360
+ panelClosed = output();
361
+ /** The panel is open for this trigger. */
362
+ expanded = computed(() => {
363
+ const panel = this.panel();
364
+ return !!panel && panel.isOpen() && panel.origin() === this.#host;
365
+ }, ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
366
+ constructor() {
367
+ effect(onCleanup => {
368
+ const panel = this.panel();
369
+ if (!panel)
370
+ return;
371
+ const opening = panel.ɵopening.subscribe(origin => {
372
+ if (origin === this.#host && !this.#destroyed)
373
+ this.panelOpened.emit();
374
+ });
375
+ const closing = panel.ɵclosing.subscribe(({ origin, reason }) => {
376
+ if (origin === this.#host && !this.#destroyed && reason !== 'detach')
377
+ this.panelClosed.emit(reason);
378
+ });
379
+ onCleanup(() => {
380
+ opening.unsubscribe();
381
+ closing.unsubscribe();
382
+ });
383
+ });
384
+ inject(DestroyRef).onDestroy(() => {
385
+ this.#destroyed = true;
386
+ if (this.expanded())
387
+ this.panel()?.close('detach');
388
+ });
389
+ }
390
+ /** Opens the panel for this trigger (no-op when already open). `returnFocusTo` gets focus back on close. */
391
+ openMenu(returnFocusTo) {
392
+ if (!this.expanded())
393
+ this.panel()?.open(this.#host, { keyboard: true, returnFocusTo });
394
+ }
395
+ /** Closes the panel when it is open for this trigger. */
396
+ closeMenu() {
397
+ if (this.expanded())
398
+ this.panel()?.close('close');
399
+ }
400
+ onPointerDown() {
401
+ this.#pointer = true;
402
+ }
403
+ onClick() {
404
+ // why: click do Enter / Space trên <button> không có pointerdown đi trước — mở bằng bàn phím.
405
+ const keyboard = !this.#pointer;
406
+ this.#pointer = false;
407
+ this.#toggle(keyboard);
408
+ }
409
+ onKeydown(event) {
410
+ // <button> đã tự biến Enter / Space thành click.
411
+ if (this.#host.tagName === 'BUTTON' || (event.key !== 'Enter' && event.key !== ' '))
412
+ return;
413
+ if (event.target !== this.#host)
414
+ return;
415
+ event.preventDefault();
416
+ this.#toggle(true);
417
+ }
418
+ #toggle(keyboard) {
419
+ const panel = this.panel();
420
+ if (!panel)
421
+ return;
422
+ if (this.expanded())
423
+ panel.close('close');
424
+ else
425
+ panel.open(this.#host, { keyboard });
426
+ }
427
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ɵSdQueryPanelTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
428
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.17", type: ɵSdQueryPanelTriggerDirective, isStandalone: true, selector: "[sdQueryPanelTrigger]", inputs: { panel: { classPropertyName: "panel", publicName: "sdQueryPanelTrigger", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { panelOpened: "panelOpened", panelClosed: "panelClosed" }, host: { listeners: { "pointerdown": "onPointerDown()", "click": "onClick()", "keydown": "onKeydown($event)" }, properties: { "attr.aria-haspopup": "panel()?.role() ?? null", "attr.aria-expanded": "panel() ? expanded() : null", "attr.aria-controls": "expanded() ? panel()!.controlledId() : null" }, classAttribute: "sd-query-panel-trigger" }, exportAs: ["sdQueryPanelTrigger"], ngImport: i0 });
429
+ }
430
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ɵSdQueryPanelTriggerDirective, decorators: [{
431
+ type: Directive,
432
+ args: [{
433
+ selector: '[sdQueryPanelTrigger]',
434
+ exportAs: 'sdQueryPanelTrigger',
435
+ standalone: true,
436
+ host: {
437
+ class: 'sd-query-panel-trigger',
438
+ '[attr.aria-haspopup]': 'panel()?.role() ?? null',
439
+ '[attr.aria-expanded]': 'panel() ? expanded() : null',
440
+ '[attr.aria-controls]': 'expanded() ? panel()!.controlledId() : null',
441
+ '(pointerdown)': 'onPointerDown()',
442
+ '(click)': 'onClick()',
443
+ '(keydown)': 'onKeydown($event)',
444
+ },
445
+ }]
446
+ }], ctorParameters: () => [], propDecorators: { panel: [{ type: i0.Input, args: [{ isSignal: true, alias: "sdQueryPanelTrigger", required: false }] }], panelOpened: [{ type: i0.Output, args: ["panelOpened"] }], panelClosed: [{ type: i0.Output, args: ["panelClosed"] }] } });
447
+
448
+ /** localStorage key of the saved filters of `key` — unchanged since the first release, so old lists still load. */
449
+ const ɵsdSavedFiltersStorageKey = (key) => `sd-query-bar:savedFilters:${key}`;
450
+ // why: chép từ `components/table/src/services/table-query-params/table-query-params.util.ts` (ISO_DATE + reviver).
451
+ // query-bar không được import components/table (sai chiều phụ thuộc) và @sdcorejs/utils chưa có helper tương đương.
452
+ // Chỉ đúng định dạng `Date#toJSON` mới đọc lại thành `Date`; chuỗi ngày người dùng gõ (`2026-11-09`) giữ là chuỗi.
453
+ const ISO_DATE = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
454
+ const reviveDate = (_, value) => (typeof value === 'string' && ISO_DATE.test(value) ? new Date(value) : value);
455
+ const isSavedFilter = (value) => {
456
+ if (!value || typeof value !== 'object')
457
+ return false;
458
+ const { id, name, query } = value;
459
+ if (typeof id !== 'string' || !id || typeof name !== 'string' || !query || typeof query !== 'object')
460
+ return false;
461
+ return query.filters === undefined || Array.isArray(query.filters);
462
+ };
463
+ /**
464
+ * Parses the stored list. Dates written by `JSON.stringify` come back as `Date`. Entries without `id`, `name` or `query`
465
+ * are dropped one by one instead of losing the whole list.
466
+ */
467
+ function ɵsdReadSavedFilters(raw) {
468
+ if (raw === null || raw === '')
469
+ return { filters: [], error: false };
470
+ let parsed;
471
+ try {
472
+ parsed = JSON.parse(raw, reviveDate);
473
+ }
474
+ catch {
475
+ return { filters: [], error: true };
476
+ }
477
+ return Array.isArray(parsed) ? { filters: parsed.filter(isSavedFilter), error: false } : { filters: [], error: true };
478
+ }
479
+
480
+ let nextHeadingId = 0;
481
+ /**
482
+ * Saved-filters dropdown for `sd-query-bar` (handoff section 5).
35
483
  *
36
- * The host owns the live `[query]`: each save snapshots it into a new entry,
37
- * each apply emits the chosen filter back via `(apply)` for the host to install
38
- * into its own `filters` / `logic` / `search` model.
484
+ * Self-contained: persists the list to `localStorage` under `sd-query-bar:savedFilters:<key>` whenever the host passes
485
+ * a `[key]`. Without a key the trigger stays disabled.
39
486
  *
40
- * The save action (`promptSave`) is public so the parent toolbar can place its
41
- * own "Lưu bộ lọc" button anywhere — typically next to the Search trigger.
487
+ * The host owns the live `[query]`: each save snapshots it into a new entry, each apply emits the chosen filter back via
488
+ * `(apply)` for the host to install into its own `filters` / `logic` / `search`. Deleting asks nothing: the toast offers
489
+ * Undo, which puts the filter back where it was.
42
490
  */
43
491
  class SdQuerySavedFiltersMenu {
44
492
  #i18n = inject(I18nService);
45
493
  #confirm = inject(SdConfirmService);
494
+ #notify = inject(SdNotifyService);
495
+ #cdr = inject(ChangeDetectorRef);
46
496
  tooltipLabel = computed(() => this.#i18n.t('core.component.query-bar.saved-filters.tooltip'), ...(ngDevMode ? [{ debugName: "tooltipLabel" }] : /* istanbul ignore next */ []));
47
497
  tooltipDisabledLabel = computed(() => this.#i18n.t('core.component.query-bar.saved-filters.tooltip-disabled'), ...(ngDevMode ? [{ debugName: "tooltipDisabledLabel" }] : /* istanbul ignore next */ []));
48
- deleteLabel = computed(() => this.#i18n.t('core.component.query-bar.saved-filters.delete'), ...(ngDevMode ? [{ debugName: "deleteLabel" }] : /* istanbul ignore next */ []));
498
+ headingLabel = computed(() => this.#i18n.t('core.component.query-bar.saved-filters.heading'), ...(ngDevMode ? [{ debugName: "headingLabel" }] : /* istanbul ignore next */ []));
49
499
  emptyLabel = computed(() => this.#i18n.t('core.component.query-bar.saved-filters.empty'), ...(ngDevMode ? [{ debugName: "emptyLabel" }] : /* istanbul ignore next */ []));
500
+ readErrorLabel = computed(() => this.#i18n.t('core.component.query-bar.saved-filters.read-error'), ...(ngDevMode ? [{ debugName: "readErrorLabel" }] : /* istanbul ignore next */ []));
50
501
  saveLabel = computed(() => this.#i18n.t('core.component.query-bar.saved-filters.save'), ...(ngDevMode ? [{ debugName: "saveLabel" }] : /* istanbul ignore next */ []));
502
+ headingId = `sd-query-saved-filters-heading-${nextHeadingId++}`;
51
503
  /** Namespace key used to scope localStorage. `undefined` → menu disabled. */
52
504
  key = input(undefined, ...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
53
505
  /** Current query the host wants to snapshot when the user clicks "Save current". */
54
506
  query = input({ filters: [], logic: 'AND' }, ...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
507
+ /** `false` disables "Save current filter": no chip has a value and the search box is empty. */
508
+ canSave = input(true, { ...(ngDevMode ? { debugName: "canSave" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
509
+ /** Prefix of `data-autoid` (handoff section 12). */
510
+ autoId = input(undefined, ...(ngDevMode ? [{ debugName: "autoId" }] : /* istanbul ignore next */ []));
55
511
  /** Fired when the user picks a saved filter from the list. */
56
512
  apply = output();
57
513
  savedFilters = signal([], ...(ngDevMode ? [{ debugName: "savedFilters" }] : /* istanbul ignore next */ []));
514
+ /** The stored list could not be read (broken JSON, not an array, storage blocked). Saving replaces it. */
515
+ readError = signal(false, ...(ngDevMode ? [{ debugName: "readError" }] : /* istanbul ignore next */ []));
516
+ /** Delete buttons always shown at touch size (`pointer: coarse`), read when the panel opens. */
517
+ coarse = signal(false, ...(ngDevMode ? [{ debugName: "coarse" }] : /* istanbul ignore next */ []));
518
+ panel = viewChild.required('panel');
58
519
  #storageKey = computed(() => {
59
520
  const k = this.key();
60
- return k ? `sd-query-bar:savedFilters:${k}` : undefined;
521
+ return k ? ɵsdSavedFiltersStorageKey(k) : undefined;
61
522
  }, ...(ngDevMode ? [{ debugName: "#storageKey" }] : /* istanbul ignore next */ []));
62
523
  // why: reload whenever the namespace key changes (e.g. host switches user/context).
63
524
  #loadFilters = effect(() => {
64
525
  const storage = this.#storageKey();
65
526
  if (!storage) {
66
527
  this.savedFilters.set([]);
528
+ this.readError.set(false);
67
529
  return;
68
530
  }
531
+ let read;
69
532
  try {
70
- const raw = localStorage.getItem(storage);
71
- this.savedFilters.set(raw ? JSON.parse(raw) : []);
533
+ read = ɵsdReadSavedFilters(localStorage.getItem(storage));
72
534
  }
73
535
  catch {
74
- this.savedFilters.set([]);
536
+ // Storage bị chặn (SecurityError): như dữ liệu đọc không được.
537
+ read = { filters: [], error: true };
75
538
  }
539
+ this.savedFilters.set(read.filters);
540
+ this.readError.set(read.error);
76
541
  }, ...(ngDevMode ? [{ debugName: "#loadFilters" }] : /* istanbul ignore next */ []));
77
- #persist(filters) {
78
- const storage = this.#storageKey();
79
- if (!storage)
80
- return;
81
- try {
82
- localStorage.setItem(storage, JSON.stringify(filters));
83
- }
84
- catch {
85
- /* quota / disabled storage — silent */
86
- }
542
+ deleteLabel(name) {
543
+ return this.#i18n.t('core.component.query-bar.saved-filters.delete', { name });
544
+ }
545
+ autoIdOf(role) {
546
+ const base = this.autoId();
547
+ return base ? `${base}-${role}` : null;
548
+ }
549
+ /** Before the panel renders: touch devices show delete buttons without hover. */
550
+ onOpening() {
551
+ this.coarse.set(typeof window !== 'undefined' && !!window.matchMedia?.('(pointer: coarse)').matches);
87
552
  }
88
553
  /**
89
- * Prompt for a name and append a snapshot of the current query as a new
90
- * saved filter. Public so the parent toolbar can wire its external "save"
91
- * button to this method without re-implementing persistence.
554
+ * Prompt for a name and append a snapshot of the current query as a new saved filter. The bar itself does not change.
92
555
  */
93
556
  async promptSave() {
94
557
  if (!this.#storageKey())
95
558
  return;
96
- // why: window.prompt chặn UI thread, không style/i18n được và bị vô hiệu trong vài
97
- // môi trường (iframe sandbox) — dialog withInput dùng chung hạ tầng confirm của lib.
559
+ // why: window.prompt chặn UI thread, không style/i18n được và bị vô hiệu trong vài môi trường (iframe sandbox) —
560
+ // dialog withInput dùng chung hạ tầng confirm của lib.
98
561
  let name;
99
562
  try {
100
563
  name = await this.#confirm.withInput(this.#i18n.t('core.component.query-bar.saved-filters.name-label'), {
@@ -112,28 +575,145 @@ class SdQuerySavedFiltersMenu {
112
575
  name: name.trim(),
113
576
  query: this.query(),
114
577
  };
115
- const next = [...this.savedFilters(), filter];
116
- this.savedFilters.set(next);
117
- this.#persist(next);
578
+ this.#write([...this.savedFilters(), filter]);
118
579
  }
119
580
  /** Apply a saved filter — host re-installs filters/logic/search via `(apply)`. */
120
581
  pick(filter) {
582
+ this.panel().close('select');
121
583
  this.apply.emit(filter);
122
584
  }
123
- /** Delete a saved filter by id. Stops propagation so the parent button doesn't fire `pick`. */
124
- remove(id, ev) {
125
- ev?.stopPropagation();
126
- const next = this.savedFilters().filter(f => f.id !== id);
585
+ onSave() {
586
+ this.panel().close('select');
587
+ void this.promptSave();
588
+ }
589
+ /** Deletes the filter at `index` at once; the toast offers Undo. */
590
+ remove(index) {
591
+ const list = this.savedFilters();
592
+ const removed = list[index];
593
+ if (!removed || !this.#write(list.filter((_, i) => i !== index)))
594
+ return;
595
+ const storage = this.#storageKey();
596
+ this.#notify.info(removed.name, {
597
+ title: this.#i18n.t('core.component.query-bar.saved-filters.deleted'),
598
+ actionLabel: this.#i18n.t('core.component.query-bar.saved-filters.undo'),
599
+ onAction: () => this.#restore(removed, index, storage),
600
+ });
601
+ }
602
+ /** Delete from the panel: focus moves to the next row, else to "Save current filter". */
603
+ removeAt(index) {
604
+ this.remove(index);
605
+ this.#cdr.detectChanges();
606
+ const root = this.panel().element();
607
+ if (!root)
608
+ return;
609
+ const next = this.#applyButtons(root)[index] ??
610
+ root.querySelector('.c-sf-save:not(:disabled)') ??
611
+ this.#applyButtons(root).at(-1);
612
+ (next ?? root).focus();
613
+ }
614
+ /**
615
+ * Arrow keys move over the apply buttons and "Save current filter" only (handoff section 5.3); → or Tab reach the
616
+ * delete button of the row, ← or Shift+Tab come back; Delete removes the filter of an apply button.
617
+ */
618
+ onKeydown(event) {
619
+ const root = this.panel().element();
620
+ const target = event.target;
621
+ if (!root)
622
+ return;
623
+ // why: nút xoá cũng là menuitem nhưng nằm ngoài vòng mũi tên — chọn theo class, không theo role.
624
+ const items = Array.from(root.querySelectorAll('.c-sf-apply:not(:disabled), .c-sf-save:not(:disabled)'));
625
+ const row = target.closest('.c-sf-row');
626
+ const index = row ? Array.from(root.querySelectorAll('.c-sf-row')).indexOf(row) : -1;
627
+ const onApply = target.classList.contains('c-sf-apply');
628
+ const onDelete = target.classList.contains('c-sf-del');
629
+ const current = onDelete
630
+ ? items.indexOf(row.querySelector('.c-sf-apply'))
631
+ : items.indexOf(target);
632
+ const focusItem = (position) => {
633
+ if (items.length)
634
+ items[(position + items.length) % items.length].focus();
635
+ };
636
+ switch (event.key) {
637
+ case 'ArrowDown':
638
+ focusItem(current + 1);
639
+ break;
640
+ case 'ArrowUp':
641
+ focusItem(current < 0 ? -1 : current - 1);
642
+ break;
643
+ case 'Home':
644
+ focusItem(0);
645
+ break;
646
+ case 'End':
647
+ focusItem(-1);
648
+ break;
649
+ case 'ArrowRight':
650
+ if (!onApply)
651
+ return;
652
+ row.querySelector('.c-sf-del').focus();
653
+ break;
654
+ case 'ArrowLeft':
655
+ if (!onDelete)
656
+ return;
657
+ row.querySelector('.c-sf-apply').focus();
658
+ break;
659
+ case 'Tab':
660
+ // why: Tab ra khỏi panel thì panel tự đóng; chỉ giữ lại hai bước trong cùng một hàng.
661
+ if (onApply && !event.shiftKey)
662
+ row.querySelector('.c-sf-del').focus();
663
+ else if (onDelete && event.shiftKey)
664
+ row.querySelector('.c-sf-apply').focus();
665
+ else
666
+ return;
667
+ break;
668
+ case 'Delete':
669
+ if (!onApply)
670
+ return;
671
+ this.removeAt(index);
672
+ break;
673
+ default:
674
+ return;
675
+ }
676
+ event.preventDefault();
677
+ }
678
+ #applyButtons(root) {
679
+ return Array.from(root.querySelectorAll('.c-sf-apply'));
680
+ }
681
+ /** Undo of a delete: back at its old index, clamped to the current length. */
682
+ #restore(filter, index, storage) {
683
+ const list = this.savedFilters();
684
+ if (storage !== this.#storageKey() || list.some(item => item.id === filter.id))
685
+ return;
686
+ const at = Math.min(index, list.length);
687
+ this.#write([...list.slice(0, at), filter, ...list.slice(at)]);
688
+ }
689
+ /**
690
+ * Shows `next` and writes it. A failing write (quota, blocked storage) puts the previous list back and shows an error
691
+ * toast without the exception text.
692
+ */
693
+ #write(next) {
694
+ const storage = this.#storageKey();
695
+ if (!storage)
696
+ return false;
697
+ const previous = this.savedFilters();
127
698
  this.savedFilters.set(next);
128
- this.#persist(next);
699
+ try {
700
+ localStorage.setItem(storage, JSON.stringify(next));
701
+ }
702
+ catch {
703
+ this.savedFilters.set(previous);
704
+ this.#notify.error(this.#i18n.t('core.component.query-bar.saved-filters.write-error'));
705
+ return false;
706
+ }
707
+ this.readError.set(false);
708
+ return true;
129
709
  }
130
710
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQuerySavedFiltersMenu, deps: [], target: i0.ɵɵFactoryTarget.Component });
131
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdQuerySavedFiltersMenu, isStandalone: true, selector: "sd-query-saved-filters-menu", inputs: { key: { classPropertyName: "key", publicName: "key", isSignal: true, isRequired: false, transformFunction: null }, query: { classPropertyName: "query", publicName: "query", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { apply: "apply" }, ngImport: i0, template: "<button\n type=\"button\"\n class=\"c-saved-filters\"\n [disabled]=\"!key()\"\n [matMenuTriggerFor]=\"menu\"\n [matTooltip]=\"key() ? tooltipLabel() : tooltipDisabledLabel()\">\n <sd-icon name=\"bookmark_border\"></sd-icon>\n</button>\n\n<mat-menu #menu=\"matMenu\" class=\"c-saved-filters-menu\" xPosition=\"before\" yPosition=\"below\">\n @for (f of savedFilters(); track f.id) {\n <button type=\"button\" mat-menu-item class=\"c-sf-row\" (click)=\"pick(f)\">\n <sd-icon class=\"c-sf-lead\" name=\"filter_alt\"></sd-icon>\n <span class=\"c-sf-name\">{{ f.name }}</span>\n <span\n role=\"button\"\n tabindex=\"0\"\n class=\"c-sf-del\"\n [attr.aria-label]=\"deleteLabel()\"\n (click)=\"remove(f.id, $event)\"\n (keydown.enter)=\"remove(f.id, $event)\">\n <sd-icon name=\"close\"></sd-icon>\n </span>\n </button>\n } @empty {\n <div class=\"c-sf-empty\">{{ emptyLabel() }}</div>\n }\n <!-- why: footer save action s\u1ED1ng trong mat-menu \u0111\u1EC3 dropdown gom 1 v\u00F9ng (list +\n save) \u2014 user m\u1EDF dropdown th\u1EA5y ngay c\u1EA3 2 h\u00E0nh \u0111\u1ED9ng, kh\u00F4ng ph\u1EA3i t\u00ECm n\u00FAt l\u01B0u\n \u1EDF ch\u1ED7 kh\u00E1c tr\u00EAn toolbar. -->\n <hr class=\"c-sf-divider\" aria-hidden=\"true\" />\n <button type=\"button\" mat-menu-item class=\"c-sf-save\" [disabled]=\"!key()\" (click)=\"promptSave()\">\n <sd-icon name=\"bookmark_add\"></sd-icon>\n <span>{{ saveLabel() }}</span>\n </button>\n</mat-menu>\n", styles: [":host{display:inline-flex}.c-saved-filters{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:1px solid var(--sd-query-bar-border, #d6d8db);border-radius:var(--sd-radius-6, 6px);background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-query-bar-text-secondary, #5f6368);cursor:pointer;padding:0}.c-saved-filters sd-icon{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px}.c-saved-filters:hover:not([disabled]){border-color:var(--sd-primary);color:var(--sd-primary)}.c-saved-filters[disabled]{opacity:.5;cursor:not-allowed}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu{min-width:220px;max-width:320px}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .mat-mdc-menu-item.c-sf-row{min-height:40px;padding-left:16px;padding-right:4px}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .mat-mdc-menu-item.c-sf-row .mat-mdc-menu-item-text{display:flex;align-items:center;gap:8px;min-width:0;line-height:1.4}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .c-sf-lead{display:inline-flex;align-items:center;justify-content:center;margin-right:0;font-size:var(--sd-font-size-18, 18px)!important;width:18px!important;height:18px!important;line-height:1}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .c-sf-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .c-sf-del{flex:0 0 auto;margin-left:auto;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;color:var(--sd-query-bar-text-muted, #7a7a7a);cursor:pointer;padding:0}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .c-sf-del sd-icon{margin:0!important;padding:0;font-size:var(--sd-font-size-16, 16px)!important;width:16px!important;height:16px!important;line-height:var(--sd-line-height-16, 16px)!important;text-align:center;overflow:hidden}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .c-sf-del sd-icon mat-icon{margin:0!important}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .c-sf-del:hover{background:#0000000f;color:var(--sd-query-bar-chip-danger, #d23535)}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .c-sf-empty{padding:12px 16px;font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text-muted, #7a7a7a)}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .c-sf-divider{border:0;border-top:1px solid var(--sd-query-bar-border-soft, #e2e4e7);margin:4px 0}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .c-sf-save sd-icon{margin-right:8px}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
711
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdQuerySavedFiltersMenu, isStandalone: true, selector: "sd-query-saved-filters-menu", inputs: { key: { classPropertyName: "key", publicName: "key", isSignal: true, isRequired: false, transformFunction: null }, query: { classPropertyName: "query", publicName: "query", isSignal: true, isRequired: false, transformFunction: null }, canSave: { classPropertyName: "canSave", publicName: "canSave", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { apply: "apply" }, viewQueries: [{ propertyName: "panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _key = key();\n<button\n type=\"button\"\n class=\"c-saved-filters\"\n [disabled]=\"!_key\"\n [sdQueryPanelTrigger]=\"panel\"\n [matTooltip]=\"_key ? tooltipLabel() : tooltipDisabledLabel()\"\n [attr.aria-label]=\"tooltipLabel()\"\n [attr.data-autoid]=\"autoIdOf('saved-filters')\"\n (panelOpened)=\"onOpening()\">\n <sd-icon name=\"bookmark_border\"></sd-icon>\n</button>\n\n<!-- Panel theo khung Action Popover (handoff m\u1EE5c 5.2): ti\u00EAu \u0111\u1EC1, h\u00E0ng [n\u00FAt \u00E1p | n\u00FAt xo\u00E1], \u0111\u01B0\u1EDDng k\u1EBB, \"L\u01B0u b\u1ED9 l\u1ECDc hi\u1EC7n t\u1EA1i\".\n why: n\u00FAt xo\u00E1 l\u00E0 button th\u01B0\u1EDDng \u0111\u1EB7t C\u1EA0NH n\u00FAt \u00E1p (kh\u00F4ng l\u1ED3ng trong nhau, ngo\u00E0i v\u00F2ng m\u0169i t\u00EAn c\u1EE7a menu). -->\n<ng-template sdQueryPanel=\"menu\" sdQueryPanelAlign=\"end\" #panel=\"sdQueryPanel\">\n <div\n class=\"sd-query-panel sd-query-panel--list c-saved-filters-menu\"\n role=\"menu\"\n tabindex=\"-1\"\n [class.c-saved-filters-menu--coarse]=\"coarse()\"\n [attr.aria-labelledby]=\"headingId\"\n [attr.data-autoid]=\"autoIdOf('panel-saved-filters')\"\n (keydown)=\"onKeydown($event)\">\n <div class=\"c-sf-heading\" [id]=\"headingId\">{{ headingLabel() }}</div>\n @if (readError()) {\n <div class=\"c-sf-state c-sf-state--error\">\n <sd-icon name=\"error\" size=\"16px\" aria-hidden=\"true\"></sd-icon>\n <span>{{ readErrorLabel() }}</span>\n </div>\n }\n @for (f of savedFilters(); track f.id; let i = $index) {\n <div class=\"c-sf-row\" role=\"none\">\n <button\n type=\"button\"\n role=\"menuitem\"\n tabindex=\"-1\"\n class=\"c-sf-apply\"\n [attr.data-autoid]=\"autoIdOf('saved-filter-' + i)\"\n (click)=\"pick(f)\">\n <sd-icon class=\"c-sf-lead\" name=\"filter_alt\" size=\"18px\" aria-hidden=\"true\"></sd-icon>\n <span class=\"c-sf-name\">{{ f.name }}</span>\n </button>\n <!-- why: menu ch\u1EC9 \u0111\u01B0\u1EE3c s\u1EDF h\u1EEFu menuitem (axe aria-required-children, PD sau R1 G-3) \u2014 n\u00FAt xo\u00E1 c\u0169ng l\u00E0 menuitem,\n v\u1EABn ngo\u00E0i v\u00F2ng m\u0169i t\u00EAn (\u2192 / Tab t\u1EDBi n\u00F3). -->\n <button\n type=\"button\"\n role=\"menuitem\"\n tabindex=\"-1\"\n class=\"c-sf-del\"\n [attr.aria-label]=\"deleteLabel(f.name)\"\n [attr.data-autoid]=\"autoIdOf('saved-filter-' + i + '-delete')\"\n (click)=\"removeAt(i)\">\n <sd-icon name=\"delete\" size=\"18px\" aria-hidden=\"true\"></sd-icon>\n </button>\n </div>\n } @empty {\n @if (!readError()) {\n <div class=\"c-sf-state\">{{ emptyLabel() }}</div>\n }\n }\n <div class=\"c-sf-divider\" role=\"separator\"></div>\n <button\n type=\"button\"\n role=\"menuitem\"\n tabindex=\"-1\"\n class=\"c-sf-save\"\n [disabled]=\"!_key || !canSave()\"\n [attr.data-autoid]=\"autoIdOf('saved-filters-save')\"\n (click)=\"onSave()\">\n <sd-icon name=\"bookmark_add\" size=\"18px\" aria-hidden=\"true\"></sd-icon>\n <span>{{ saveLabel() }}</span>\n </button>\n </div>\n</ng-template>\n", styles: [":host{display:inline-flex}.c-saved-filters{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:1px solid var(--sd-query-bar-border, #d6d8db);border-radius:var(--sd-radius-6, 6px);background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-query-bar-text-secondary, #5f6368);cursor:pointer;padding:0}.c-saved-filters sd-icon{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px}.c-saved-filters:hover:not([disabled]){border-color:var(--sd-primary);color:var(--sd-primary)}.c-saved-filters[disabled]{opacity:.5;cursor:not-allowed}.c-saved-filters-menu{box-sizing:border-box;min-width:min(160px,100vw - 16px);max-width:min(320px,100vw - 16px);max-height:min(360px,100dvh - 16px);overflow:auto;border:1px solid var(--sd-border, #dde0e5);border-radius:var(--sd-radius-8, 8px);background:var(--sd-surface, var(--sd-white, #fff));color:var(--sd-text, #1a1b1f);box-shadow:0 4px 12px #0f172a24,0 1px 3px #0f172a1a;padding:4px;min-width:min(220px,100vw - 16px)}.c-saved-filters-menu:focus{outline:none}.c-sf-heading{padding:4px 12px;font-size:var(--sd-font-size-12, 12px);color:var(--sd-text-secondary, #555)}.c-sf-divider{border-top:1px solid var(--sd-border, #dde0e5);margin:4px 8px}.c-sf-row{display:flex;align-items:center;gap:2px;border-radius:var(--sd-radius-4, 4px)}.c-sf-row:hover,.c-sf-row:focus-within{background:color-mix(in srgb,var(--sd-text, #1a1b1f) 8%,transparent)}.c-sf-apply{display:flex;flex:1 1 auto;align-items:center;gap:8px;box-sizing:border-box;min-width:0;min-height:40px;padding:8px 4px 8px 12px;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:inherit;font:inherit;font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px);text-align:start;cursor:pointer}.c-sf-apply:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}@media(pointer:coarse){.c-sf-apply{min-height:44px}}.c-sf-lead{flex:0 0 18px;width:18px;height:18px;font-size:var(--sd-font-size-18, 18px);color:var(--sd-action-accent, inherit)}.c-sf-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-sf-del{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;box-sizing:border-box;width:32px;height:32px;margin-right:4px;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sd-text-secondary, #555);cursor:pointer;opacity:0}.c-sf-del sd-icon{width:18px;height:18px;font-size:var(--sd-font-size-18, 18px)}.c-sf-del:hover{background:color-mix(in srgb,var(--sd-error) 8%,transparent);color:var(--sd-error)}.c-sf-del:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}.c-sf-row:hover .c-sf-del,.c-sf-row:focus-within .c-sf-del,.c-saved-filters-menu--coarse .c-sf-del{opacity:1}.c-saved-filters-menu--coarse .c-sf-del{width:40px;height:40px}.c-sf-save{display:flex;align-items:center;gap:8px;box-sizing:border-box;width:100%;min-height:40px;padding:8px 12px;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:inherit;font:inherit;font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px);text-align:start;overflow-wrap:anywhere;cursor:pointer}.c-sf-save:hover:not(:disabled),.c-sf-save:focus-visible{background:color-mix(in srgb,var(--sd-action-accent, var(--sd-text, #1a1b1f)) 8%,transparent)}.c-sf-save:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}.c-sf-save:disabled{opacity:.45;cursor:default}@media(pointer:coarse){.c-sf-save{min-height:44px}}.c-sf-save sd-icon{flex:0 0 18px;width:18px;height:18px;font-size:var(--sd-font-size-18, 18px);color:var(--sd-action-accent, inherit);color:var(--sd-primary)}.c-sf-state{display:flex;align-items:center;gap:8px;padding:12px;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);color:var(--sd-text-secondary, #555)}.c-sf-state sd-icon{flex:0 0 16px;width:16px;height:16px;font-size:var(--sd-font-size-16, 16px);color:var(--sd-error)}.c-sf-state--error{color:var(--sd-text, #1a1b1f)}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: ɵSdQueryPanelDirective, selector: "ng-template[sdQueryPanel]", inputs: ["sdQueryPanel", "sdQueryPanelAlign", "sdQueryPanelControls"], outputs: ["opened", "closed"], exportAs: ["sdQueryPanel"] }, { kind: "directive", type: ɵSdQueryPanelTriggerDirective, selector: "[sdQueryPanelTrigger]", inputs: ["sdQueryPanelTrigger"], outputs: ["panelOpened", "panelClosed"], exportAs: ["sdQueryPanelTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
132
712
  }
133
713
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQuerySavedFiltersMenu, decorators: [{
134
714
  type: Component,
135
- args: [{ selector: 'sd-query-saved-filters-menu', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SdIcon, MatMenuModule, MatTooltipModule], template: "<button\n type=\"button\"\n class=\"c-saved-filters\"\n [disabled]=\"!key()\"\n [matMenuTriggerFor]=\"menu\"\n [matTooltip]=\"key() ? tooltipLabel() : tooltipDisabledLabel()\">\n <sd-icon name=\"bookmark_border\"></sd-icon>\n</button>\n\n<mat-menu #menu=\"matMenu\" class=\"c-saved-filters-menu\" xPosition=\"before\" yPosition=\"below\">\n @for (f of savedFilters(); track f.id) {\n <button type=\"button\" mat-menu-item class=\"c-sf-row\" (click)=\"pick(f)\">\n <sd-icon class=\"c-sf-lead\" name=\"filter_alt\"></sd-icon>\n <span class=\"c-sf-name\">{{ f.name }}</span>\n <span\n role=\"button\"\n tabindex=\"0\"\n class=\"c-sf-del\"\n [attr.aria-label]=\"deleteLabel()\"\n (click)=\"remove(f.id, $event)\"\n (keydown.enter)=\"remove(f.id, $event)\">\n <sd-icon name=\"close\"></sd-icon>\n </span>\n </button>\n } @empty {\n <div class=\"c-sf-empty\">{{ emptyLabel() }}</div>\n }\n <!-- why: footer save action s\u1ED1ng trong mat-menu \u0111\u1EC3 dropdown gom 1 v\u00F9ng (list +\n save) \u2014 user m\u1EDF dropdown th\u1EA5y ngay c\u1EA3 2 h\u00E0nh \u0111\u1ED9ng, kh\u00F4ng ph\u1EA3i t\u00ECm n\u00FAt l\u01B0u\n \u1EDF ch\u1ED7 kh\u00E1c tr\u00EAn toolbar. -->\n <hr class=\"c-sf-divider\" aria-hidden=\"true\" />\n <button type=\"button\" mat-menu-item class=\"c-sf-save\" [disabled]=\"!key()\" (click)=\"promptSave()\">\n <sd-icon name=\"bookmark_add\"></sd-icon>\n <span>{{ saveLabel() }}</span>\n </button>\n</mat-menu>\n", styles: [":host{display:inline-flex}.c-saved-filters{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:1px solid var(--sd-query-bar-border, #d6d8db);border-radius:var(--sd-radius-6, 6px);background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-query-bar-text-secondary, #5f6368);cursor:pointer;padding:0}.c-saved-filters sd-icon{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px}.c-saved-filters:hover:not([disabled]){border-color:var(--sd-primary);color:var(--sd-primary)}.c-saved-filters[disabled]{opacity:.5;cursor:not-allowed}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu{min-width:220px;max-width:320px}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .mat-mdc-menu-item.c-sf-row{min-height:40px;padding-left:16px;padding-right:4px}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .mat-mdc-menu-item.c-sf-row .mat-mdc-menu-item-text{display:flex;align-items:center;gap:8px;min-width:0;line-height:1.4}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .c-sf-lead{display:inline-flex;align-items:center;justify-content:center;margin-right:0;font-size:var(--sd-font-size-18, 18px)!important;width:18px!important;height:18px!important;line-height:1}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .c-sf-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .c-sf-del{flex:0 0 auto;margin-left:auto;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;color:var(--sd-query-bar-text-muted, #7a7a7a);cursor:pointer;padding:0}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .c-sf-del sd-icon{margin:0!important;padding:0;font-size:var(--sd-font-size-16, 16px)!important;width:16px!important;height:16px!important;line-height:var(--sd-line-height-16, 16px)!important;text-align:center;overflow:hidden}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .c-sf-del sd-icon mat-icon{margin:0!important}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .c-sf-del:hover{background:#0000000f;color:var(--sd-query-bar-chip-danger, #d23535)}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .c-sf-empty{padding:12px 16px;font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text-muted, #7a7a7a)}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .c-sf-divider{border:0;border-top:1px solid var(--sd-query-bar-border-soft, #e2e4e7);margin:4px 0}::ng-deep .mat-mdc-menu-panel.c-saved-filters-menu .c-sf-save sd-icon{margin-right:8px}\n"] }]
136
- }], propDecorators: { key: [{ type: i0.Input, args: [{ isSignal: true, alias: "key", required: false }] }], query: [{ type: i0.Input, args: [{ isSignal: true, alias: "query", required: false }] }], apply: [{ type: i0.Output, args: ["apply"] }] } });
715
+ args: [{ selector: 'sd-query-saved-filters-menu', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SdIcon, MatTooltipModule, ɵSdQueryPanelDirective, ɵSdQueryPanelTriggerDirective], template: "@let _key = key();\n<button\n type=\"button\"\n class=\"c-saved-filters\"\n [disabled]=\"!_key\"\n [sdQueryPanelTrigger]=\"panel\"\n [matTooltip]=\"_key ? tooltipLabel() : tooltipDisabledLabel()\"\n [attr.aria-label]=\"tooltipLabel()\"\n [attr.data-autoid]=\"autoIdOf('saved-filters')\"\n (panelOpened)=\"onOpening()\">\n <sd-icon name=\"bookmark_border\"></sd-icon>\n</button>\n\n<!-- Panel theo khung Action Popover (handoff m\u1EE5c 5.2): ti\u00EAu \u0111\u1EC1, h\u00E0ng [n\u00FAt \u00E1p | n\u00FAt xo\u00E1], \u0111\u01B0\u1EDDng k\u1EBB, \"L\u01B0u b\u1ED9 l\u1ECDc hi\u1EC7n t\u1EA1i\".\n why: n\u00FAt xo\u00E1 l\u00E0 button th\u01B0\u1EDDng \u0111\u1EB7t C\u1EA0NH n\u00FAt \u00E1p (kh\u00F4ng l\u1ED3ng trong nhau, ngo\u00E0i v\u00F2ng m\u0169i t\u00EAn c\u1EE7a menu). -->\n<ng-template sdQueryPanel=\"menu\" sdQueryPanelAlign=\"end\" #panel=\"sdQueryPanel\">\n <div\n class=\"sd-query-panel sd-query-panel--list c-saved-filters-menu\"\n role=\"menu\"\n tabindex=\"-1\"\n [class.c-saved-filters-menu--coarse]=\"coarse()\"\n [attr.aria-labelledby]=\"headingId\"\n [attr.data-autoid]=\"autoIdOf('panel-saved-filters')\"\n (keydown)=\"onKeydown($event)\">\n <div class=\"c-sf-heading\" [id]=\"headingId\">{{ headingLabel() }}</div>\n @if (readError()) {\n <div class=\"c-sf-state c-sf-state--error\">\n <sd-icon name=\"error\" size=\"16px\" aria-hidden=\"true\"></sd-icon>\n <span>{{ readErrorLabel() }}</span>\n </div>\n }\n @for (f of savedFilters(); track f.id; let i = $index) {\n <div class=\"c-sf-row\" role=\"none\">\n <button\n type=\"button\"\n role=\"menuitem\"\n tabindex=\"-1\"\n class=\"c-sf-apply\"\n [attr.data-autoid]=\"autoIdOf('saved-filter-' + i)\"\n (click)=\"pick(f)\">\n <sd-icon class=\"c-sf-lead\" name=\"filter_alt\" size=\"18px\" aria-hidden=\"true\"></sd-icon>\n <span class=\"c-sf-name\">{{ f.name }}</span>\n </button>\n <!-- why: menu ch\u1EC9 \u0111\u01B0\u1EE3c s\u1EDF h\u1EEFu menuitem (axe aria-required-children, PD sau R1 G-3) \u2014 n\u00FAt xo\u00E1 c\u0169ng l\u00E0 menuitem,\n v\u1EABn ngo\u00E0i v\u00F2ng m\u0169i t\u00EAn (\u2192 / Tab t\u1EDBi n\u00F3). -->\n <button\n type=\"button\"\n role=\"menuitem\"\n tabindex=\"-1\"\n class=\"c-sf-del\"\n [attr.aria-label]=\"deleteLabel(f.name)\"\n [attr.data-autoid]=\"autoIdOf('saved-filter-' + i + '-delete')\"\n (click)=\"removeAt(i)\">\n <sd-icon name=\"delete\" size=\"18px\" aria-hidden=\"true\"></sd-icon>\n </button>\n </div>\n } @empty {\n @if (!readError()) {\n <div class=\"c-sf-state\">{{ emptyLabel() }}</div>\n }\n }\n <div class=\"c-sf-divider\" role=\"separator\"></div>\n <button\n type=\"button\"\n role=\"menuitem\"\n tabindex=\"-1\"\n class=\"c-sf-save\"\n [disabled]=\"!_key || !canSave()\"\n [attr.data-autoid]=\"autoIdOf('saved-filters-save')\"\n (click)=\"onSave()\">\n <sd-icon name=\"bookmark_add\" size=\"18px\" aria-hidden=\"true\"></sd-icon>\n <span>{{ saveLabel() }}</span>\n </button>\n </div>\n</ng-template>\n", styles: [":host{display:inline-flex}.c-saved-filters{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:1px solid var(--sd-query-bar-border, #d6d8db);border-radius:var(--sd-radius-6, 6px);background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-query-bar-text-secondary, #5f6368);cursor:pointer;padding:0}.c-saved-filters sd-icon{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px}.c-saved-filters:hover:not([disabled]){border-color:var(--sd-primary);color:var(--sd-primary)}.c-saved-filters[disabled]{opacity:.5;cursor:not-allowed}.c-saved-filters-menu{box-sizing:border-box;min-width:min(160px,100vw - 16px);max-width:min(320px,100vw - 16px);max-height:min(360px,100dvh - 16px);overflow:auto;border:1px solid var(--sd-border, #dde0e5);border-radius:var(--sd-radius-8, 8px);background:var(--sd-surface, var(--sd-white, #fff));color:var(--sd-text, #1a1b1f);box-shadow:0 4px 12px #0f172a24,0 1px 3px #0f172a1a;padding:4px;min-width:min(220px,100vw - 16px)}.c-saved-filters-menu:focus{outline:none}.c-sf-heading{padding:4px 12px;font-size:var(--sd-font-size-12, 12px);color:var(--sd-text-secondary, #555)}.c-sf-divider{border-top:1px solid var(--sd-border, #dde0e5);margin:4px 8px}.c-sf-row{display:flex;align-items:center;gap:2px;border-radius:var(--sd-radius-4, 4px)}.c-sf-row:hover,.c-sf-row:focus-within{background:color-mix(in srgb,var(--sd-text, #1a1b1f) 8%,transparent)}.c-sf-apply{display:flex;flex:1 1 auto;align-items:center;gap:8px;box-sizing:border-box;min-width:0;min-height:40px;padding:8px 4px 8px 12px;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:inherit;font:inherit;font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px);text-align:start;cursor:pointer}.c-sf-apply:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}@media(pointer:coarse){.c-sf-apply{min-height:44px}}.c-sf-lead{flex:0 0 18px;width:18px;height:18px;font-size:var(--sd-font-size-18, 18px);color:var(--sd-action-accent, inherit)}.c-sf-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-sf-del{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;box-sizing:border-box;width:32px;height:32px;margin-right:4px;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sd-text-secondary, #555);cursor:pointer;opacity:0}.c-sf-del sd-icon{width:18px;height:18px;font-size:var(--sd-font-size-18, 18px)}.c-sf-del:hover{background:color-mix(in srgb,var(--sd-error) 8%,transparent);color:var(--sd-error)}.c-sf-del:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}.c-sf-row:hover .c-sf-del,.c-sf-row:focus-within .c-sf-del,.c-saved-filters-menu--coarse .c-sf-del{opacity:1}.c-saved-filters-menu--coarse .c-sf-del{width:40px;height:40px}.c-sf-save{display:flex;align-items:center;gap:8px;box-sizing:border-box;width:100%;min-height:40px;padding:8px 12px;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:inherit;font:inherit;font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px);text-align:start;overflow-wrap:anywhere;cursor:pointer}.c-sf-save:hover:not(:disabled),.c-sf-save:focus-visible{background:color-mix(in srgb,var(--sd-action-accent, var(--sd-text, #1a1b1f)) 8%,transparent)}.c-sf-save:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}.c-sf-save:disabled{opacity:.45;cursor:default}@media(pointer:coarse){.c-sf-save{min-height:44px}}.c-sf-save sd-icon{flex:0 0 18px;width:18px;height:18px;font-size:var(--sd-font-size-18, 18px);color:var(--sd-action-accent, inherit);color:var(--sd-primary)}.c-sf-state{display:flex;align-items:center;gap:8px;padding:12px;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);color:var(--sd-text-secondary, #555)}.c-sf-state sd-icon{flex:0 0 16px;width:16px;height:16px;font-size:var(--sd-font-size-16, 16px);color:var(--sd-error)}.c-sf-state--error{color:var(--sd-text, #1a1b1f)}\n"] }]
716
+ }], propDecorators: { key: [{ type: i0.Input, args: [{ isSignal: true, alias: "key", required: false }] }], query: [{ type: i0.Input, args: [{ isSignal: true, alias: "query", required: false }] }], canSave: [{ type: i0.Input, args: [{ isSignal: true, alias: "canSave", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], apply: [{ type: i0.Output, args: ["apply"] }], panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }] } });
137
717
 
138
718
  /**
139
719
  * Right-pinned toolbar for `sd-query-bar`: AND/OR connector toggle, clear-all,
@@ -141,7 +721,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
141
721
  * Search trigger. Owns no business logic — just routes user intent back via
142
722
  * outputs (`(logic)` model, `(clear)`, `(search)`, `(applyFilter)`).
143
723
  *
144
- * The "save current query" action lives INSIDE the saved-filters mat-menu
724
+ * The "save current query" action lives INSIDE the saved-filters panel
145
725
  * footer (one zone for both apply + save). The dropdown trigger sits
146
726
  * immediately before Search so the user sees one filter-cluster on the right.
147
727
  */
@@ -155,6 +735,10 @@ class SdQueryActionsBar {
155
735
  showSavedFilters = input(false, { ...(ngDevMode ? { debugName: "showSavedFilters" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
156
736
  savedFiltersKey = input(undefined, ...(ngDevMode ? [{ debugName: "savedFiltersKey" }] : /* istanbul ignore next */ []));
157
737
  query = input({ filters: [], logic: 'AND' }, ...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
738
+ /** `false` disables "Save current filter" (nothing to save). */
739
+ canSaveFilter = input(true, ...(ngDevMode ? [{ debugName: "canSaveFilter" }] : /* istanbul ignore next */ []));
740
+ /** Prefix of `data-autoid` for the saved-filters controls. */
741
+ autoId = input(undefined, ...(ngDevMode ? [{ debugName: "autoId" }] : /* istanbul ignore next */ []));
158
742
  applyFilter = output();
159
743
  // Clear-all —
160
744
  showClearAll = input(true, { ...(ngDevMode ? { debugName: "showClearAll" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
@@ -186,12 +770,12 @@ class SdQueryActionsBar {
186
770
  this.logic.set(value);
187
771
  }
188
772
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQueryActionsBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
189
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdQueryActionsBar, isStandalone: true, selector: "sd-query-actions-bar", inputs: { showLogicToggle: { classPropertyName: "showLogicToggle", publicName: "showLogicToggle", isSignal: true, isRequired: false, transformFunction: null }, logic: { classPropertyName: "logic", publicName: "logic", isSignal: true, isRequired: false, transformFunction: null }, filtersCount: { classPropertyName: "filtersCount", publicName: "filtersCount", isSignal: true, isRequired: false, transformFunction: null }, showSavedFilters: { classPropertyName: "showSavedFilters", publicName: "showSavedFilters", isSignal: true, isRequired: false, transformFunction: null }, savedFiltersKey: { classPropertyName: "savedFiltersKey", publicName: "savedFiltersKey", isSignal: true, isRequired: false, transformFunction: null }, query: { classPropertyName: "query", publicName: "query", isSignal: true, isRequired: false, transformFunction: null }, showClearAll: { classPropertyName: "showClearAll", publicName: "showClearAll", isSignal: true, isRequired: false, transformFunction: null }, clearCount: { classPropertyName: "clearCount", publicName: "clearCount", isSignal: true, isRequired: false, transformFunction: null }, clearDisabled: { classPropertyName: "clearDisabled", publicName: "clearDisabled", isSignal: true, isRequired: false, transformFunction: null }, canSearch: { classPropertyName: "canSearch", publicName: "canSearch", isSignal: true, isRequired: false, transformFunction: null }, showSearchButton: { classPropertyName: "showSearchButton", publicName: "showSearchButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { logic: "logicChange", applyFilter: "applyFilter", clear: "clear", search: "search" }, ngImport: i0, template: "<!-- Vertical separator between the wrapping filter area (left) and the pinned toolbar. -->\n<span class=\"c-bar-divider\" aria-hidden=\"true\"></span>\n\n<div class=\"c-query-bar__actions\">\n <!-- AND / OR toggle -->\n @if (showLogicToggle() && filtersCount() >= 2) {\n <div class=\"c-logic-toggle\" role=\"group\" [attr.aria-label]=\"logicGroupLabel()\">\n <button\n type=\"button\"\n class=\"c-logic-segment\"\n [class.c-logic-active]=\"logic() === 'AND'\"\n (click)=\"setLogic('AND')\">\n AND\n </button>\n <button\n type=\"button\"\n class=\"c-logic-segment\"\n [class.c-logic-active]=\"logic() === 'OR'\"\n (click)=\"setLogic('OR')\">\n OR\n </button>\n </div>\n }\n\n @if (showClearAll() && filtersCount() > 0) {\n <button\n type=\"button\"\n class=\"c-clear-all\"\n [disabled]=\"clearDisabled()\"\n [matTooltip]=\"clearAllLabel()\"\n [attr.aria-label]=\"clearAllLabel()\"\n (click)=\"clear.emit()\">\n <sd-icon name=\"delete_sweep\"></sd-icon>\n </button>\n }\n\n <!-- why: saved-filters dropdown \u0111\u1EB7t s\u00E1t ngay tr\u01B0\u1EDBc Search \u2014 gom to\u00E0n b\u1ED9\n h\u00E0nh \u0111\u1ED9ng v\u1EC1 b\u1ED9 l\u1ECDc (apply view c\u0169 / l\u01B0u view hi\u1EC7n t\u1EA1i) c\u1EA1nh n\u00FAt submit,\n user th\u1EA5y 1 c\u1EE5m. Footer \"L\u01B0u b\u1ED9 l\u1ECDc hi\u1EC7n t\u1EA1i\" s\u1ED1ng trong mat-menu c\u1EE7a\n saved-filters-menu, kh\u00F4ng t\u00E1ch ra n\u00FAt ri\u00EAng n\u1EEFa. -->\n @if (showSavedFilters()) {\n <sd-query-saved-filters-menu\n [key]=\"savedFiltersKey()\"\n [query]=\"query()\"\n (apply)=\"applyFilter.emit($event)\" />\n }\n\n <!-- why: far-right \"submit at the end of the toolbar\" position; sole query trigger.\n Hidden when every chip edit applies on its own (bar applyOn: 'commit'). -->\n @if (showSearchButton()) {\n <button\n type=\"button\"\n class=\"c-search-trigger\"\n [disabled]=\"!canSearch()\"\n [matTooltip]=\"searchLabel()\"\n (click)=\"search.emit()\">\n <sd-icon name=\"search\"></sd-icon>\n </button>\n }\n</div>\n", styles: [":host{display:contents}.c-bar-divider{flex:0 0 auto;align-self:stretch;width:1px;min-height:28px;background:var(--sd-query-bar-border-soft, #e2e4e7)}.c-query-bar__actions{flex:0 0 auto;display:flex;align-items:center;gap:6px}.c-logic-toggle{display:inline-flex;align-items:center;padding:2px;background:var(--sd-query-bar-bg-soft, #f5f6f7);border:1px solid var(--sd-query-bar-border-soft, #e2e4e7);border-radius:6px}:host-context(.c-density-compact) .c-logic-toggle{height:28px}:host-context(.c-density-comfortable) .c-logic-toggle{height:32px}.c-logic-toggle .c-logic-segment{height:100%;padding:0 10px;border:none;background:transparent;font-family:Roboto Mono,monospace;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-semibold, 600);letter-spacing:.4px;color:var(--sd-query-bar-text-secondary, #5f6368);cursor:pointer;border-radius:4px}.c-logic-toggle .c-logic-segment.c-logic-active{background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-primary);box-shadow:0 1px 2px #00000014}.c-clear-all,.c-search-trigger{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--sd-query-bar-border, #d6d8db);border-radius:6px;background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-query-bar-text-secondary, #5f6368);cursor:pointer;padding:0}:host-context(.c-density-compact) .c-clear-all,:host-context(.c-density-compact) .c-search-trigger{width:28px;height:28px}:host-context(.c-density-comfortable) .c-clear-all,:host-context(.c-density-comfortable) .c-search-trigger{width:32px;height:32px}.c-clear-all sd-icon,.c-search-trigger sd-icon{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px}.c-clear-all:hover:not([disabled]),.c-search-trigger:hover:not([disabled]){border-color:var(--sd-primary);color:var(--sd-primary)}.c-clear-all[disabled],.c-search-trigger[disabled]{opacity:.5;cursor:not-allowed}.c-clear-all:hover{border-color:var(--sd-query-bar-danger, #dc2626);color:var(--sd-query-bar-danger, #dc2626)}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: SdQuerySavedFiltersMenu, selector: "sd-query-saved-filters-menu", inputs: ["key", "query"], outputs: ["apply"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
773
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdQueryActionsBar, isStandalone: true, selector: "sd-query-actions-bar", inputs: { showLogicToggle: { classPropertyName: "showLogicToggle", publicName: "showLogicToggle", isSignal: true, isRequired: false, transformFunction: null }, logic: { classPropertyName: "logic", publicName: "logic", isSignal: true, isRequired: false, transformFunction: null }, filtersCount: { classPropertyName: "filtersCount", publicName: "filtersCount", isSignal: true, isRequired: false, transformFunction: null }, showSavedFilters: { classPropertyName: "showSavedFilters", publicName: "showSavedFilters", isSignal: true, isRequired: false, transformFunction: null }, savedFiltersKey: { classPropertyName: "savedFiltersKey", publicName: "savedFiltersKey", isSignal: true, isRequired: false, transformFunction: null }, query: { classPropertyName: "query", publicName: "query", isSignal: true, isRequired: false, transformFunction: null }, canSaveFilter: { classPropertyName: "canSaveFilter", publicName: "canSaveFilter", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, showClearAll: { classPropertyName: "showClearAll", publicName: "showClearAll", isSignal: true, isRequired: false, transformFunction: null }, clearCount: { classPropertyName: "clearCount", publicName: "clearCount", isSignal: true, isRequired: false, transformFunction: null }, clearDisabled: { classPropertyName: "clearDisabled", publicName: "clearDisabled", isSignal: true, isRequired: false, transformFunction: null }, canSearch: { classPropertyName: "canSearch", publicName: "canSearch", isSignal: true, isRequired: false, transformFunction: null }, showSearchButton: { classPropertyName: "showSearchButton", publicName: "showSearchButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { logic: "logicChange", applyFilter: "applyFilter", clear: "clear", search: "search" }, ngImport: i0, template: "<!-- Vertical separator between the wrapping filter area (left) and the pinned toolbar. -->\n<span class=\"c-bar-divider\" aria-hidden=\"true\"></span>\n\n<div class=\"c-query-bar__actions\">\n <!-- AND / OR toggle -->\n @if (showLogicToggle() && filtersCount() >= 2) {\n <div class=\"c-logic-toggle\" role=\"group\" [attr.aria-label]=\"logicGroupLabel()\">\n <button\n type=\"button\"\n class=\"c-logic-segment\"\n [class.c-logic-active]=\"logic() === 'AND'\"\n (click)=\"setLogic('AND')\">\n AND\n </button>\n <button\n type=\"button\"\n class=\"c-logic-segment\"\n [class.c-logic-active]=\"logic() === 'OR'\"\n (click)=\"setLogic('OR')\">\n OR\n </button>\n </div>\n }\n\n @if (showClearAll() && filtersCount() > 0) {\n <button\n type=\"button\"\n class=\"c-clear-all\"\n [disabled]=\"clearDisabled()\"\n [matTooltip]=\"clearAllLabel()\"\n [attr.aria-label]=\"clearAllLabel()\"\n (click)=\"clear.emit()\">\n <sd-icon name=\"delete_sweep\"></sd-icon>\n </button>\n }\n\n <!-- why: saved-filters dropdown \u0111\u1EB7t s\u00E1t ngay tr\u01B0\u1EDBc Search \u2014 gom to\u00E0n b\u1ED9\n h\u00E0nh \u0111\u1ED9ng v\u1EC1 b\u1ED9 l\u1ECDc (apply view c\u0169 / l\u01B0u view hi\u1EC7n t\u1EA1i) c\u1EA1nh n\u00FAt submit,\n user th\u1EA5y 1 c\u1EE5m. Footer \"L\u01B0u b\u1ED9 l\u1ECDc hi\u1EC7n t\u1EA1i\" s\u1ED1ng trong panel c\u1EE7a\n saved-filters-menu, kh\u00F4ng t\u00E1ch ra n\u00FAt ri\u00EAng n\u1EEFa. -->\n @if (showSavedFilters()) {\n <sd-query-saved-filters-menu\n [key]=\"savedFiltersKey()\"\n [query]=\"query()\"\n [canSave]=\"canSaveFilter()\"\n [autoId]=\"autoId()\"\n (apply)=\"applyFilter.emit($event)\" />\n }\n\n <!-- why: far-right \"submit at the end of the toolbar\" position; sole query trigger.\n Hidden when every chip edit applies on its own (bar applyOn: 'commit'). -->\n @if (showSearchButton()) {\n <button\n type=\"button\"\n class=\"c-search-trigger\"\n [disabled]=\"!canSearch()\"\n [matTooltip]=\"searchLabel()\"\n [attr.aria-label]=\"searchLabel()\"\n (click)=\"search.emit()\">\n <sd-icon name=\"search\"></sd-icon>\n </button>\n }\n</div>\n", styles: [":host{display:contents}.c-bar-divider{flex:0 0 auto;align-self:stretch;width:1px;min-height:28px;background:var(--sd-query-bar-border-soft, #e2e4e7)}.c-query-bar__actions{flex:0 0 auto;display:flex;align-items:center;gap:6px}.c-logic-toggle{display:inline-flex;align-items:center;padding:2px;background:var(--sd-query-bar-bg-soft, #f5f6f7);border:1px solid var(--sd-query-bar-border-soft, #e2e4e7);border-radius:6px}:host-context(.c-density-compact) .c-logic-toggle{height:28px}:host-context(.c-density-comfortable) .c-logic-toggle{height:32px}.c-logic-toggle .c-logic-segment{height:100%;padding:0 10px;border:none;background:transparent;font-family:Roboto Mono,monospace;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-semibold, 600);letter-spacing:.4px;color:var(--sd-query-bar-text-secondary, #5f6368);cursor:pointer;border-radius:4px}.c-logic-toggle .c-logic-segment.c-logic-active{background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-primary);box-shadow:0 1px 2px #00000014}.c-clear-all,.c-search-trigger{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--sd-query-bar-border, #d6d8db);border-radius:6px;background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-query-bar-text-secondary, #5f6368);cursor:pointer;padding:0}:host-context(.c-density-compact) .c-clear-all,:host-context(.c-density-compact) .c-search-trigger{width:28px;height:28px}:host-context(.c-density-comfortable) .c-clear-all,:host-context(.c-density-comfortable) .c-search-trigger{width:32px;height:32px}.c-clear-all sd-icon,.c-search-trigger sd-icon{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px}.c-clear-all:hover:not([disabled]),.c-search-trigger:hover:not([disabled]){border-color:var(--sd-primary);color:var(--sd-primary)}.c-clear-all[disabled],.c-search-trigger[disabled]{opacity:.5;cursor:not-allowed}.c-clear-all:hover{border-color:var(--sd-query-bar-danger, #dc2626);color:var(--sd-query-bar-danger, #dc2626)}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: SdQuerySavedFiltersMenu, selector: "sd-query-saved-filters-menu", inputs: ["key", "query", "canSave", "autoId"], outputs: ["apply"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
190
774
  }
191
775
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQueryActionsBar, decorators: [{
192
776
  type: Component,
193
- args: [{ selector: 'sd-query-actions-bar', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SdIcon, MatTooltipModule, SdQuerySavedFiltersMenu], template: "<!-- Vertical separator between the wrapping filter area (left) and the pinned toolbar. -->\n<span class=\"c-bar-divider\" aria-hidden=\"true\"></span>\n\n<div class=\"c-query-bar__actions\">\n <!-- AND / OR toggle -->\n @if (showLogicToggle() && filtersCount() >= 2) {\n <div class=\"c-logic-toggle\" role=\"group\" [attr.aria-label]=\"logicGroupLabel()\">\n <button\n type=\"button\"\n class=\"c-logic-segment\"\n [class.c-logic-active]=\"logic() === 'AND'\"\n (click)=\"setLogic('AND')\">\n AND\n </button>\n <button\n type=\"button\"\n class=\"c-logic-segment\"\n [class.c-logic-active]=\"logic() === 'OR'\"\n (click)=\"setLogic('OR')\">\n OR\n </button>\n </div>\n }\n\n @if (showClearAll() && filtersCount() > 0) {\n <button\n type=\"button\"\n class=\"c-clear-all\"\n [disabled]=\"clearDisabled()\"\n [matTooltip]=\"clearAllLabel()\"\n [attr.aria-label]=\"clearAllLabel()\"\n (click)=\"clear.emit()\">\n <sd-icon name=\"delete_sweep\"></sd-icon>\n </button>\n }\n\n <!-- why: saved-filters dropdown \u0111\u1EB7t s\u00E1t ngay tr\u01B0\u1EDBc Search \u2014 gom to\u00E0n b\u1ED9\n h\u00E0nh \u0111\u1ED9ng v\u1EC1 b\u1ED9 l\u1ECDc (apply view c\u0169 / l\u01B0u view hi\u1EC7n t\u1EA1i) c\u1EA1nh n\u00FAt submit,\n user th\u1EA5y 1 c\u1EE5m. Footer \"L\u01B0u b\u1ED9 l\u1ECDc hi\u1EC7n t\u1EA1i\" s\u1ED1ng trong mat-menu c\u1EE7a\n saved-filters-menu, kh\u00F4ng t\u00E1ch ra n\u00FAt ri\u00EAng n\u1EEFa. -->\n @if (showSavedFilters()) {\n <sd-query-saved-filters-menu\n [key]=\"savedFiltersKey()\"\n [query]=\"query()\"\n (apply)=\"applyFilter.emit($event)\" />\n }\n\n <!-- why: far-right \"submit at the end of the toolbar\" position; sole query trigger.\n Hidden when every chip edit applies on its own (bar applyOn: 'commit'). -->\n @if (showSearchButton()) {\n <button\n type=\"button\"\n class=\"c-search-trigger\"\n [disabled]=\"!canSearch()\"\n [matTooltip]=\"searchLabel()\"\n (click)=\"search.emit()\">\n <sd-icon name=\"search\"></sd-icon>\n </button>\n }\n</div>\n", styles: [":host{display:contents}.c-bar-divider{flex:0 0 auto;align-self:stretch;width:1px;min-height:28px;background:var(--sd-query-bar-border-soft, #e2e4e7)}.c-query-bar__actions{flex:0 0 auto;display:flex;align-items:center;gap:6px}.c-logic-toggle{display:inline-flex;align-items:center;padding:2px;background:var(--sd-query-bar-bg-soft, #f5f6f7);border:1px solid var(--sd-query-bar-border-soft, #e2e4e7);border-radius:6px}:host-context(.c-density-compact) .c-logic-toggle{height:28px}:host-context(.c-density-comfortable) .c-logic-toggle{height:32px}.c-logic-toggle .c-logic-segment{height:100%;padding:0 10px;border:none;background:transparent;font-family:Roboto Mono,monospace;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-semibold, 600);letter-spacing:.4px;color:var(--sd-query-bar-text-secondary, #5f6368);cursor:pointer;border-radius:4px}.c-logic-toggle .c-logic-segment.c-logic-active{background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-primary);box-shadow:0 1px 2px #00000014}.c-clear-all,.c-search-trigger{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--sd-query-bar-border, #d6d8db);border-radius:6px;background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-query-bar-text-secondary, #5f6368);cursor:pointer;padding:0}:host-context(.c-density-compact) .c-clear-all,:host-context(.c-density-compact) .c-search-trigger{width:28px;height:28px}:host-context(.c-density-comfortable) .c-clear-all,:host-context(.c-density-comfortable) .c-search-trigger{width:32px;height:32px}.c-clear-all sd-icon,.c-search-trigger sd-icon{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px}.c-clear-all:hover:not([disabled]),.c-search-trigger:hover:not([disabled]){border-color:var(--sd-primary);color:var(--sd-primary)}.c-clear-all[disabled],.c-search-trigger[disabled]{opacity:.5;cursor:not-allowed}.c-clear-all:hover{border-color:var(--sd-query-bar-danger, #dc2626);color:var(--sd-query-bar-danger, #dc2626)}\n"] }]
194
- }], propDecorators: { showLogicToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLogicToggle", required: false }] }], logic: [{ type: i0.Input, args: [{ isSignal: true, alias: "logic", required: false }] }, { type: i0.Output, args: ["logicChange"] }], filtersCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "filtersCount", required: false }] }], showSavedFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSavedFilters", required: false }] }], savedFiltersKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "savedFiltersKey", required: false }] }], query: [{ type: i0.Input, args: [{ isSignal: true, alias: "query", required: false }] }], applyFilter: [{ type: i0.Output, args: ["applyFilter"] }], showClearAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClearAll", required: false }] }], clearCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearCount", required: false }] }], clearDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearDisabled", required: false }] }], clear: [{ type: i0.Output, args: ["clear"] }], canSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "canSearch", required: false }] }], showSearchButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSearchButton", required: false }] }], search: [{ type: i0.Output, args: ["search"] }] } });
777
+ args: [{ selector: 'sd-query-actions-bar', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SdIcon, MatTooltipModule, SdQuerySavedFiltersMenu], template: "<!-- Vertical separator between the wrapping filter area (left) and the pinned toolbar. -->\n<span class=\"c-bar-divider\" aria-hidden=\"true\"></span>\n\n<div class=\"c-query-bar__actions\">\n <!-- AND / OR toggle -->\n @if (showLogicToggle() && filtersCount() >= 2) {\n <div class=\"c-logic-toggle\" role=\"group\" [attr.aria-label]=\"logicGroupLabel()\">\n <button\n type=\"button\"\n class=\"c-logic-segment\"\n [class.c-logic-active]=\"logic() === 'AND'\"\n (click)=\"setLogic('AND')\">\n AND\n </button>\n <button\n type=\"button\"\n class=\"c-logic-segment\"\n [class.c-logic-active]=\"logic() === 'OR'\"\n (click)=\"setLogic('OR')\">\n OR\n </button>\n </div>\n }\n\n @if (showClearAll() && filtersCount() > 0) {\n <button\n type=\"button\"\n class=\"c-clear-all\"\n [disabled]=\"clearDisabled()\"\n [matTooltip]=\"clearAllLabel()\"\n [attr.aria-label]=\"clearAllLabel()\"\n (click)=\"clear.emit()\">\n <sd-icon name=\"delete_sweep\"></sd-icon>\n </button>\n }\n\n <!-- why: saved-filters dropdown \u0111\u1EB7t s\u00E1t ngay tr\u01B0\u1EDBc Search \u2014 gom to\u00E0n b\u1ED9\n h\u00E0nh \u0111\u1ED9ng v\u1EC1 b\u1ED9 l\u1ECDc (apply view c\u0169 / l\u01B0u view hi\u1EC7n t\u1EA1i) c\u1EA1nh n\u00FAt submit,\n user th\u1EA5y 1 c\u1EE5m. Footer \"L\u01B0u b\u1ED9 l\u1ECDc hi\u1EC7n t\u1EA1i\" s\u1ED1ng trong panel c\u1EE7a\n saved-filters-menu, kh\u00F4ng t\u00E1ch ra n\u00FAt ri\u00EAng n\u1EEFa. -->\n @if (showSavedFilters()) {\n <sd-query-saved-filters-menu\n [key]=\"savedFiltersKey()\"\n [query]=\"query()\"\n [canSave]=\"canSaveFilter()\"\n [autoId]=\"autoId()\"\n (apply)=\"applyFilter.emit($event)\" />\n }\n\n <!-- why: far-right \"submit at the end of the toolbar\" position; sole query trigger.\n Hidden when every chip edit applies on its own (bar applyOn: 'commit'). -->\n @if (showSearchButton()) {\n <button\n type=\"button\"\n class=\"c-search-trigger\"\n [disabled]=\"!canSearch()\"\n [matTooltip]=\"searchLabel()\"\n [attr.aria-label]=\"searchLabel()\"\n (click)=\"search.emit()\">\n <sd-icon name=\"search\"></sd-icon>\n </button>\n }\n</div>\n", styles: [":host{display:contents}.c-bar-divider{flex:0 0 auto;align-self:stretch;width:1px;min-height:28px;background:var(--sd-query-bar-border-soft, #e2e4e7)}.c-query-bar__actions{flex:0 0 auto;display:flex;align-items:center;gap:6px}.c-logic-toggle{display:inline-flex;align-items:center;padding:2px;background:var(--sd-query-bar-bg-soft, #f5f6f7);border:1px solid var(--sd-query-bar-border-soft, #e2e4e7);border-radius:6px}:host-context(.c-density-compact) .c-logic-toggle{height:28px}:host-context(.c-density-comfortable) .c-logic-toggle{height:32px}.c-logic-toggle .c-logic-segment{height:100%;padding:0 10px;border:none;background:transparent;font-family:Roboto Mono,monospace;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-semibold, 600);letter-spacing:.4px;color:var(--sd-query-bar-text-secondary, #5f6368);cursor:pointer;border-radius:4px}.c-logic-toggle .c-logic-segment.c-logic-active{background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-primary);box-shadow:0 1px 2px #00000014}.c-clear-all,.c-search-trigger{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--sd-query-bar-border, #d6d8db);border-radius:6px;background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-query-bar-text-secondary, #5f6368);cursor:pointer;padding:0}:host-context(.c-density-compact) .c-clear-all,:host-context(.c-density-compact) .c-search-trigger{width:28px;height:28px}:host-context(.c-density-comfortable) .c-clear-all,:host-context(.c-density-comfortable) .c-search-trigger{width:32px;height:32px}.c-clear-all sd-icon,.c-search-trigger sd-icon{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px}.c-clear-all:hover:not([disabled]),.c-search-trigger:hover:not([disabled]){border-color:var(--sd-primary);color:var(--sd-primary)}.c-clear-all[disabled],.c-search-trigger[disabled]{opacity:.5;cursor:not-allowed}.c-clear-all:hover{border-color:var(--sd-query-bar-danger, #dc2626);color:var(--sd-query-bar-danger, #dc2626)}\n"] }]
778
+ }], propDecorators: { showLogicToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLogicToggle", required: false }] }], logic: [{ type: i0.Input, args: [{ isSignal: true, alias: "logic", required: false }] }, { type: i0.Output, args: ["logicChange"] }], filtersCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "filtersCount", required: false }] }], showSavedFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSavedFilters", required: false }] }], savedFiltersKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "savedFiltersKey", required: false }] }], query: [{ type: i0.Input, args: [{ isSignal: true, alias: "query", required: false }] }], canSaveFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "canSaveFilter", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], applyFilter: [{ type: i0.Output, args: ["applyFilter"] }], showClearAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClearAll", required: false }] }], clearCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearCount", required: false }] }], clearDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearDisabled", required: false }] }], clear: [{ type: i0.Output, args: ["clear"] }], canSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "canSearch", required: false }] }], showSearchButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSearchButton", required: false }] }], search: [{ type: i0.Output, args: ["search"] }] } });
195
779
 
196
780
  // ---------------------------------------------------------------------------
197
781
  // Constants
@@ -264,10 +848,25 @@ const DEFAULT_OPERATOR_LIST_CACHE = new WeakMap();
264
848
  * - `operators` is an array → that array (deduped against the type set is the caller's job)
265
849
  * - otherwise (simple mode) → just the single default operator (no real choice)
266
850
  *
851
+ * A `required` field never offers `NULL` / `NOT_NULL`: its value cannot be left out (handoff B3).
852
+ *
267
853
  * The returned array is referentially stable for a given `field` object, so it is safe to call
268
854
  * straight from a template binding.
269
855
  */
270
856
  function sdQueryAllowedOperators(field) {
857
+ const operators = baseAllowedOperators(field);
858
+ if (!field.required || !operators.some(op => SD_QUERY_NO_DATA_OPERATORS.includes(op)))
859
+ return operators;
860
+ // why: lọc theo chính mảng gốc (hằng số, mảng của consumer hoặc mảng đã memo) để ref ổn định như nhánh không bắt buộc.
861
+ let required = REQUIRED_OPERATOR_LIST_CACHE.get(operators);
862
+ if (!required) {
863
+ required = operators.filter(op => !SD_QUERY_NO_DATA_OPERATORS.includes(op));
864
+ REQUIRED_OPERATOR_LIST_CACHE.set(operators, required);
865
+ }
866
+ return required;
867
+ }
868
+ const REQUIRED_OPERATOR_LIST_CACHE = new WeakMap();
869
+ function baseAllowedOperators(field) {
271
870
  if (field.operators === true)
272
871
  return SD_QUERY_OPERATORS_BY_TYPE[field.type];
273
872
  if (Array.isArray(field.operators) && field.operators.length > 0)
@@ -315,6 +914,8 @@ class SdQueryInlineValueChip {
315
914
  autofocus = input(false, ...(ngDevMode ? [{ debugName: "autofocus" }] : /* istanbul ignore next */ []));
316
915
  /** Pinned chip — no × segment. */
317
916
  pinned = input(false, ...(ngDevMode ? [{ debugName: "pinned" }] : /* istanbul ignore next */ []));
917
+ /** Required field: `aria-required`; a value, once set, cannot be emptied (handoff B3). */
918
+ required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
318
919
  /** Required chip without a value — error look while not focused, `aria-invalid`. */
319
920
  invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
320
921
  /** Id set as `aria-describedby` (the host's required hint). */
@@ -339,6 +940,8 @@ class SdQueryInlineValueChip {
339
940
  ph = computed(() => this.#i18n.t(this.isNumber() ? 'core.component.query-bar.placeholder.value' : 'core.component.query-bar.placeholder.text'), ...(ngDevMode ? [{ debugName: "ph" }] : /* istanbul ignore next */ []));
340
941
  phFrom = computed(() => this.#i18n.t(this.isNumber() ? 'core.component.query-bar.placeholder.from-number' : 'core.component.query-bar.placeholder.from-text'), ...(ngDevMode ? [{ debugName: "phFrom" }] : /* istanbul ignore next */ []));
341
942
  phTo = computed(() => this.#i18n.t(this.isNumber() ? 'core.component.query-bar.placeholder.to-number' : 'core.component.query-bar.placeholder.to-text'), ...(ngDevMode ? [{ debugName: "phTo" }] : /* istanbul ignore next */ []));
943
+ /** `aria-label` of the × — names the field, in the current language. */
944
+ removeLabel = computed(() => this.#i18n.t('core.component.query-bar.remove-filter', { label: this.field().label }), ...(ngDevMode ? [{ debugName: "removeLabel" }] : /* istanbul ignore next */ []));
342
945
  hasValue = computed(() => {
343
946
  if (this.isNoData())
344
947
  return true;
@@ -393,6 +996,8 @@ class SdQueryInlineValueChip {
393
996
  this.hasError.set(true);
394
997
  return;
395
998
  }
999
+ if (this.#keepsRequired(parsed.value == null || parsed.value === ''))
1000
+ return;
396
1001
  this.hasError.set(false);
397
1002
  this.valueChange.emit(parsed.value);
398
1003
  }
@@ -405,6 +1010,9 @@ class SdQueryInlineValueChip {
405
1010
  this.hasError.set(true);
406
1011
  return;
407
1012
  }
1013
+ const blank = (value) => value == null || value === '';
1014
+ if (this.#keepsRequired(blank(from.value) && blank(to.value)))
1015
+ return;
408
1016
  this.hasError.set(false);
409
1017
  this.valueChange.emit({ from: from.value, to: to.value });
410
1018
  }
@@ -423,6 +1031,16 @@ class SdQueryInlineValueChip {
423
1031
  this.focused.set(false);
424
1032
  ref?.blur();
425
1033
  }
1034
+ /**
1035
+ * B3: emptying the value of a required chip that has one gives the previous value back instead of committing.
1036
+ * `true` when the commit was refused.
1037
+ */
1038
+ #keepsRequired(empty) {
1039
+ if (!empty || !this.required() || !this.hasValue())
1040
+ return false;
1041
+ this.revertAndBlur();
1042
+ return true;
1043
+ }
426
1044
  onRemove(ev) {
427
1045
  ev.stopPropagation();
428
1046
  this.remove.emit();
@@ -463,12 +1081,12 @@ class SdQueryInlineValueChip {
463
1081
  return { ok: true, value: t };
464
1082
  }
465
1083
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQueryInlineValueChip, deps: [], target: i0.ɵɵFactoryTarget.Component });
466
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdQueryInlineValueChip, isStandalone: true, selector: "sd-query-inline-value-chip", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, operator: { classPropertyName: "operator", publicName: "operator", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, showOperator: { classPropertyName: "showOperator", publicName: "showOperator", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, pinned: { classPropertyName: "pinned", publicName: "pinned", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, describedBy: { classPropertyName: "describedBy", publicName: "describedBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", remove: "remove" }, viewQueries: [{ propertyName: "firstInput", first: true, predicate: ["firstInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n Seamless string/number chip \u2014 the pill IS the input. One border, three flush\n segments: label \u00B7 input(s) \u00B7 \u00D7. State styling driven by [data-state]. The value\n field is the shared <sd-inline-text> primitive (chrome=\"seamless\") so width hugs\n content; the chip keeps the envelope + parse/commit logic.\n-->\n@let _state = state();\n@let _autoId = autoId();\n@let _isNoData = isNoData();\n@let _density = density();\n@let _operator = operator();\n\n<!-- why: v\u1ECF chip l\u00E0 m\u1ED9t NH\u00D3M control (nh\u00E3n + \u00F4 nh\u1EADp + n\u00FAt \u00D7), kh\u00F4ng ph\u1EA3i n\u00FAt \u2192 role=\"group\" +\n aria-label m\u00F4 t\u1EA3 \u0111\u00FAng c\u1EA5u tr\u00FAc v\u00E0 c\u0169ng cho bi\u1EBFt v\u00EC sao n\u00F3 KH\u00D4NG nh\u1EADn tabindex (tab \u0111i th\u1EB3ng\n v\u00E0o input b\u00EAn trong). `focusFromShell` \u0111\u00E3 t\u1EF1 lo\u1EA1i click tr\u00EAn input v\u00E0 tr\u00EAn n\u00FAt \u00D7 n\u00EAn g\u1EAFn th\u00EAm\n Enter d\u00F9ng chung handler l\u00E0 an to\u00E0n v\u00E0 ph\u1EA3n chi\u1EBFu \u0111\u00FAng h\u00E0nh vi click. -->\n<span\n class=\"c-seamless\"\n role=\"group\"\n [attr.aria-label]=\"field().label\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy() ?? null\"\n [attr.data-state]=\"_state\"\n [class.c-seamless--compact]=\"_density === 'compact'\"\n [class.c-seamless--comfortable]=\"_density === 'comfortable'\"\n (click)=\"focusFromShell($event)\"\n (keydown.enter)=\"focusFromShell($event)\">\n\n <!-- Label segment: icon + field name (+ optional operator pill) -->\n <span class=\"c-seamless__label\">\n <sd-icon class=\"c-seamless__icon\" [name]=\"icon()\"></sd-icon>\n <span class=\"c-seamless__field\">{{ field().label }}</span>\n @if (showOperator() && !_isNoData) {\n <sd-operator class=\"c-seamless__op\" [operators]=\"[_operator]\" [model]=\"_operator\" size=\"xs\" readonly />\n } @else if (!_isNoData) {\n <span class=\"c-seamless__sep\">:</span>\n }\n </span>\n\n <!-- Input segment \u2014 seamless borderless primitive; hidden for NULL / NOT_NULL -->\n @if (!_isNoData) {\n <span class=\"c-seamless__input\">\n @if (isBetween()) {\n <sd-inline-text\n #firstInput\n chrome=\"seamless\"\n [clearable]=\"false\"\n [autofocus]=\"autofocus()\"\n [state]=\"_state\"\n [value]=\"draftFrom()\"\n (valueChange)=\"draftFrom.set($event)\"\n [placeholder]=\"phFrom()\"\n [autoId]=\"_autoId ? _autoId + '-from' : undefined\"\n (sdFocus)=\"onFocus()\"\n (sdBlur)=\"commitRange()\"\n (keyupEnter)=\"firstInput.blur()\"\n (keydownEscape)=\"revertAndBlur(firstInput)\" />\n <span class=\"c-seamless__dash\" aria-hidden=\"true\">\u2014</span>\n <sd-inline-text\n #secondInput\n chrome=\"seamless\"\n [clearable]=\"false\"\n [state]=\"_state\"\n [value]=\"draftTo()\"\n (valueChange)=\"draftTo.set($event)\"\n [placeholder]=\"phTo()\"\n [autoId]=\"_autoId ? _autoId + '-to' : undefined\"\n (sdFocus)=\"onFocus()\"\n (sdBlur)=\"commitRange()\"\n (keyupEnter)=\"secondInput.blur()\"\n (keydownEscape)=\"revertAndBlur(secondInput)\" />\n } @else {\n <sd-inline-text\n #firstInput\n chrome=\"seamless\"\n [clearable]=\"false\"\n [autofocus]=\"autofocus()\"\n [state]=\"_state\"\n [value]=\"draft()\"\n (valueChange)=\"draft.set($event)\"\n [placeholder]=\"ph()\"\n [autoId]=\"_autoId ?? undefined\"\n (sdFocus)=\"onFocus()\"\n (sdBlur)=\"commitSingle()\"\n (keyupEnter)=\"firstInput.blur()\"\n (keydownEscape)=\"revertAndBlur(firstInput)\" />\n }\n </span>\n }\n\n <!-- \u00D7 segment \u2014 pinned chips cannot be removed. -->\n @if (!pinned()) {\n <button type=\"button\" class=\"c-seamless__x\" aria-label=\"Remove filter\" (click)=\"onRemove($event)\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n</span>\n", styles: [":host{display:inline-flex}.c-seamless{display:inline-flex;align-items:stretch;border-radius:var(--sd-radius-999, 999px);overflow:hidden;font-family:inherit;font-size:var(--sd-font-size-13, 13px);line-height:1;cursor:text;border:1px solid var(--sd-query-bar-border, #d6d8db);background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-query-bar-text-secondary, #5f6368);transition:border-color var(--sd-duration-fast, .12s) ease,background-color var(--sd-duration-fast, .12s) ease,box-shadow var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.c-seamless--compact{height:28px}.c-seamless--comfortable{height:32px}.c-seamless:hover:not([data-state=focus]):not([data-state=error]){border-color:var(--sd-primary)}.c-seamless[data-state=pending]{border-style:dashed;border-color:var(--sd-query-bar-border, #d6d8db);background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-query-bar-text-secondary, #5f6368)}.c-seamless[data-state=active]{border-color:var(--sd-primary-light);background:var(--sd-primary-light)}.c-seamless[data-state=focus]{border-color:var(--sd-primary);background:var(--sd-query-bar-bg, #ffffff);box-shadow:0 0 0 3px var(--sd-primary-light)}.c-seamless[data-state=error]{border-color:var(--sd-query-bar-chip-danger, #d23535);background:var(--sd-query-bar-chip-danger-bg, #fff5f5);color:var(--sd-query-bar-chip-danger, #d23535);box-shadow:0 0 0 3px #d235351f}.c-seamless__label{display:inline-flex;align-items:center;gap:4px;font-weight:var(--sd-font-weight-medium, 500);white-space:nowrap;cursor:text;color:inherit}.c-seamless--compact .c-seamless__label{padding:0 0 0 12px}.c-seamless--comfortable .c-seamless__label{padding:0 0 0 14px}.c-seamless__icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px;color:inherit}.c-seamless__field{color:inherit}.c-seamless__op{display:inline-flex;align-items:center;color:inherit}.c-seamless__sep{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-seamless__input{display:inline-flex;align-items:center;gap:4px}.c-seamless--compact .c-seamless__input{padding:0 8px 0 4px}.c-seamless--comfortable .c-seamless__input{padding:0 10px 0 6px}.c-seamless__dash{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-seamless__x{display:inline-flex;align-items:center;justify-content:center;border:0;border-left:1px solid rgba(0,0,0,.04);background:transparent;cursor:pointer;color:inherit}.c-seamless--compact .c-seamless__x{width:26px}.c-seamless--comfortable .c-seamless__x{width:28px}.c-seamless__x sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-seamless__x:hover{background:#0000000d}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdOperator, selector: "sd-operator", inputs: ["model", "operators", "disabled", "autoId", "size", "readonly", "active", "showCode"], outputs: ["modelChange"] }, { kind: "component", type: SdInlineText, selector: "sd-inline-text", inputs: ["value", "control", "placeholder", "disabled", "clearable", "state", "chrome", "autoId", "autofocus", "minSize"], outputs: ["valueChange", "cleared", "keyupEnter", "keydownEscape", "sdFocus", "sdBlur", "sdKeydown", "sdPaste", "sdCompositionStart", "sdCompositionEnd"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1084
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdQueryInlineValueChip, isStandalone: true, selector: "sd-query-inline-value-chip", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, operator: { classPropertyName: "operator", publicName: "operator", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, showOperator: { classPropertyName: "showOperator", publicName: "showOperator", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, pinned: { classPropertyName: "pinned", publicName: "pinned", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, describedBy: { classPropertyName: "describedBy", publicName: "describedBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", remove: "remove" }, viewQueries: [{ propertyName: "firstInput", first: true, predicate: ["firstInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n Seamless string/number chip \u2014 the pill IS the input. One border, three flush\n segments: label \u00B7 input(s) \u00B7 \u00D7. State styling driven by [data-state]. The value\n field is the shared <sd-inline-text> primitive (chrome=\"seamless\") so width hugs\n content; the chip keeps the envelope + parse/commit logic.\n-->\n@let _state = state();\n@let _autoId = autoId();\n@let _isNoData = isNoData();\n@let _density = density();\n@let _operator = operator();\n\n<!-- why: v\u1ECF chip l\u00E0 m\u1ED9t NH\u00D3M control (nh\u00E3n + \u00F4 nh\u1EADp + n\u00FAt \u00D7), kh\u00F4ng ph\u1EA3i n\u00FAt \u2192 role=\"group\" +\n aria-label m\u00F4 t\u1EA3 \u0111\u00FAng c\u1EA5u tr\u00FAc v\u00E0 c\u0169ng cho bi\u1EBFt v\u00EC sao n\u00F3 KH\u00D4NG nh\u1EADn tabindex (tab \u0111i th\u1EB3ng\n v\u00E0o input b\u00EAn trong). `focusFromShell` \u0111\u00E3 t\u1EF1 lo\u1EA1i click tr\u00EAn input v\u00E0 tr\u00EAn n\u00FAt \u00D7 n\u00EAn g\u1EAFn th\u00EAm\n Enter d\u00F9ng chung handler l\u00E0 an to\u00E0n v\u00E0 ph\u1EA3n chi\u1EBFu \u0111\u00FAng h\u00E0nh vi click. -->\n<span\n class=\"c-seamless\"\n role=\"group\"\n [attr.aria-label]=\"field().label\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy() ?? null\"\n [attr.data-state]=\"_state\"\n [class.c-seamless--compact]=\"_density === 'compact'\"\n [class.c-seamless--comfortable]=\"_density === 'comfortable'\"\n (click)=\"focusFromShell($event)\"\n (keydown.enter)=\"focusFromShell($event)\">\n\n <!-- Label segment: icon + field name (+ optional operator pill) -->\n <span class=\"c-seamless__label\">\n <sd-icon class=\"c-seamless__icon\" [name]=\"icon()\"></sd-icon>\n <span class=\"c-seamless__field\">{{ field().label }}</span>\n @if (showOperator() && !_isNoData) {\n <sd-operator class=\"c-seamless__op\" [operators]=\"[_operator]\" [model]=\"_operator\" size=\"xs\" readonly />\n } @else if (!_isNoData) {\n <span class=\"c-seamless__sep\">:</span>\n }\n </span>\n\n <!-- Input segment \u2014 seamless borderless primitive; hidden for NULL / NOT_NULL -->\n @if (!_isNoData) {\n <span class=\"c-seamless__input\">\n @if (isBetween()) {\n <sd-inline-text\n #firstInput\n chrome=\"seamless\"\n [clearable]=\"false\"\n [autofocus]=\"autofocus()\"\n [state]=\"_state\"\n [value]=\"draftFrom()\"\n (valueChange)=\"draftFrom.set($event)\"\n [placeholder]=\"phFrom()\"\n [autoId]=\"_autoId ? _autoId + '-from' : undefined\"\n (sdFocus)=\"onFocus()\"\n (sdBlur)=\"commitRange()\"\n (keyupEnter)=\"firstInput.blur()\"\n (keydownEscape)=\"revertAndBlur(firstInput)\" />\n <span class=\"c-seamless__dash\" aria-hidden=\"true\">\u2014</span>\n <sd-inline-text\n #secondInput\n chrome=\"seamless\"\n [clearable]=\"false\"\n [state]=\"_state\"\n [value]=\"draftTo()\"\n (valueChange)=\"draftTo.set($event)\"\n [placeholder]=\"phTo()\"\n [autoId]=\"_autoId ? _autoId + '-to' : undefined\"\n (sdFocus)=\"onFocus()\"\n (sdBlur)=\"commitRange()\"\n (keyupEnter)=\"secondInput.blur()\"\n (keydownEscape)=\"revertAndBlur(secondInput)\" />\n } @else {\n <sd-inline-text\n #firstInput\n chrome=\"seamless\"\n [clearable]=\"false\"\n [autofocus]=\"autofocus()\"\n [state]=\"_state\"\n [value]=\"draft()\"\n (valueChange)=\"draft.set($event)\"\n [placeholder]=\"ph()\"\n [autoId]=\"_autoId ?? undefined\"\n (sdFocus)=\"onFocus()\"\n (sdBlur)=\"commitSingle()\"\n (keyupEnter)=\"firstInput.blur()\"\n (keydownEscape)=\"revertAndBlur(firstInput)\" />\n }\n </span>\n }\n\n <!-- \u00D7 segment \u2014 pinned chips cannot be removed. -->\n @if (!pinned()) {\n <button type=\"button\" class=\"c-seamless__x\" [attr.aria-label]=\"removeLabel()\" (click)=\"onRemove($event)\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n</span>\n", styles: [":host{display:inline-flex}.c-seamless:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.c-seamless{display:inline-flex;align-items:stretch;border-radius:var(--sd-radius-999, 999px);overflow:hidden;font-family:inherit;font-size:var(--sd-font-size-13, 13px);line-height:1;cursor:text;border:1px solid var(--sd-query-bar-border, #d6d8db);background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-query-bar-text-secondary, #5f6368);transition:border-color var(--sd-duration-fast, .12s) ease,background-color var(--sd-duration-fast, .12s) ease,box-shadow var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.c-seamless--compact{height:28px}.c-seamless--comfortable{height:32px}.c-seamless:hover:not([data-state=focus]):not([data-state=error]){border-color:var(--sd-primary)}.c-seamless[data-state=pending]{border-style:dashed;border-color:var(--sd-query-bar-border, #d6d8db);background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-query-bar-text-secondary, #5f6368)}.c-seamless[data-state=active]{border-color:var(--sd-primary-light);background:var(--sd-primary-light)}.c-seamless[data-state=focus]{border-color:var(--sd-primary);background:var(--sd-query-bar-bg, #ffffff);box-shadow:0 0 0 3px var(--sd-primary-light)}.c-seamless[data-state=error]{border-color:var(--sd-query-bar-chip-danger, #d23535);background:var(--sd-query-bar-chip-danger-bg, #fff5f5);color:var(--sd-query-bar-chip-danger, #d23535);box-shadow:0 0 0 3px #d235351f}.c-seamless__label{display:inline-flex;align-items:center;gap:4px;font-weight:var(--sd-font-weight-medium, 500);white-space:nowrap;cursor:text;color:inherit}.c-seamless--compact .c-seamless__label{padding:0 0 0 12px}.c-seamless--comfortable .c-seamless__label{padding:0 0 0 14px}.c-seamless__icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px;color:inherit}.c-seamless__field{color:inherit}.c-seamless__op{display:inline-flex;align-items:center;color:inherit}.c-seamless__sep{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-seamless__input{display:inline-flex;align-items:center;gap:4px}.c-seamless--compact .c-seamless__input{padding:0 8px 0 4px}.c-seamless--comfortable .c-seamless__input{padding:0 10px 0 6px}.c-seamless__dash{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-seamless__x{display:inline-flex;align-items:center;justify-content:center;border:0;border-left:1px solid rgba(0,0,0,.04);background:transparent;cursor:pointer;color:inherit}.c-seamless--compact .c-seamless__x{width:26px}.c-seamless--comfortable .c-seamless__x{width:28px}.c-seamless__x sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-seamless__x:hover{background:#0000000d}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdOperator, selector: "sd-operator", inputs: ["model", "operators", "disabled", "autoId", "size", "readonly", "active", "showCode"], outputs: ["modelChange"] }, { kind: "component", type: SdInlineText, selector: "sd-inline-text", inputs: ["value", "control", "placeholder", "disabled", "clearable", "state", "chrome", "autoId", "autofocus", "minSize"], outputs: ["valueChange", "cleared", "keyupEnter", "keydownEscape", "sdFocus", "sdBlur", "sdKeydown", "sdPaste", "sdCompositionStart", "sdCompositionEnd"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
467
1085
  }
468
1086
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQueryInlineValueChip, decorators: [{
469
1087
  type: Component,
470
- args: [{ selector: 'sd-query-inline-value-chip', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SdIcon, SdOperator, SdInlineText], template: "<!--\n Seamless string/number chip \u2014 the pill IS the input. One border, three flush\n segments: label \u00B7 input(s) \u00B7 \u00D7. State styling driven by [data-state]. The value\n field is the shared <sd-inline-text> primitive (chrome=\"seamless\") so width hugs\n content; the chip keeps the envelope + parse/commit logic.\n-->\n@let _state = state();\n@let _autoId = autoId();\n@let _isNoData = isNoData();\n@let _density = density();\n@let _operator = operator();\n\n<!-- why: v\u1ECF chip l\u00E0 m\u1ED9t NH\u00D3M control (nh\u00E3n + \u00F4 nh\u1EADp + n\u00FAt \u00D7), kh\u00F4ng ph\u1EA3i n\u00FAt \u2192 role=\"group\" +\n aria-label m\u00F4 t\u1EA3 \u0111\u00FAng c\u1EA5u tr\u00FAc v\u00E0 c\u0169ng cho bi\u1EBFt v\u00EC sao n\u00F3 KH\u00D4NG nh\u1EADn tabindex (tab \u0111i th\u1EB3ng\n v\u00E0o input b\u00EAn trong). `focusFromShell` \u0111\u00E3 t\u1EF1 lo\u1EA1i click tr\u00EAn input v\u00E0 tr\u00EAn n\u00FAt \u00D7 n\u00EAn g\u1EAFn th\u00EAm\n Enter d\u00F9ng chung handler l\u00E0 an to\u00E0n v\u00E0 ph\u1EA3n chi\u1EBFu \u0111\u00FAng h\u00E0nh vi click. -->\n<span\n class=\"c-seamless\"\n role=\"group\"\n [attr.aria-label]=\"field().label\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy() ?? null\"\n [attr.data-state]=\"_state\"\n [class.c-seamless--compact]=\"_density === 'compact'\"\n [class.c-seamless--comfortable]=\"_density === 'comfortable'\"\n (click)=\"focusFromShell($event)\"\n (keydown.enter)=\"focusFromShell($event)\">\n\n <!-- Label segment: icon + field name (+ optional operator pill) -->\n <span class=\"c-seamless__label\">\n <sd-icon class=\"c-seamless__icon\" [name]=\"icon()\"></sd-icon>\n <span class=\"c-seamless__field\">{{ field().label }}</span>\n @if (showOperator() && !_isNoData) {\n <sd-operator class=\"c-seamless__op\" [operators]=\"[_operator]\" [model]=\"_operator\" size=\"xs\" readonly />\n } @else if (!_isNoData) {\n <span class=\"c-seamless__sep\">:</span>\n }\n </span>\n\n <!-- Input segment \u2014 seamless borderless primitive; hidden for NULL / NOT_NULL -->\n @if (!_isNoData) {\n <span class=\"c-seamless__input\">\n @if (isBetween()) {\n <sd-inline-text\n #firstInput\n chrome=\"seamless\"\n [clearable]=\"false\"\n [autofocus]=\"autofocus()\"\n [state]=\"_state\"\n [value]=\"draftFrom()\"\n (valueChange)=\"draftFrom.set($event)\"\n [placeholder]=\"phFrom()\"\n [autoId]=\"_autoId ? _autoId + '-from' : undefined\"\n (sdFocus)=\"onFocus()\"\n (sdBlur)=\"commitRange()\"\n (keyupEnter)=\"firstInput.blur()\"\n (keydownEscape)=\"revertAndBlur(firstInput)\" />\n <span class=\"c-seamless__dash\" aria-hidden=\"true\">\u2014</span>\n <sd-inline-text\n #secondInput\n chrome=\"seamless\"\n [clearable]=\"false\"\n [state]=\"_state\"\n [value]=\"draftTo()\"\n (valueChange)=\"draftTo.set($event)\"\n [placeholder]=\"phTo()\"\n [autoId]=\"_autoId ? _autoId + '-to' : undefined\"\n (sdFocus)=\"onFocus()\"\n (sdBlur)=\"commitRange()\"\n (keyupEnter)=\"secondInput.blur()\"\n (keydownEscape)=\"revertAndBlur(secondInput)\" />\n } @else {\n <sd-inline-text\n #firstInput\n chrome=\"seamless\"\n [clearable]=\"false\"\n [autofocus]=\"autofocus()\"\n [state]=\"_state\"\n [value]=\"draft()\"\n (valueChange)=\"draft.set($event)\"\n [placeholder]=\"ph()\"\n [autoId]=\"_autoId ?? undefined\"\n (sdFocus)=\"onFocus()\"\n (sdBlur)=\"commitSingle()\"\n (keyupEnter)=\"firstInput.blur()\"\n (keydownEscape)=\"revertAndBlur(firstInput)\" />\n }\n </span>\n }\n\n <!-- \u00D7 segment \u2014 pinned chips cannot be removed. -->\n @if (!pinned()) {\n <button type=\"button\" class=\"c-seamless__x\" aria-label=\"Remove filter\" (click)=\"onRemove($event)\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n</span>\n", styles: [":host{display:inline-flex}.c-seamless{display:inline-flex;align-items:stretch;border-radius:var(--sd-radius-999, 999px);overflow:hidden;font-family:inherit;font-size:var(--sd-font-size-13, 13px);line-height:1;cursor:text;border:1px solid var(--sd-query-bar-border, #d6d8db);background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-query-bar-text-secondary, #5f6368);transition:border-color var(--sd-duration-fast, .12s) ease,background-color var(--sd-duration-fast, .12s) ease,box-shadow var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.c-seamless--compact{height:28px}.c-seamless--comfortable{height:32px}.c-seamless:hover:not([data-state=focus]):not([data-state=error]){border-color:var(--sd-primary)}.c-seamless[data-state=pending]{border-style:dashed;border-color:var(--sd-query-bar-border, #d6d8db);background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-query-bar-text-secondary, #5f6368)}.c-seamless[data-state=active]{border-color:var(--sd-primary-light);background:var(--sd-primary-light)}.c-seamless[data-state=focus]{border-color:var(--sd-primary);background:var(--sd-query-bar-bg, #ffffff);box-shadow:0 0 0 3px var(--sd-primary-light)}.c-seamless[data-state=error]{border-color:var(--sd-query-bar-chip-danger, #d23535);background:var(--sd-query-bar-chip-danger-bg, #fff5f5);color:var(--sd-query-bar-chip-danger, #d23535);box-shadow:0 0 0 3px #d235351f}.c-seamless__label{display:inline-flex;align-items:center;gap:4px;font-weight:var(--sd-font-weight-medium, 500);white-space:nowrap;cursor:text;color:inherit}.c-seamless--compact .c-seamless__label{padding:0 0 0 12px}.c-seamless--comfortable .c-seamless__label{padding:0 0 0 14px}.c-seamless__icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px;color:inherit}.c-seamless__field{color:inherit}.c-seamless__op{display:inline-flex;align-items:center;color:inherit}.c-seamless__sep{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-seamless__input{display:inline-flex;align-items:center;gap:4px}.c-seamless--compact .c-seamless__input{padding:0 8px 0 4px}.c-seamless--comfortable .c-seamless__input{padding:0 10px 0 6px}.c-seamless__dash{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-seamless__x{display:inline-flex;align-items:center;justify-content:center;border:0;border-left:1px solid rgba(0,0,0,.04);background:transparent;cursor:pointer;color:inherit}.c-seamless--compact .c-seamless__x{width:26px}.c-seamless--comfortable .c-seamless__x{width:28px}.c-seamless__x sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-seamless__x:hover{background:#0000000d}\n"] }]
471
- }], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], operator: [{ type: i0.Input, args: [{ isSignal: true, alias: "operator", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], showOperator: [{ type: i0.Input, args: [{ isSignal: true, alias: "showOperator", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], pinned: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinned", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], describedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "describedBy", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], remove: [{ type: i0.Output, args: ["remove"] }], firstInput: [{ type: i0.ViewChild, args: ['firstInput', { isSignal: true }] }] } });
1088
+ args: [{ selector: 'sd-query-inline-value-chip', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SdIcon, SdOperator, SdInlineText], template: "<!--\n Seamless string/number chip \u2014 the pill IS the input. One border, three flush\n segments: label \u00B7 input(s) \u00B7 \u00D7. State styling driven by [data-state]. The value\n field is the shared <sd-inline-text> primitive (chrome=\"seamless\") so width hugs\n content; the chip keeps the envelope + parse/commit logic.\n-->\n@let _state = state();\n@let _autoId = autoId();\n@let _isNoData = isNoData();\n@let _density = density();\n@let _operator = operator();\n\n<!-- why: v\u1ECF chip l\u00E0 m\u1ED9t NH\u00D3M control (nh\u00E3n + \u00F4 nh\u1EADp + n\u00FAt \u00D7), kh\u00F4ng ph\u1EA3i n\u00FAt \u2192 role=\"group\" +\n aria-label m\u00F4 t\u1EA3 \u0111\u00FAng c\u1EA5u tr\u00FAc v\u00E0 c\u0169ng cho bi\u1EBFt v\u00EC sao n\u00F3 KH\u00D4NG nh\u1EADn tabindex (tab \u0111i th\u1EB3ng\n v\u00E0o input b\u00EAn trong). `focusFromShell` \u0111\u00E3 t\u1EF1 lo\u1EA1i click tr\u00EAn input v\u00E0 tr\u00EAn n\u00FAt \u00D7 n\u00EAn g\u1EAFn th\u00EAm\n Enter d\u00F9ng chung handler l\u00E0 an to\u00E0n v\u00E0 ph\u1EA3n chi\u1EBFu \u0111\u00FAng h\u00E0nh vi click. -->\n<span\n class=\"c-seamless\"\n role=\"group\"\n [attr.aria-label]=\"field().label\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy() ?? null\"\n [attr.data-state]=\"_state\"\n [class.c-seamless--compact]=\"_density === 'compact'\"\n [class.c-seamless--comfortable]=\"_density === 'comfortable'\"\n (click)=\"focusFromShell($event)\"\n (keydown.enter)=\"focusFromShell($event)\">\n\n <!-- Label segment: icon + field name (+ optional operator pill) -->\n <span class=\"c-seamless__label\">\n <sd-icon class=\"c-seamless__icon\" [name]=\"icon()\"></sd-icon>\n <span class=\"c-seamless__field\">{{ field().label }}</span>\n @if (showOperator() && !_isNoData) {\n <sd-operator class=\"c-seamless__op\" [operators]=\"[_operator]\" [model]=\"_operator\" size=\"xs\" readonly />\n } @else if (!_isNoData) {\n <span class=\"c-seamless__sep\">:</span>\n }\n </span>\n\n <!-- Input segment \u2014 seamless borderless primitive; hidden for NULL / NOT_NULL -->\n @if (!_isNoData) {\n <span class=\"c-seamless__input\">\n @if (isBetween()) {\n <sd-inline-text\n #firstInput\n chrome=\"seamless\"\n [clearable]=\"false\"\n [autofocus]=\"autofocus()\"\n [state]=\"_state\"\n [value]=\"draftFrom()\"\n (valueChange)=\"draftFrom.set($event)\"\n [placeholder]=\"phFrom()\"\n [autoId]=\"_autoId ? _autoId + '-from' : undefined\"\n (sdFocus)=\"onFocus()\"\n (sdBlur)=\"commitRange()\"\n (keyupEnter)=\"firstInput.blur()\"\n (keydownEscape)=\"revertAndBlur(firstInput)\" />\n <span class=\"c-seamless__dash\" aria-hidden=\"true\">\u2014</span>\n <sd-inline-text\n #secondInput\n chrome=\"seamless\"\n [clearable]=\"false\"\n [state]=\"_state\"\n [value]=\"draftTo()\"\n (valueChange)=\"draftTo.set($event)\"\n [placeholder]=\"phTo()\"\n [autoId]=\"_autoId ? _autoId + '-to' : undefined\"\n (sdFocus)=\"onFocus()\"\n (sdBlur)=\"commitRange()\"\n (keyupEnter)=\"secondInput.blur()\"\n (keydownEscape)=\"revertAndBlur(secondInput)\" />\n } @else {\n <sd-inline-text\n #firstInput\n chrome=\"seamless\"\n [clearable]=\"false\"\n [autofocus]=\"autofocus()\"\n [state]=\"_state\"\n [value]=\"draft()\"\n (valueChange)=\"draft.set($event)\"\n [placeholder]=\"ph()\"\n [autoId]=\"_autoId ?? undefined\"\n (sdFocus)=\"onFocus()\"\n (sdBlur)=\"commitSingle()\"\n (keyupEnter)=\"firstInput.blur()\"\n (keydownEscape)=\"revertAndBlur(firstInput)\" />\n }\n </span>\n }\n\n <!-- \u00D7 segment \u2014 pinned chips cannot be removed. -->\n @if (!pinned()) {\n <button type=\"button\" class=\"c-seamless__x\" [attr.aria-label]=\"removeLabel()\" (click)=\"onRemove($event)\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n</span>\n", styles: [":host{display:inline-flex}.c-seamless:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.c-seamless{display:inline-flex;align-items:stretch;border-radius:var(--sd-radius-999, 999px);overflow:hidden;font-family:inherit;font-size:var(--sd-font-size-13, 13px);line-height:1;cursor:text;border:1px solid var(--sd-query-bar-border, #d6d8db);background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-query-bar-text-secondary, #5f6368);transition:border-color var(--sd-duration-fast, .12s) ease,background-color var(--sd-duration-fast, .12s) ease,box-shadow var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.c-seamless--compact{height:28px}.c-seamless--comfortable{height:32px}.c-seamless:hover:not([data-state=focus]):not([data-state=error]){border-color:var(--sd-primary)}.c-seamless[data-state=pending]{border-style:dashed;border-color:var(--sd-query-bar-border, #d6d8db);background:var(--sd-query-bar-bg, #ffffff);color:var(--sd-query-bar-text-secondary, #5f6368)}.c-seamless[data-state=active]{border-color:var(--sd-primary-light);background:var(--sd-primary-light)}.c-seamless[data-state=focus]{border-color:var(--sd-primary);background:var(--sd-query-bar-bg, #ffffff);box-shadow:0 0 0 3px var(--sd-primary-light)}.c-seamless[data-state=error]{border-color:var(--sd-query-bar-chip-danger, #d23535);background:var(--sd-query-bar-chip-danger-bg, #fff5f5);color:var(--sd-query-bar-chip-danger, #d23535);box-shadow:0 0 0 3px #d235351f}.c-seamless__label{display:inline-flex;align-items:center;gap:4px;font-weight:var(--sd-font-weight-medium, 500);white-space:nowrap;cursor:text;color:inherit}.c-seamless--compact .c-seamless__label{padding:0 0 0 12px}.c-seamless--comfortable .c-seamless__label{padding:0 0 0 14px}.c-seamless__icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px;color:inherit}.c-seamless__field{color:inherit}.c-seamless__op{display:inline-flex;align-items:center;color:inherit}.c-seamless__sep{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-seamless__input{display:inline-flex;align-items:center;gap:4px}.c-seamless--compact .c-seamless__input{padding:0 8px 0 4px}.c-seamless--comfortable .c-seamless__input{padding:0 10px 0 6px}.c-seamless__dash{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-seamless__x{display:inline-flex;align-items:center;justify-content:center;border:0;border-left:1px solid rgba(0,0,0,.04);background:transparent;cursor:pointer;color:inherit}.c-seamless--compact .c-seamless__x{width:26px}.c-seamless--comfortable .c-seamless__x{width:28px}.c-seamless__x sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-seamless__x:hover{background:#0000000d}\n"] }]
1089
+ }], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], operator: [{ type: i0.Input, args: [{ isSignal: true, alias: "operator", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], showOperator: [{ type: i0.Input, args: [{ isSignal: true, alias: "showOperator", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], pinned: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinned", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], describedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "describedBy", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], remove: [{ type: i0.Output, args: ["remove"] }], firstInput: [{ type: i0.ViewChild, args: ['firstInput', { isSignal: true }] }] } });
472
1090
 
473
1091
  /**
474
1092
  * Visual block for the in-progress build chip (inline mode token builder).
@@ -555,30 +1173,51 @@ class SdQueryBuildChip {
555
1173
  return t === 'string' || t === 'number';
556
1174
  }, ...(ngDevMode ? [{ debugName: "isSeamless" }] : /* istanbul ignore next */ []));
557
1175
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQueryBuildChip, deps: [], target: i0.ɵɵFactoryTarget.Component });
558
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdQueryBuildChip, isStandalone: true, selector: "sd-query-build-chip", inputs: { building: { classPropertyName: "building", publicName: "building", isSignal: true, isRequired: true, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, allowedOperators: { classPropertyName: "allowedOperators", publicName: "allowedOperators", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, showOperator: { classPropertyName: "showOperator", publicName: "showOperator", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pickOperator: "pickOperator", commitValue: "commitValue", cancel: "cancel", seamlessCommit: "seamlessCommit", draftChange: "draftChange", draftCommit: "draftCommit" }, viewQueries: [{ propertyName: "opMenu", first: true, predicate: ["buildOperator"], descendants: true, isSignal: true }, { propertyName: "picker", first: true, predicate: ["bPicker"], descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n In-progress chip (inline-mode token build flow).\n Seamless string/number branch keeps its own pill; everything else renders inside\n the dashed .c-token.c-token-building shell.\n-->\n@let _building = building();\n@let _autoId = autoId();\n\n@if (isSeamless()) {\n <sd-query-inline-value-chip\n [field]=\"_building.field\"\n [operator]=\"$any(_building.operator)\"\n [value]=\"_building.value ?? null\"\n [density]=\"density()\"\n [showOperator]=\"showOperator()\"\n [autoId]=\"_autoId\"\n [autofocus]=\"true\"\n (valueChange)=\"seamlessCommit.emit($event)\"\n (remove)=\"cancel.emit()\" />\n} @else {\n <div class=\"c-token c-token-building\">\n <span class=\"c-token-field\">{{ _building.field.label }}</span>\n\n @if (_building.step === 'operator') {\n <sd-operator\n #buildOperator\n class=\"c-token-op\"\n size=\"xs\"\n [operators]=\"allowedOperators()\"\n [model]=\"_building.operator\"\n (modelChange)=\"pickOperator.emit($any($event))\" />\n } @else {\n <!-- why: operator \u0111\u00E3 ch\u1ECDn hi\u1EC7n nh\u01B0 chip ho\u00E0n th\u00E0nh \u2014 glyph ch\u1EC9-xem c\u00F3 t\u00EAn v\u00E0 tooltip (readonly), kh\u00F4ng ph\u1EA3i n\u00FAt\n disabled n\u00EAn tooltip v\u1EABn ch\u1EA1y. -->\n <sd-operator\n class=\"c-token-op\"\n [operators]=\"[$any(_building.operator)]\"\n [model]=\"$any(_building.operator)\"\n size=\"xs\"\n readonly />\n\n @if (_building.field.type === 'values' || _building.field.type === 'lazy-values') {\n @let _bopt = $any(_building.field).option;\n <span class=\"c-token-value c-token-value-edit\">\n <sd-select #bPicker size=\"sm\" [viewed]=\"'inline'\" [clearable]=\"false\" minWidthPanel=\"300px\"\n [autoId]=\"_autoId\"\n [items]=\"_building.field.type === 'lazy-values' ? $any(_bopt).search : $any(_bopt.items)\"\n [valueField]=\"_bopt.valueField\"\n [displayField]=\"_bopt.displayField\"\n [multiple]=\"multiple()\"\n [model]=\"$any(_building.value)\"\n (sdChange)=\"commitValue.emit($event)\">\n <!-- why: build chip multi-select c\u0169ng c\u1EA7n \"head +N\" \u0111\u1EC3 g\u1ECDn (gi\u1ED1ng completed chip). -->\n <ng-template #sdValue let-selectedItems=\"selectedItems\">\n @if ((selectedItems?.length ?? 0) > 1) {\n <span class=\"c-token-multi-head\">{{ $any(selectedItems)[0][_bopt.displayField] }}</span> +{{ selectedItems.length - 1 }}\n } @else if ((selectedItems?.length ?? 0) === 1) {\n <span class=\"c-token-multi-head\">{{ $any(selectedItems)[0][_bopt.displayField] }}</span>\n }\n </ng-template>\n </sd-select>\n </span>\n } @else if (_building.field.type === 'date') {\n <span class=\"c-token-value c-token-value-edit\">\n @if (_building.operator === 'BETWEEN') {\n <!-- why: 1 sd-date-range thay 2 sd-date \u2014 g\u1ECDn h\u01A1n, h\u00E0nh vi th\u1ED1ng nh\u1EA5t v\u1EDBi completed chip. -->\n <sd-date-range #bPicker size=\"sm\" [viewed]=\"'inline'\" [clearable]=\"false\"\n [autoId]=\"_autoId\"\n [model]=\"$any(_building.value)\"\n (sdChange)=\"commitValue.emit($event)\"></sd-date-range>\n } @else {\n <sd-date #bPicker size=\"sm\" [viewed]=\"'inline'\" [clearable]=\"false\"\n [autoId]=\"_autoId\"\n [model]=\"$any(_building.value)\"\n (sdChange)=\"commitValue.emit($event)\"></sd-date>\n }\n </span>\n } @else if (_building.field.type === 'datetime') {\n <span class=\"c-token-value c-token-value-edit\">\n @if (_building.operator === 'BETWEEN') {\n <!-- why: datetime BETWEEN downgrade v\u1EC1 date-range (m\u1EA5t time precision; \u0111\u00E3 th\u1ED1ng nh\u1EA5t). -->\n <sd-date-range #bPicker size=\"sm\" [viewed]=\"'inline'\" [clearable]=\"false\"\n [autoId]=\"_autoId\"\n [model]=\"$any(_building.value)\"\n (sdChange)=\"commitValue.emit($event)\"></sd-date-range>\n } @else {\n <sd-datetime #bPicker size=\"sm\" [viewed]=\"'inline'\" [clearable]=\"false\"\n [autoId]=\"_autoId\"\n [model]=\"$any(_building.value)\"\n (sdChange)=\"commitValue.emit($event)\"></sd-datetime>\n }\n </span>\n } @else if (_building.field.type === 'boolean') {\n <!-- why: native button thay sd-button (tr\u00E1nh mat-button baseline 36px g\u00E2y tr\u00E0n).\n Pill nh\u1ECF v\u1EBD b\u1EB1ng CSS scoped trong chip \u2014 gi\u1EEF semantic colour qua class\n .c-bool-true / .c-bool-false. -->\n <span class=\"c-token-value c-token-value-edit c-bool-toggle\">\n <button\n type=\"button\"\n class=\"c-bool-btn c-bool-true\"\n [class.c-bool-active]=\"_building.value === true\"\n [attr.data-autoId]=\"_autoId + '-true'\"\n (click)=\"commitValue.emit(true)\">\n {{ $any(_building.field).trueLabel || booleanTrueLabel() }}\n </button>\n <button\n type=\"button\"\n class=\"c-bool-btn c-bool-false\"\n [class.c-bool-active]=\"_building.value === false\"\n [attr.data-autoId]=\"_autoId + '-false'\"\n (click)=\"commitValue.emit(false)\">\n {{ $any(_building.field).falseLabel || booleanFalseLabel() }}\n </button>\n </span>\n } @else {\n <!-- Fallback (e.g. unforeseen type) \u2014 generic sd-input wired via draft outputs. -->\n <span class=\"c-token-value c-token-value-edit\">\n <sd-input size=\"sm\"\n [autoId]=\"_autoId\"\n [model]=\"$any(_building.value)\"\n (sdChange)=\"draftChange.emit($event)\"\n (keyupEnter)=\"draftCommit.emit()\"></sd-input>\n </span>\n }\n }\n\n <button type=\"button\" class=\"c-token-remove\" aria-label=\"Cancel\" (click)=\"cancel.emit()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </div>\n}\n", styles: [":host{display:contents}.c-token{display:inline-flex;align-items:center;gap:4px;padding:0 0 0 12px;border:1px solid var(--sd-primary-light);border-radius:999px;background:var(--sd-primary-light);font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text-secondary, #5f6368);white-space:nowrap;overflow:hidden}:host-context(.c-density-compact) .c-token{height:28px}:host-context(.c-density-comfortable) .c-token{height:32px}.c-token-field{font-weight:var(--sd-font-weight-medium, 500);line-height:1}.c-token-op{display:inline-flex;align-items:center;color:inherit}.c-token-value{border:none;background:transparent;padding:0;font:inherit;font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-primary)}.c-token-value-edit{display:inline-flex;align-items:center;gap:4px;max-width:240px}.c-token-value-edit sd-input,.c-token-value-edit sd-input-number{display:inline-flex;max-width:140px}.c-token-value-edit sd-date-range{display:inline-flex;max-width:220px;min-width:0;flex:0 1 auto}.c-token-value-edit sd-select,.c-token-value-edit sd-date,.c-token-value-edit sd-datetime{display:inline-flex;align-items:center;line-height:1}.c-token ::ng-deep .mat-mdc-form-field{line-height:1}.c-token ::ng-deep .mat-mdc-text-field-wrapper,.c-token ::ng-deep .mat-mdc-form-field-flex{padding:0;min-height:0;background:transparent}.c-token ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}.c-token ::ng-deep .mat-mdc-select-value,.c-token ::ng-deep .mat-mdc-input-element,.c-token ::ng-deep input{line-height:1;font-size:var(--sd-font-size-13, 13px);padding:0;height:auto;color:inherit}.c-token ::ng-deep .mat-mdc-select-value{display:inline-flex;align-items:center;min-width:0;max-width:200px;overflow:hidden;text-overflow:ellipsis;color:var(--sd-primary);font-weight:var(--sd-font-weight-medium, 500)}.c-token ::ng-deep .sd-suffix-icon{display:none}.c-token-multi-head{display:inline-block;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}.c-token-building{border-style:dashed}.c-bool-toggle{display:inline-flex;align-items:center;gap:4px}.c-bool-btn{display:inline-flex;align-items:center;justify-content:center;height:18px;min-width:0;padding:0 8px;border:1px solid currentColor;border-radius:var(--sd-radius-999, 999px);background:transparent;font:inherit;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:1;cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;transition:background var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}:host-context(.c-density-comfortable) .c-bool-btn{height:20px;padding:0 10px;font-size:var(--sd-font-size-12, 12px)}.c-bool-true{color:var(--sd-success)}.c-bool-false{color:var(--sd-warning)}.c-bool-active.c-bool-true{background:var(--sd-success);color:var(--sd-text-on-solid, #ffffff);border-color:var(--sd-success)}.c-bool-active.c-bool-false{background:var(--sd-warning);color:var(--sd-text-on-solid, #ffffff);border-color:var(--sd-warning)}.c-bool-btn:hover:not(.c-bool-active).c-bool-true{background:var(--sd-success-light)}.c-bool-btn:hover:not(.c-bool-active).c-bool-false{background:var(--sd-warning-light)}.c-token-remove{align-self:stretch;display:inline-flex;align-items:center;justify-content:center;border:none;border-left:1px solid rgba(0,0,0,.04);border-radius:0;background:transparent;cursor:pointer;color:inherit}:host-context(.c-density-compact) .c-token-remove{width:26px}:host-context(.c-density-comfortable) .c-token-remove{width:28px}.c-token-remove sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-token-remove:hover{background:#0000000d}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "component", type: SdOperator, selector: "sd-operator", inputs: ["model", "operators", "disabled", "autoId", "size", "readonly", "active", "showCode"], outputs: ["modelChange"] }, { kind: "component", type: SdDate, selector: "sd-date", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus"] }, { kind: "component", type: SdDateRange, selector: "sd-date-range", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "hideInlineError", "required", "disabled", "viewed", "clearable", "appearance", "floatLabel", "min", "max", "transform", "model"], outputs: ["operatorChange", "modelChange", "sdChange"] }, { kind: "component", type: SdDatetime, selector: "sd-datetime", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "showSeconds", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["modelChange", "sdChange", "sdFocus"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "labelPlacement", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "type", "mask", "inputmode", "autocomplete", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "virtualScroll", "itemSize", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "items", "model"], outputs: ["operatorChange", "sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "component", type: SdQueryInlineValueChip, selector: "sd-query-inline-value-chip", inputs: ["field", "operator", "value", "density", "showOperator", "autoId", "autofocus", "pinned", "invalid", "describedBy"], outputs: ["valueChange", "remove"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1176
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdQueryBuildChip, isStandalone: true, selector: "sd-query-build-chip", inputs: { building: { classPropertyName: "building", publicName: "building", isSignal: true, isRequired: true, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, allowedOperators: { classPropertyName: "allowedOperators", publicName: "allowedOperators", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, showOperator: { classPropertyName: "showOperator", publicName: "showOperator", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pickOperator: "pickOperator", commitValue: "commitValue", cancel: "cancel", seamlessCommit: "seamlessCommit", draftChange: "draftChange", draftCommit: "draftCommit" }, viewQueries: [{ propertyName: "opMenu", first: true, predicate: ["buildOperator"], descendants: true, isSignal: true }, { propertyName: "picker", first: true, predicate: ["bPicker"], descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n In-progress chip (inline-mode token build flow).\n Seamless string/number branch keeps its own pill; everything else renders inside\n the dashed .c-token.c-token-building shell.\n-->\n@let _building = building();\n@let _autoId = autoId();\n\n@if (isSeamless()) {\n <sd-query-inline-value-chip\n [field]=\"_building.field\"\n [operator]=\"$any(_building.operator)\"\n [value]=\"_building.value ?? null\"\n [density]=\"density()\"\n [showOperator]=\"showOperator()\"\n [autoId]=\"_autoId\"\n [autofocus]=\"true\"\n (valueChange)=\"seamlessCommit.emit($event)\"\n (remove)=\"cancel.emit()\" />\n} @else {\n <div class=\"c-token c-token-building\">\n <span class=\"c-token-field\">{{ _building.field.label }}</span>\n\n @if (_building.step === 'operator') {\n <sd-operator\n #buildOperator\n class=\"c-token-op\"\n size=\"xs\"\n [operators]=\"allowedOperators()\"\n [model]=\"_building.operator\"\n (modelChange)=\"pickOperator.emit($any($event))\" />\n } @else {\n <!-- why: operator \u0111\u00E3 ch\u1ECDn hi\u1EC7n nh\u01B0 chip ho\u00E0n th\u00E0nh \u2014 glyph ch\u1EC9-xem c\u00F3 t\u00EAn v\u00E0 tooltip (readonly), kh\u00F4ng ph\u1EA3i n\u00FAt\n disabled n\u00EAn tooltip v\u1EABn ch\u1EA1y. -->\n <sd-operator\n class=\"c-token-op\"\n [operators]=\"[$any(_building.operator)]\"\n [model]=\"$any(_building.operator)\"\n size=\"xs\"\n readonly />\n\n @if (_building.field.type === 'values' || _building.field.type === 'lazy-values') {\n @let _bopt = $any(_building.field).option;\n <span class=\"c-token-value c-token-value-edit\">\n <sd-select #bPicker size=\"sm\" [viewed]=\"'inline'\" [clearable]=\"false\" minWidthPanel=\"300px\"\n [autoId]=\"_autoId\"\n [items]=\"_building.field.type === 'lazy-values' ? $any(_bopt).search : $any(_bopt.items)\"\n [valueField]=\"_bopt.valueField\"\n [displayField]=\"_bopt.displayField\"\n [multiple]=\"multiple()\"\n [model]=\"$any(_building.value)\"\n (sdChange)=\"commitValue.emit($event)\">\n <!-- why: build chip multi-select c\u0169ng c\u1EA7n \"head +N\" \u0111\u1EC3 g\u1ECDn (gi\u1ED1ng completed chip). -->\n <ng-template #sdValue let-selectedItems=\"selectedItems\">\n @if ((selectedItems?.length ?? 0) > 1) {\n <span class=\"c-token-multi-head\">{{ $any(selectedItems)[0][_bopt.displayField] }}</span> +{{ selectedItems.length - 1 }}\n } @else if ((selectedItems?.length ?? 0) === 1) {\n <span class=\"c-token-multi-head\">{{ $any(selectedItems)[0][_bopt.displayField] }}</span>\n }\n </ng-template>\n </sd-select>\n </span>\n } @else if (_building.field.type === 'date') {\n <span class=\"c-token-value c-token-value-edit\">\n @if (_building.operator === 'BETWEEN') {\n <!-- why: 1 sd-date-range thay 2 sd-date \u2014 g\u1ECDn h\u01A1n, h\u00E0nh vi th\u1ED1ng nh\u1EA5t v\u1EDBi completed chip. -->\n <sd-date-range #bPicker size=\"sm\" [viewed]=\"'inline'\" [clearable]=\"false\"\n [autoId]=\"_autoId\"\n [model]=\"$any(_building.value)\"\n (sdChange)=\"commitValue.emit($event)\"></sd-date-range>\n } @else {\n <sd-date #bPicker size=\"sm\" [viewed]=\"'inline'\" [clearable]=\"false\"\n [autoId]=\"_autoId\"\n [model]=\"$any(_building.value)\"\n (sdChange)=\"commitValue.emit($event)\"></sd-date>\n }\n </span>\n } @else if (_building.field.type === 'datetime') {\n <span class=\"c-token-value c-token-value-edit\">\n @if (_building.operator === 'BETWEEN') {\n <!-- why: datetime BETWEEN downgrade v\u1EC1 date-range (m\u1EA5t time precision; \u0111\u00E3 th\u1ED1ng nh\u1EA5t). -->\n <sd-date-range #bPicker size=\"sm\" [viewed]=\"'inline'\" [clearable]=\"false\"\n [autoId]=\"_autoId\"\n [model]=\"$any(_building.value)\"\n (sdChange)=\"commitValue.emit($event)\"></sd-date-range>\n } @else {\n <sd-datetime #bPicker size=\"sm\" [viewed]=\"'inline'\" [clearable]=\"false\"\n [autoId]=\"_autoId\"\n [model]=\"$any(_building.value)\"\n (sdChange)=\"commitValue.emit($event)\"></sd-datetime>\n }\n </span>\n } @else if (_building.field.type === 'boolean') {\n <!-- why: native button thay sd-button (tr\u00E1nh mat-button baseline 36px g\u00E2y tr\u00E0n).\n Pill nh\u1ECF v\u1EBD b\u1EB1ng CSS scoped trong chip \u2014 gi\u1EEF semantic colour qua class\n .c-bool-true / .c-bool-false. -->\n <span class=\"c-token-value c-token-value-edit c-bool-toggle\">\n <button\n type=\"button\"\n class=\"c-bool-btn c-bool-true\"\n [class.c-bool-active]=\"_building.value === true\"\n [attr.data-autoId]=\"_autoId + '-true'\"\n (click)=\"commitValue.emit(true)\">\n {{ $any(_building.field).trueLabel || booleanTrueLabel() }}\n </button>\n <button\n type=\"button\"\n class=\"c-bool-btn c-bool-false\"\n [class.c-bool-active]=\"_building.value === false\"\n [attr.data-autoId]=\"_autoId + '-false'\"\n (click)=\"commitValue.emit(false)\">\n {{ $any(_building.field).falseLabel || booleanFalseLabel() }}\n </button>\n </span>\n } @else {\n <!-- Fallback (e.g. unforeseen type) \u2014 generic sd-input wired via draft outputs. -->\n <span class=\"c-token-value c-token-value-edit\">\n <sd-input size=\"sm\"\n [autoId]=\"_autoId\"\n [model]=\"$any(_building.value)\"\n (sdChange)=\"draftChange.emit($event)\"\n (keyupEnter)=\"draftCommit.emit()\"></sd-input>\n </span>\n }\n }\n\n <button type=\"button\" class=\"c-token-remove\" aria-label=\"Cancel\" (click)=\"cancel.emit()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </div>\n}\n", styles: [":host{display:contents}.c-token{display:inline-flex;align-items:center;gap:4px;padding:0 0 0 12px;border:1px solid var(--sd-primary-light);border-radius:999px;background:var(--sd-primary-light);font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text-secondary, #5f6368);white-space:nowrap;overflow:hidden}:host-context(.c-density-compact) .c-token{height:28px}:host-context(.c-density-comfortable) .c-token{height:32px}.c-token-field{font-weight:var(--sd-font-weight-medium, 500);line-height:1}.c-token-op{display:inline-flex;align-items:center;color:inherit}.c-token-value{border:none;background:transparent;padding:0;font:inherit;font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-primary)}.c-token-value-edit{display:inline-flex;align-items:center;gap:4px;max-width:240px}.c-token-value-edit sd-input,.c-token-value-edit sd-input-number{display:inline-flex;max-width:140px}.c-token-value-edit sd-date-range{display:inline-flex;max-width:220px;min-width:0;flex:0 1 auto}.c-token-value-edit sd-select,.c-token-value-edit sd-date,.c-token-value-edit sd-datetime{display:inline-flex;align-items:center;line-height:1}.c-token ::ng-deep .mat-mdc-form-field{line-height:1}.c-token ::ng-deep .mat-mdc-text-field-wrapper,.c-token ::ng-deep .mat-mdc-form-field-flex{padding:0;min-height:0;background:transparent}.c-token ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}.c-token ::ng-deep .mat-mdc-select-value,.c-token ::ng-deep .mat-mdc-input-element,.c-token ::ng-deep input{line-height:1;font-size:var(--sd-font-size-13, 13px);padding:0;height:auto;color:inherit}.c-token ::ng-deep .mat-mdc-select-value{display:inline-flex;align-items:center;min-width:0;max-width:200px;overflow:hidden;text-overflow:ellipsis;color:var(--sd-primary);font-weight:var(--sd-font-weight-medium, 500)}.c-token ::ng-deep .sd-suffix-icon{display:none}.c-token-multi-head{display:inline-block;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}.c-token-building{border-style:dashed}.c-bool-toggle{display:inline-flex;align-items:center;gap:4px}.c-bool-btn{display:inline-flex;align-items:center;justify-content:center;height:18px;min-width:0;padding:0 8px;border:1px solid currentColor;border-radius:var(--sd-radius-999, 999px);background:transparent;font:inherit;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:1;cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;transition:background var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}:host-context(.c-density-comfortable) .c-bool-btn{height:20px;padding:0 10px;font-size:var(--sd-font-size-12, 12px)}.c-bool-true{color:var(--sd-success)}.c-bool-false{color:var(--sd-warning)}.c-bool-active.c-bool-true{background:var(--sd-success);color:var(--sd-text-on-solid, #ffffff);border-color:var(--sd-success)}.c-bool-active.c-bool-false{background:var(--sd-warning);color:var(--sd-text-on-solid, #ffffff);border-color:var(--sd-warning)}.c-bool-btn:hover:not(.c-bool-active).c-bool-true{background:var(--sd-success-light)}.c-bool-btn:hover:not(.c-bool-active).c-bool-false{background:var(--sd-warning-light)}.c-token-remove{align-self:stretch;display:inline-flex;align-items:center;justify-content:center;border:none;border-left:1px solid rgba(0,0,0,.04);border-radius:0;background:transparent;cursor:pointer;color:inherit}:host-context(.c-density-compact) .c-token-remove{width:26px}:host-context(.c-density-comfortable) .c-token-remove{width:28px}.c-token-remove sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-token-remove:hover{background:#0000000d}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "component", type: SdOperator, selector: "sd-operator", inputs: ["model", "operators", "disabled", "autoId", "size", "readonly", "active", "showCode"], outputs: ["modelChange"] }, { kind: "component", type: SdDate, selector: "sd-date", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus"] }, { kind: "component", type: SdDateRange, selector: "sd-date-range", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "hideInlineError", "required", "disabled", "viewed", "clearable", "appearance", "floatLabel", "min", "max", "transform", "model"], outputs: ["operatorChange", "modelChange", "sdChange"] }, { kind: "component", type: SdDatetime, selector: "sd-datetime", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "showSeconds", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["modelChange", "sdChange", "sdFocus"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "labelPlacement", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "type", "mask", "inputmode", "autocomplete", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "virtualScroll", "itemSize", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "items", "model"], outputs: ["operatorChange", "sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "component", type: SdQueryInlineValueChip, selector: "sd-query-inline-value-chip", inputs: ["field", "operator", "value", "density", "showOperator", "autoId", "autofocus", "pinned", "required", "invalid", "describedBy"], outputs: ["valueChange", "remove"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
559
1177
  }
560
1178
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQueryBuildChip, decorators: [{
561
1179
  type: Component,
562
1180
  args: [{ selector: 'sd-query-build-chip', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SdIcon, CommonModule, SdOperator, SdDate, SdDateRange, SdDatetime, SdInput, SdInputNumber, SdSelect, SdQueryInlineValueChip], template: "<!--\n In-progress chip (inline-mode token build flow).\n Seamless string/number branch keeps its own pill; everything else renders inside\n the dashed .c-token.c-token-building shell.\n-->\n@let _building = building();\n@let _autoId = autoId();\n\n@if (isSeamless()) {\n <sd-query-inline-value-chip\n [field]=\"_building.field\"\n [operator]=\"$any(_building.operator)\"\n [value]=\"_building.value ?? null\"\n [density]=\"density()\"\n [showOperator]=\"showOperator()\"\n [autoId]=\"_autoId\"\n [autofocus]=\"true\"\n (valueChange)=\"seamlessCommit.emit($event)\"\n (remove)=\"cancel.emit()\" />\n} @else {\n <div class=\"c-token c-token-building\">\n <span class=\"c-token-field\">{{ _building.field.label }}</span>\n\n @if (_building.step === 'operator') {\n <sd-operator\n #buildOperator\n class=\"c-token-op\"\n size=\"xs\"\n [operators]=\"allowedOperators()\"\n [model]=\"_building.operator\"\n (modelChange)=\"pickOperator.emit($any($event))\" />\n } @else {\n <!-- why: operator \u0111\u00E3 ch\u1ECDn hi\u1EC7n nh\u01B0 chip ho\u00E0n th\u00E0nh \u2014 glyph ch\u1EC9-xem c\u00F3 t\u00EAn v\u00E0 tooltip (readonly), kh\u00F4ng ph\u1EA3i n\u00FAt\n disabled n\u00EAn tooltip v\u1EABn ch\u1EA1y. -->\n <sd-operator\n class=\"c-token-op\"\n [operators]=\"[$any(_building.operator)]\"\n [model]=\"$any(_building.operator)\"\n size=\"xs\"\n readonly />\n\n @if (_building.field.type === 'values' || _building.field.type === 'lazy-values') {\n @let _bopt = $any(_building.field).option;\n <span class=\"c-token-value c-token-value-edit\">\n <sd-select #bPicker size=\"sm\" [viewed]=\"'inline'\" [clearable]=\"false\" minWidthPanel=\"300px\"\n [autoId]=\"_autoId\"\n [items]=\"_building.field.type === 'lazy-values' ? $any(_bopt).search : $any(_bopt.items)\"\n [valueField]=\"_bopt.valueField\"\n [displayField]=\"_bopt.displayField\"\n [multiple]=\"multiple()\"\n [model]=\"$any(_building.value)\"\n (sdChange)=\"commitValue.emit($event)\">\n <!-- why: build chip multi-select c\u0169ng c\u1EA7n \"head +N\" \u0111\u1EC3 g\u1ECDn (gi\u1ED1ng completed chip). -->\n <ng-template #sdValue let-selectedItems=\"selectedItems\">\n @if ((selectedItems?.length ?? 0) > 1) {\n <span class=\"c-token-multi-head\">{{ $any(selectedItems)[0][_bopt.displayField] }}</span> +{{ selectedItems.length - 1 }}\n } @else if ((selectedItems?.length ?? 0) === 1) {\n <span class=\"c-token-multi-head\">{{ $any(selectedItems)[0][_bopt.displayField] }}</span>\n }\n </ng-template>\n </sd-select>\n </span>\n } @else if (_building.field.type === 'date') {\n <span class=\"c-token-value c-token-value-edit\">\n @if (_building.operator === 'BETWEEN') {\n <!-- why: 1 sd-date-range thay 2 sd-date \u2014 g\u1ECDn h\u01A1n, h\u00E0nh vi th\u1ED1ng nh\u1EA5t v\u1EDBi completed chip. -->\n <sd-date-range #bPicker size=\"sm\" [viewed]=\"'inline'\" [clearable]=\"false\"\n [autoId]=\"_autoId\"\n [model]=\"$any(_building.value)\"\n (sdChange)=\"commitValue.emit($event)\"></sd-date-range>\n } @else {\n <sd-date #bPicker size=\"sm\" [viewed]=\"'inline'\" [clearable]=\"false\"\n [autoId]=\"_autoId\"\n [model]=\"$any(_building.value)\"\n (sdChange)=\"commitValue.emit($event)\"></sd-date>\n }\n </span>\n } @else if (_building.field.type === 'datetime') {\n <span class=\"c-token-value c-token-value-edit\">\n @if (_building.operator === 'BETWEEN') {\n <!-- why: datetime BETWEEN downgrade v\u1EC1 date-range (m\u1EA5t time precision; \u0111\u00E3 th\u1ED1ng nh\u1EA5t). -->\n <sd-date-range #bPicker size=\"sm\" [viewed]=\"'inline'\" [clearable]=\"false\"\n [autoId]=\"_autoId\"\n [model]=\"$any(_building.value)\"\n (sdChange)=\"commitValue.emit($event)\"></sd-date-range>\n } @else {\n <sd-datetime #bPicker size=\"sm\" [viewed]=\"'inline'\" [clearable]=\"false\"\n [autoId]=\"_autoId\"\n [model]=\"$any(_building.value)\"\n (sdChange)=\"commitValue.emit($event)\"></sd-datetime>\n }\n </span>\n } @else if (_building.field.type === 'boolean') {\n <!-- why: native button thay sd-button (tr\u00E1nh mat-button baseline 36px g\u00E2y tr\u00E0n).\n Pill nh\u1ECF v\u1EBD b\u1EB1ng CSS scoped trong chip \u2014 gi\u1EEF semantic colour qua class\n .c-bool-true / .c-bool-false. -->\n <span class=\"c-token-value c-token-value-edit c-bool-toggle\">\n <button\n type=\"button\"\n class=\"c-bool-btn c-bool-true\"\n [class.c-bool-active]=\"_building.value === true\"\n [attr.data-autoId]=\"_autoId + '-true'\"\n (click)=\"commitValue.emit(true)\">\n {{ $any(_building.field).trueLabel || booleanTrueLabel() }}\n </button>\n <button\n type=\"button\"\n class=\"c-bool-btn c-bool-false\"\n [class.c-bool-active]=\"_building.value === false\"\n [attr.data-autoId]=\"_autoId + '-false'\"\n (click)=\"commitValue.emit(false)\">\n {{ $any(_building.field).falseLabel || booleanFalseLabel() }}\n </button>\n </span>\n } @else {\n <!-- Fallback (e.g. unforeseen type) \u2014 generic sd-input wired via draft outputs. -->\n <span class=\"c-token-value c-token-value-edit\">\n <sd-input size=\"sm\"\n [autoId]=\"_autoId\"\n [model]=\"$any(_building.value)\"\n (sdChange)=\"draftChange.emit($event)\"\n (keyupEnter)=\"draftCommit.emit()\"></sd-input>\n </span>\n }\n }\n\n <button type=\"button\" class=\"c-token-remove\" aria-label=\"Cancel\" (click)=\"cancel.emit()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </div>\n}\n", styles: [":host{display:contents}.c-token{display:inline-flex;align-items:center;gap:4px;padding:0 0 0 12px;border:1px solid var(--sd-primary-light);border-radius:999px;background:var(--sd-primary-light);font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text-secondary, #5f6368);white-space:nowrap;overflow:hidden}:host-context(.c-density-compact) .c-token{height:28px}:host-context(.c-density-comfortable) .c-token{height:32px}.c-token-field{font-weight:var(--sd-font-weight-medium, 500);line-height:1}.c-token-op{display:inline-flex;align-items:center;color:inherit}.c-token-value{border:none;background:transparent;padding:0;font:inherit;font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-primary)}.c-token-value-edit{display:inline-flex;align-items:center;gap:4px;max-width:240px}.c-token-value-edit sd-input,.c-token-value-edit sd-input-number{display:inline-flex;max-width:140px}.c-token-value-edit sd-date-range{display:inline-flex;max-width:220px;min-width:0;flex:0 1 auto}.c-token-value-edit sd-select,.c-token-value-edit sd-date,.c-token-value-edit sd-datetime{display:inline-flex;align-items:center;line-height:1}.c-token ::ng-deep .mat-mdc-form-field{line-height:1}.c-token ::ng-deep .mat-mdc-text-field-wrapper,.c-token ::ng-deep .mat-mdc-form-field-flex{padding:0;min-height:0;background:transparent}.c-token ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}.c-token ::ng-deep .mat-mdc-select-value,.c-token ::ng-deep .mat-mdc-input-element,.c-token ::ng-deep input{line-height:1;font-size:var(--sd-font-size-13, 13px);padding:0;height:auto;color:inherit}.c-token ::ng-deep .mat-mdc-select-value{display:inline-flex;align-items:center;min-width:0;max-width:200px;overflow:hidden;text-overflow:ellipsis;color:var(--sd-primary);font-weight:var(--sd-font-weight-medium, 500)}.c-token ::ng-deep .sd-suffix-icon{display:none}.c-token-multi-head{display:inline-block;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}.c-token-building{border-style:dashed}.c-bool-toggle{display:inline-flex;align-items:center;gap:4px}.c-bool-btn{display:inline-flex;align-items:center;justify-content:center;height:18px;min-width:0;padding:0 8px;border:1px solid currentColor;border-radius:var(--sd-radius-999, 999px);background:transparent;font:inherit;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:1;cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;transition:background var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}:host-context(.c-density-comfortable) .c-bool-btn{height:20px;padding:0 10px;font-size:var(--sd-font-size-12, 12px)}.c-bool-true{color:var(--sd-success)}.c-bool-false{color:var(--sd-warning)}.c-bool-active.c-bool-true{background:var(--sd-success);color:var(--sd-text-on-solid, #ffffff);border-color:var(--sd-success)}.c-bool-active.c-bool-false{background:var(--sd-warning);color:var(--sd-text-on-solid, #ffffff);border-color:var(--sd-warning)}.c-bool-btn:hover:not(.c-bool-active).c-bool-true{background:var(--sd-success-light)}.c-bool-btn:hover:not(.c-bool-active).c-bool-false{background:var(--sd-warning-light)}.c-token-remove{align-self:stretch;display:inline-flex;align-items:center;justify-content:center;border:none;border-left:1px solid rgba(0,0,0,.04);border-radius:0;background:transparent;cursor:pointer;color:inherit}:host-context(.c-density-compact) .c-token-remove{width:26px}:host-context(.c-density-comfortable) .c-token-remove{width:28px}.c-token-remove sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-token-remove:hover{background:#0000000d}\n"] }]
563
1181
  }], propDecorators: { building: [{ type: i0.Input, args: [{ isSignal: true, alias: "building", required: true }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], allowedOperators: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowedOperators", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], showOperator: [{ type: i0.Input, args: [{ isSignal: true, alias: "showOperator", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], pickOperator: [{ type: i0.Output, args: ["pickOperator"] }], commitValue: [{ type: i0.Output, args: ["commitValue"] }], cancel: [{ type: i0.Output, args: ["cancel"] }], seamlessCommit: [{ type: i0.Output, args: ["seamlessCommit"] }], draftChange: [{ type: i0.Output, args: ["draftChange"] }], draftCommit: [{ type: i0.Output, args: ["draftCommit"] }], opMenu: [{ type: i0.ViewChild, args: ['buildOperator', { isSignal: true }] }], picker: [{ type: i0.ViewChild, args: ['bPicker', { isSignal: true }] }] } });
564
1182
 
1183
+ const hasValue$1 = (value) => value !== null && value !== undefined && value !== '';
1184
+ /**
1185
+ * A chip is "active" when it has a non-empty value OR a no-data operator (NULL / NOT_NULL). A BETWEEN range is active
1186
+ * when either end is set; `{ from: null, to: null }` is empty. Shared by the bar and the chip popover.
1187
+ *
1188
+ * Internal (`ɵ`): not exported from the entry point.
1189
+ */
1190
+ function ɵsdQueryFilterActive(filter) {
1191
+ if (SD_QUERY_NO_DATA_OPERATORS.includes(filter.operator))
1192
+ return true;
1193
+ const data = filter.data;
1194
+ if (data === null || data === undefined || data === '')
1195
+ return false;
1196
+ if (Array.isArray(data))
1197
+ return data.length > 0;
1198
+ if (filter.operator === 'BETWEEN' && typeof data === 'object') {
1199
+ const range = data;
1200
+ return hasValue$1(range.from) || hasValue$1(range.to);
1201
+ }
1202
+ return true;
1203
+ }
1204
+
1205
+ let nextLabelId = 0;
565
1206
  /**
566
- * Popover-mode chip editor — the entire `<mat-menu>` that opens when a popover-mode
567
- * chip is clicked. Owns ALL operator+value staging signals and async option loading.
1207
+ * Popover-mode chip editor — the dialog panel that opens when a popover-mode chip is clicked (handoff section 4).
1208
+ * Owns ALL operator+value staging signals and async option loading.
568
1209
  *
569
1210
  * why: tách khỏi `<sd-query-bar>` để parent chỉ giữ `editingIndex` (chip nào đang
570
1211
  * mở) + nhận `(commit)` khi popover đóng. Mỗi lần parent gọi `seed(filter, field)`
571
1212
  * trước khi mở chip popover, child reset staging signals + kích option loading.
572
1213
  *
573
1214
  * Public surface (template ref `#cp`):
574
- * - `cp.menu()` — the `<mat-menu>` to feed `[menu]` of `<sd-query-popover-chip>`
575
- * - `cp.seed(filter, field)` — parent reseeds staging before opening
576
- * - `(commit)` output — emitted on mat-menu close with staged Filter
577
- * - `(swapField)` output — emitted when the nested field switcher picks a new field
1215
+ * - `cp.panel()` — the panel to feed `[panel]` of `<sd-query-popover-chip>`
1216
+ * - `cp.seed(filter, field, index)` — parent reseeds staging before the panel renders
1217
+ * - `(commit)` output — emitted when the panel closes (Esc, click outside, Tab out, close) with the staged Filter
578
1218
  */
579
1219
  class SdQueryChipPopover {
580
1220
  #i18n = inject(I18nService);
581
- swapFieldTooltip = computed(() => this.#i18n.t('core.component.query-bar.swap-field'), ...(ngDevMode ? [{ debugName: "swapFieldTooltip" }] : /* istanbul ignore next */ []));
582
1221
  fromPlaceholder = computed(() => this.#i18n.t('core.component.query-bar.placeholder.from-number'), ...(ngDevMode ? [{ debugName: "fromPlaceholder" }] : /* istanbul ignore next */ []));
583
1222
  toPlaceholder = computed(() => this.#i18n.t('core.component.query-bar.placeholder.to-number'), ...(ngDevMode ? [{ debugName: "toPlaceholder" }] : /* istanbul ignore next */ []));
584
1223
  booleanTrueLabel = computed(() => this.#i18n.t('core.component.query-bar.boolean.true'), ...(ngDevMode ? [{ debugName: "booleanTrueLabel" }] : /* istanbul ignore next */ []));
@@ -586,6 +1225,7 @@ class SdQueryChipPopover {
586
1225
  selectValuePlaceholder = computed(() => this.#i18n.t('core.component.query-bar.placeholder.select-value'), ...(ngDevMode ? [{ debugName: "selectValuePlaceholder" }] : /* istanbul ignore next */ []));
587
1226
  enterValuePlaceholder = computed(() => this.#i18n.t('core.component.query-bar.placeholder.enter-value'), ...(ngDevMode ? [{ debugName: "enterValuePlaceholder" }] : /* istanbul ignore next */ []));
588
1227
  loadingValuesLabel = computed(() => this.#i18n.t('core.component.query-bar.loading-values'), ...(ngDevMode ? [{ debugName: "loadingValuesLabel" }] : /* istanbul ignore next */ []));
1228
+ minOneLabel = computed(() => this.#i18n.t('core.component.query-bar.required-min-one'), ...(ngDevMode ? [{ debugName: "minOneLabel" }] : /* istanbul ignore next */ []));
589
1229
  // ---------------------------------------------------------------------------
590
1230
  // Inputs
591
1231
  // ---------------------------------------------------------------------------
@@ -597,17 +1237,13 @@ class SdQueryChipPopover {
597
1237
  chipIndex = input(null, ...(ngDevMode ? [{ debugName: "chipIndex" }] : /* istanbul ignore next */ []));
598
1238
  /** Prefix for `data-autoId` on inner controls. */
599
1239
  autoIdBase = input('qb', ...(ngDevMode ? [{ debugName: "autoIdBase" }] : /* istanbul ignore next */ []));
600
- /** MatMenu for the field switcher — parent passes its `<sd-query-field-picker>` menu. */
601
- switchPickerMenu = input(undefined, ...(ngDevMode ? [{ debugName: "switchPickerMenu" }] : /* istanbul ignore next */ []));
602
1240
  // ---------------------------------------------------------------------------
603
1241
  // Outputs
604
1242
  // ---------------------------------------------------------------------------
605
- /** Emitted when mat-menu closes — parent splices `next` into filters[idx]. */
1243
+ /** Emitted when the panel closes — parent splices `next` into filters[idx]. */
606
1244
  commit = output();
607
- /** Emitted when nested field-switcher picks a new field — parent calls changeFilterField. */
608
- swapField = output();
609
1245
  // ---------------------------------------------------------------------------
610
- // Staging signals — uncommitted edits, committed on menu close.
1246
+ // Staging signals — uncommitted edits, committed when the panel closes.
611
1247
  // ---------------------------------------------------------------------------
612
1248
  /** Staged operator. */
613
1249
  editingOperator = signal('EQUAL', ...(ngDevMode ? [{ debugName: "editingOperator" }] : /* istanbul ignore next */ []));
@@ -617,15 +1253,27 @@ class SdQueryChipPopover {
617
1253
  editingOptions = signal([], ...(ngDevMode ? [{ debugName: "editingOptions" }] : /* istanbul ignore next */ []));
618
1254
  /** Loading flag for async option fetch. */
619
1255
  editingOptionsLoading = signal(false, ...(ngDevMode ? [{ debugName: "editingOptionsLoading" }] : /* istanbul ignore next */ []));
1256
+ // why: `seed()` chạy trước khi panel vẽ nội dung, còn `[field]` / `[filter]` / `[chipIndex]` của cha chỉ cập nhật ở lượt
1257
+ // change detection sau — giữ bản seed để lần vẽ đầu (và focus đầu tiên) đã đúng field.
1258
+ #seededField = signal(undefined, ...(ngDevMode ? [{ debugName: "#seededField" }] : /* istanbul ignore next */ []));
1259
+ #seededFilter = signal(undefined, ...(ngDevMode ? [{ debugName: "#seededFilter" }] : /* istanbul ignore next */ []));
1260
+ #seededIndex = signal(null, ...(ngDevMode ? [{ debugName: "#seededIndex" }] : /* istanbul ignore next */ []));
1261
+ /** Field being edited: the one seeded last, else the `[field]` input. */
1262
+ currentField = computed(() => this.#seededField() ?? this.field(), ...(ngDevMode ? [{ debugName: "currentField" }] : /* istanbul ignore next */ []));
1263
+ /** The field is required: no empty selection, no clear button (handoff B3). */
1264
+ required = computed(() => !!this.currentField()?.required, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
1265
+ /** "Choose at least one value." after a required multi-value chip was refused an empty selection. */
1266
+ minOneHint = signal(false, ...(ngDevMode ? [{ debugName: "minOneHint" }] : /* istanbul ignore next */ []));
1267
+ hintId = `sd-query-chip-popover-hint-${nextLabelId}`;
620
1268
  // ---------------------------------------------------------------------------
621
1269
  // Derived state
622
1270
  // ---------------------------------------------------------------------------
623
1271
  allowedOperators = computed(() => {
624
- const f = this.field();
1272
+ const f = this.currentField();
625
1273
  return f ? sdQueryAllowedOperators(f) : [];
626
1274
  }, ...(ngDevMode ? [{ debugName: "allowedOperators" }] : /* istanbul ignore next */ []));
627
1275
  showOperatorSelector = computed(() => {
628
- const f = this.field();
1276
+ const f = this.currentField();
629
1277
  return f ? sdQueryShowOperatorSelector(f) : false;
630
1278
  }, ...(ngDevMode ? [{ debugName: "showOperatorSelector" }] : /* istanbul ignore next */ []));
631
1279
  /** Whether the staged operator is multi-select (IN/NOT_IN). */
@@ -639,20 +1287,26 @@ class SdQueryChipPopover {
639
1287
  /** Compose an autoId for an inner control (`<base>-chip<idx>-<role>`). */
640
1288
  chipAutoId(role) {
641
1289
  const base = this.autoIdBase() ?? 'qb';
642
- const idx = this.chipIndex();
1290
+ const idx = this.#seededIndex() ?? this.chipIndex();
643
1291
  return `${base}-chip${idx ?? 'x'}-${role}`;
644
1292
  }
645
1293
  iconFor = sdQueryFieldIcon;
646
1294
  // ---------------------------------------------------------------------------
647
- // mat-menu instance — parent reads via `cp.menu()`
1295
+ // Panel — the chip trigger binds `[panel]="cp.panel()"`
648
1296
  // ---------------------------------------------------------------------------
649
- menu = viewChild('menu', ...(ngDevMode ? [{ debugName: "menu" }] : /* istanbul ignore next */ []));
1297
+ panel = viewChild.required('panel');
1298
+ /** Id of the field label in the header — the dialog's accessible name. */
1299
+ labelId = `sd-query-chip-popover-label-${nextLabelId++}`;
650
1300
  // ---------------------------------------------------------------------------
651
1301
  // Seed — parent calls before opening the popover so staging signals are
652
1302
  // primed from the current filter + the option list is loaded.
653
1303
  // ---------------------------------------------------------------------------
654
- /** Reseed staging from a new filter/field pair — call before opening the menu. */
655
- seed(filter, field) {
1304
+ /** Reseed staging from a new filter/field pair — call before the panel renders (`panelOpened`). */
1305
+ seed(filter, field, index = null) {
1306
+ this.#seededField.set(filter && field ? field : undefined);
1307
+ this.#seededFilter.set(filter && field ? filter : undefined);
1308
+ this.#seededIndex.set(filter && field ? index : null);
1309
+ this.minOneHint.set(false);
656
1310
  if (!filter || !field) {
657
1311
  this.editingOperator.set('EQUAL');
658
1312
  this.editingValue.set(null);
@@ -702,8 +1356,16 @@ class SdQueryChipPopover {
702
1356
  this.editingValue.set(Array.isArray(v) && v.length > 0 ? v[0] : null);
703
1357
  }
704
1358
  }
705
- /** Single-value input change. */
1359
+ /** Value control change. A required multi-value chip keeps its values when the change would empty it (B3). */
706
1360
  onEditingValueInput(value) {
1361
+ if (this.required() && Array.isArray(value) && value.length === 0) {
1362
+ // why: bản sao mới (không phải cùng mảng) để sd-select nhận lại model và bỏ phần bỏ chọn nó đang hiện.
1363
+ const previous = this.editingValue();
1364
+ this.editingValue.set(Array.isArray(previous) ? [...previous] : previous);
1365
+ this.minOneHint.set(true);
1366
+ return;
1367
+ }
1368
+ this.minOneHint.set(false);
707
1369
  this.editingValue.set(value);
708
1370
  }
709
1371
  /** BETWEEN range — mutate only `.from`. */
@@ -731,21 +1393,30 @@ class SdQueryChipPopover {
731
1393
  return Array.isArray(v) && v.includes(value);
732
1394
  }
733
1395
  // ---------------------------------------------------------------------------
734
- // Menu lifecycle — close = commit
1396
+ // Panel lifecycle — close = commit
735
1397
  // ---------------------------------------------------------------------------
736
1398
  /**
737
- * mat-menu's (closed) handler — compose the next Filter from staging signals and
738
- * emit (commit). Parent splices into its filters[] and nulls editingIndex.
1399
+ * The panel closed (Esc, click outside, Tab out, `closeMenu()`, another panel opened): compose the next Filter from
1400
+ * staging signals and emit (commit). Parent splices into its filters[] and nulls editingIndex.
739
1401
  */
740
- onMenuClosed() {
741
- const f = this.filter();
1402
+ onMenuClosed(_reason) {
1403
+ const f = this.#seededFilter() ?? this.filter();
1404
+ const field = this.#seededField() ?? this.field();
1405
+ this.#seededField.set(undefined);
1406
+ this.#seededFilter.set(undefined);
1407
+ this.#seededIndex.set(null);
1408
+ this.minOneHint.set(false);
742
1409
  if (!f)
743
1410
  return;
744
- const next = {
1411
+ let next = {
745
1412
  field: f.field,
746
1413
  operator: this.editingOperator(),
747
1414
  data: this.editingValue(),
748
1415
  };
1416
+ // B3: a required chip that had a value and was emptied gets that value (and operator) back.
1417
+ if (field?.required && ɵsdQueryFilterActive(f) && !ɵsdQueryFilterActive(next)) {
1418
+ next = { field: f.field, operator: f.operator, data: f.data };
1419
+ }
749
1420
  this.commit.emit(next);
750
1421
  }
751
1422
  // ---------------------------------------------------------------------------
@@ -791,16 +1462,15 @@ class SdQueryChipPopover {
791
1462
  }
792
1463
  }
793
1464
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQueryChipPopover, deps: [], target: i0.ɵɵFactoryTarget.Component });
794
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdQueryChipPopover, isStandalone: true, selector: "sd-query-chip-popover", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, chipIndex: { classPropertyName: "chipIndex", publicName: "chipIndex", isSignal: true, isRequired: false, transformFunction: null }, autoIdBase: { classPropertyName: "autoIdBase", publicName: "autoIdBase", isSignal: true, isRequired: false, transformFunction: null }, switchPickerMenu: { classPropertyName: "switchPickerMenu", publicName: "switchPickerMenu", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { commit: "commit", swapField: "swapField" }, viewQueries: [{ propertyName: "menu", first: true, predicate: ["menu"], descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n Chip popover \u2014 operator + value editor for the popover-mode chip.\n Visual layout mirrors the previous inline `<mat-menu #chipPopover>` in query-bar.\n Body branches on operator + field.type \u2014 8 paths preserved exactly.\n-->\n<mat-menu #menu=\"matMenu\" class=\"c-chip-popover\" xPosition=\"after\" yPosition=\"below\" (closed)=\"onMenuClosed()\">\n <ng-template matMenuContent>\n @let _field = field();\n @let _editingOperator = editingOperator();\n @let _editingValue = editingValue();\n @let _editingOptions = editingOptions();\n @let _editingOptionsLoading = editingOptionsLoading();\n @let _switchPickerMenu = switchPickerMenu();\n\n @if (_field) {\n <!-- why: header/body c\u1EE7a popover l\u00E0 NH\u00D3M control (role=\"group\"), kh\u00F4ng ph\u1EA3i n\u00FAt \u2014 n\u00EAn ch\u00FAng\n KH\u00D4NG \u0111\u01B0\u1EE3c nh\u1EADn tabindex; tab ph\u1EA3i \u0111i th\u1EB3ng v\u00E0o c\u00E1c control b\u00EAn trong. Th\u00EAm ch\u1EB7n Enter\n b\u00EAn c\u1EA1nh ch\u1EB7n click: c\u1EA3 hai ch\u1EC9 \u0111\u1EC3 mat-menu kh\u00F4ng t\u1EF1 \u0111\u00F3ng khi ng\u01B0\u1EDDi d\u00F9ng thao t\u00E1c trong\n popover; Escape v\u00E0 ph\u00EDm m\u0169i t\u00EAn v\u1EABn b\u1ECDt l\u00EAn \u0111\u1EC3 menu \u0111\u00F3ng/\u0111i\u1EC1u h\u01B0\u1EDBng b\u00ECnh th\u01B0\u1EDDng. -->\n <div class=\"c-pop-header\" role=\"group\" (click)=\"$event.stopPropagation()\" (keydown.enter)=\"$event.stopPropagation()\">\n <sd-icon [name]=\"iconFor(_field)\"></sd-icon>\n <!-- why: nested mat-menu trigger to swap the chip's field \u2014 parent provides\n the field-picker MatMenu via [switchPickerMenu]. -->\n @if (_switchPickerMenu) {\n <button\n type=\"button\"\n class=\"c-pop-header-field\"\n [matMenuTriggerFor]=\"_switchPickerMenu\"\n [matTooltip]=\"swapFieldTooltip()\">\n <span>{{ _field.label }}</span>\n <sd-icon name=\"unfold_more\"></sd-icon>\n </button>\n } @else {\n <span class=\"c-pop-header-field\">{{ _field.label }}</span>\n }\n <!-- Operator selector (right-aligned). Disabled when field has \u22641 operator. -->\n <sd-operator\n class=\"c-pop-header-operator\"\n size=\"sm\"\n [autoId]=\"chipAutoId('operator')\"\n [operators]=\"allowedOperators()\"\n [model]=\"_editingOperator\"\n [disabled]=\"!showOperatorSelector()\"\n (modelChange)=\"onEditingOperatorChange($any($event))\" />\n </div>\n\n <div class=\"c-pop-body\" role=\"group\" (click)=\"$event.stopPropagation()\" (keydown.enter)=\"$event.stopPropagation()\">\n @if (!isNoDataOperator(_editingOperator)) {\n @if (_editingOperator === 'BETWEEN') {\n @if (_field.type === 'date') {\n <div class=\"c-pop-between\">\n <sd-date size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-from')\"\n [placeholder]=\"fromPlaceholder()\"\n [model]=\"$any(_editingValue)?.from\"\n (sdChange)=\"onEditingRangeFrom($event)\">\n </sd-date>\n <sd-date size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-to')\"\n [placeholder]=\"toPlaceholder()\"\n [model]=\"$any(_editingValue)?.to\"\n (sdChange)=\"onEditingRangeTo($event)\">\n </sd-date>\n </div>\n } @else if (_field.type === 'datetime') {\n <div class=\"c-pop-between\">\n <sd-datetime size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-from')\"\n [placeholder]=\"fromPlaceholder()\"\n [model]=\"$any(_editingValue)?.from\"\n (sdChange)=\"onEditingRangeFrom($event)\">\n </sd-datetime>\n <sd-datetime size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-to')\"\n [placeholder]=\"toPlaceholder()\"\n [model]=\"$any(_editingValue)?.to\"\n (sdChange)=\"onEditingRangeTo($event)\">\n </sd-datetime>\n </div>\n } @else {\n <div class=\"c-pop-between\">\n <sd-input-number size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-from')\"\n [placeholder]=\"fromPlaceholder()\"\n [model]=\"$any(_editingValue)?.from\"\n (sdChange)=\"onEditingRangeFrom($event)\">\n </sd-input-number>\n <sd-input-number size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-to')\"\n [placeholder]=\"toPlaceholder()\"\n [model]=\"$any(_editingValue)?.to\"\n (sdChange)=\"onEditingRangeTo($event)\">\n </sd-input-number>\n </div>\n }\n } @else if (_field.type === 'boolean') {\n <div class=\"c-pop-boolean c-bool-toggle\">\n <sd-button\n [autoId]=\"chipAutoId('value-true')\"\n [type]=\"_editingValue === true ? 'fill' : 'outline'\"\n color=\"success\"\n [title]=\"$any(_field).trueLabel || booleanTrueLabel()\"\n (click)=\"onEditingValueInput(true)\">\n </sd-button>\n <sd-button\n [autoId]=\"chipAutoId('value-false')\"\n [type]=\"_editingValue === false ? 'fill' : 'outline'\"\n color=\"warning\"\n [title]=\"$any(_field).falseLabel || booleanFalseLabel()\"\n (click)=\"onEditingValueInput(false)\">\n </sd-button>\n </div>\n } @else if (_field.type === 'values' || _field.type === 'lazy-values') {\n @let _opt = $any(_field).option;\n <sd-select size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"selectValuePlaceholder()\"\n [items]=\"_editingOptions\"\n [valueField]=\"_opt.valueField\"\n [displayField]=\"_opt.displayField\"\n [multiple]=\"multiple()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-select>\n @if (_editingOptionsLoading) {\n <div class=\"c-pop-values-loading\">{{ loadingValuesLabel() }}</div>\n }\n } @else if (_field.type === 'date') {\n <sd-date size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"selectValuePlaceholder()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-date>\n } @else if (_field.type === 'datetime') {\n <sd-datetime size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"selectValuePlaceholder()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-datetime>\n } @else if (_field.type === 'number') {\n <sd-input-number size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"enterValuePlaceholder()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-input-number>\n } @else {\n <sd-input size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"enterValuePlaceholder()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-input>\n }\n }\n </div>\n }\n </ng-template>\n</mat-menu>\n", styles: [":host{display:contents}::ng-deep .mat-mdc-menu-panel.c-chip-popover{min-width:280px;max-width:320px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--sd-query-bar-border-soft, #e2e4e7);font-size:var(--sd-font-size-13, 13px);font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-query-bar-text, #212121)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header>sd-icon{font-size:var(--sd-font-size-16, 16px);width:16px;height:16px;color:var(--sd-primary)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header .c-pop-header-operator{margin-left:auto}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header-field{display:inline-flex;align-items:center;gap:4px;padding:2px 4px 2px 6px;margin-left:-4px;background:transparent;border:1px solid transparent;border-radius:var(--sd-radius-4, 4px);font:inherit;font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-query-bar-text, #212121);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease,border-color var(--sd-duration-fast, .12s) ease}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header-field sd-icon{font-size:var(--sd-font-size-14, 14px)!important;width:14px!important;height:14px!important;color:var(--sd-query-bar-text-muted, #7a7a7a)!important}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header-field:hover{background:var(--sd-query-bar-bg-soft, #f5f6f7);border-color:var(--sd-query-bar-border-soft, #e2e4e7)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-body{padding:10px 12px;display:flex;flex-direction:column;gap:12px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-between{display:grid;grid-template-columns:1fr 1fr;gap:8px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-boolean{display:flex;gap:8px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-boolean button{flex:1;height:32px;border:1px solid var(--sd-query-bar-border, #d6d8db);border-radius:6px;background:var(--sd-query-bar-bg, #ffffff);font:inherit;font-size:var(--sd-font-size-13, 13px);cursor:pointer}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-values-loading{padding:10px 8px;font-size:var(--sd-font-size-12, 12px);color:var(--sd-query-bar-text-muted, #7a7a7a)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-bool-toggle{display:inline-flex;align-items:center;gap:4px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-bool-toggle .mdc-button,::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-bool-toggle button[mat-button],::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-bool-toggle button[mat-stroked-button],::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-bool-toggle button[mat-flat-button]{border-radius:var(--sd-radius-999, 999px);min-width:0;padding:0 12px}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i1.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "directive", type: i1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: SdOperator, selector: "sd-operator", inputs: ["model", "operators", "disabled", "autoId", "size", "readonly", "active", "showCode"], outputs: ["modelChange"] }, { kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "virtualScroll", "itemSize", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "items", "model"], outputs: ["operatorChange", "sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "labelPlacement", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "type", "mask", "inputmode", "autocomplete", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdInputNumber, selector: "sd-input-number", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "type", "precision", "format", "min", "max", "validator", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "inputmode", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdDate, selector: "sd-date", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus"] }, { kind: "component", type: SdDatetime, selector: "sd-datetime", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "showSeconds", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["modelChange", "sdChange", "sdFocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1465
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdQueryChipPopover, isStandalone: true, selector: "sd-query-chip-popover", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, chipIndex: { classPropertyName: "chipIndex", publicName: "chipIndex", isSignal: true, isRequired: false, transformFunction: null }, autoIdBase: { classPropertyName: "autoIdBase", publicName: "autoIdBase", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { commit: "commit" }, viewQueries: [{ propertyName: "panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n Chip popover \u2014 operator + value editor for the popover-mode chip.\n Dialog panel theo khung Action Popover (handoff m\u1EE5c 4); header, th\u00E2n, \u0111\u1ED9 r\u1ED9ng gi\u1EEF nh\u01B0 b\u1EA3n tr\u01B0\u1EDBc.\n Body branches on operator + field.type \u2014 8 paths preserved exactly.\n-->\n<ng-template sdQueryPanel=\"dialog\" #panel=\"sdQueryPanel\" (closed)=\"onMenuClosed($event)\">\n @let _field = currentField();\n @let _editingOperator = editingOperator();\n @let _editingValue = editingValue();\n @let _editingOptions = editingOptions();\n @let _editingOptionsLoading = editingOptionsLoading();\n\n <div\n class=\"sd-query-panel sd-query-panel--form c-chip-popover\"\n role=\"dialog\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"labelId\"\n [attr.data-autoid]=\"autoIdBase() ? autoIdBase() + '-panel-chip' : null\">\n @if (_field) {\n <!-- why: header/body c\u1EE7a popover l\u00E0 NH\u00D3M control (role=\"group\"), kh\u00F4ng ph\u1EA3i n\u00FAt \u2014 n\u00EAn ch\u00FAng KH\u00D4NG \u0111\u01B0\u1EE3c nh\u1EADn tabindex;\n tab \u0111i th\u1EB3ng v\u00E0o c\u00E1c control b\u00EAn trong. B\u1ECF ch\u1EB7n click / Enter c\u1EE7a b\u1EA3n tr\u01B0\u1EDBc: panel kh\u00F4ng t\u1EF1 \u0111\u00F3ng khi b\u1EA5m b\u00EAn\n trong, n\u00EAn kh\u00F4ng c\u00F2n g\u00EC ph\u1EA3i ch\u1EB7n. -->\n <div class=\"c-pop-header\" role=\"group\">\n <sd-icon [name]=\"iconFor(_field)\" aria-hidden=\"true\"></sd-icon>\n <!-- why: \u0111\u1ED5i field trong chip \u0111\u00E3 b\u1ECF (handoff M7) \u2014 nh\u00E3n t\u0129nh, l\u00E0 t\u00EAn c\u1EE7a dialog. -->\n <span class=\"c-pop-header-field\" [id]=\"labelId\">{{ _field.label }}</span>\n <!-- Operator selector (right-aligned). Disabled when field has \u22641 operator. -->\n <sd-operator\n class=\"c-pop-header-operator\"\n size=\"sm\"\n [autoId]=\"chipAutoId('operator')\"\n [operators]=\"allowedOperators()\"\n [model]=\"_editingOperator\"\n [disabled]=\"!showOperatorSelector()\"\n (modelChange)=\"onEditingOperatorChange($any($event))\" />\n </div>\n\n <div class=\"c-pop-body\" role=\"group\" data-sd-query-panel-initial [attr.aria-describedby]=\"minOneHint() ? hintId : null\">\n @if (!isNoDataOperator(_editingOperator)) {\n @if (_editingOperator === 'BETWEEN') {\n @if (_field.type === 'date') {\n <div class=\"c-pop-between\">\n <sd-date size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-from')\"\n [placeholder]=\"fromPlaceholder()\"\n [model]=\"$any(_editingValue)?.from\"\n (sdChange)=\"onEditingRangeFrom($event)\">\n </sd-date>\n <sd-date size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-to')\"\n [placeholder]=\"toPlaceholder()\"\n [model]=\"$any(_editingValue)?.to\"\n (sdChange)=\"onEditingRangeTo($event)\">\n </sd-date>\n </div>\n } @else if (_field.type === 'datetime') {\n <div class=\"c-pop-between\">\n <sd-datetime size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-from')\"\n [placeholder]=\"fromPlaceholder()\"\n [model]=\"$any(_editingValue)?.from\"\n (sdChange)=\"onEditingRangeFrom($event)\">\n </sd-datetime>\n <sd-datetime size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-to')\"\n [placeholder]=\"toPlaceholder()\"\n [model]=\"$any(_editingValue)?.to\"\n (sdChange)=\"onEditingRangeTo($event)\">\n </sd-datetime>\n </div>\n } @else {\n <div class=\"c-pop-between\">\n <sd-input-number size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-from')\"\n [placeholder]=\"fromPlaceholder()\"\n [model]=\"$any(_editingValue)?.from\"\n (sdChange)=\"onEditingRangeFrom($event)\">\n </sd-input-number>\n <sd-input-number size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-to')\"\n [placeholder]=\"toPlaceholder()\"\n [model]=\"$any(_editingValue)?.to\"\n (sdChange)=\"onEditingRangeTo($event)\">\n </sd-input-number>\n </div>\n }\n } @else if (_field.type === 'boolean') {\n <div class=\"c-pop-boolean c-bool-toggle\">\n <sd-button\n [autoId]=\"chipAutoId('value-true')\"\n [type]=\"_editingValue === true ? 'fill' : 'outline'\"\n color=\"success\"\n [title]=\"$any(_field).trueLabel || booleanTrueLabel()\"\n (click)=\"onEditingValueInput(true)\">\n </sd-button>\n <sd-button\n [autoId]=\"chipAutoId('value-false')\"\n [type]=\"_editingValue === false ? 'fill' : 'outline'\"\n color=\"warning\"\n [title]=\"$any(_field).falseLabel || booleanFalseLabel()\"\n (click)=\"onEditingValueInput(false)\">\n </sd-button>\n </div>\n } @else if (_field.type === 'values' || _field.type === 'lazy-values') {\n @let _opt = $any(_field).option;\n <sd-select size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"selectValuePlaceholder()\"\n [items]=\"_editingOptions\"\n [valueField]=\"_opt.valueField\"\n [displayField]=\"_opt.displayField\"\n [multiple]=\"multiple()\"\n [required]=\"required()\"\n [clearable]=\"!required()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-select>\n @if (minOneHint()) {\n <div class=\"c-pop-required-hint\" aria-live=\"polite\" [id]=\"hintId\">{{ minOneLabel() }}</div>\n }\n @if (_editingOptionsLoading) {\n <div class=\"c-pop-values-loading\">{{ loadingValuesLabel() }}</div>\n }\n } @else if (_field.type === 'date') {\n <sd-date size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"selectValuePlaceholder()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-date>\n } @else if (_field.type === 'datetime') {\n <sd-datetime size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"selectValuePlaceholder()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-datetime>\n } @else if (_field.type === 'number') {\n <sd-input-number size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"enterValuePlaceholder()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-input-number>\n } @else {\n <sd-input size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"enterValuePlaceholder()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-input>\n }\n }\n </div>\n }\n </div>\n</ng-template>\n", styles: [":host{display:contents}.c-chip-popover{box-sizing:border-box;min-width:min(160px,100vw - 16px);max-height:min(360px,100dvh - 16px);overflow:auto;border:1px solid var(--sd-border, #dde0e5);border-radius:var(--sd-radius-8, 8px);background:var(--sd-surface, var(--sd-white, #fff));color:var(--sd-text, #1a1b1f);box-shadow:0 4px 12px #0f172a24,0 1px 3px #0f172a1a;overflow:hidden;display:flex;flex-direction:column;min-width:min(280px,100vw - 16px);max-width:min(320px,100vw - 16px)}.c-chip-popover:focus{outline:none}.c-chip-popover ::ng-deep .mat-mdc-form-field .mat-mdc-select-arrow,.c-chip-popover ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-icon-suffix sd-icon{color:var(--sd-query-bar-text-secondary, #5f6368)}.c-chip-popover ::ng-deep .mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--sd-primary)}.c-pop-header{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--sd-query-bar-border-soft, #e2e4e7);font-size:var(--sd-font-size-13, 13px);font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-query-bar-text, #212121)}.c-pop-header>sd-icon{font-size:var(--sd-font-size-16, 16px);width:16px;height:16px;color:var(--sd-primary)}.c-pop-header .c-pop-header-operator{margin-left:auto}.c-pop-header-field{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-pop-body{padding:10px 12px;display:flex;flex-direction:column;gap:12px;min-height:0;overflow-y:auto}.c-pop-between{display:grid;grid-template-columns:1fr 1fr;gap:8px}.c-pop-boolean{display:flex;gap:8px}.c-pop-boolean ::ng-deep button{flex:1;height:32px;border:1px solid var(--sd-query-bar-border, #d6d8db);border-radius:6px;background:var(--sd-query-bar-bg, #ffffff);font:inherit;font-size:var(--sd-font-size-13, 13px);cursor:pointer}.c-pop-required-hint{margin-top:-8px;font-size:var(--sd-font-size-12, 12px);color:var(--sd-text-secondary, #555)}.c-pop-values-loading{padding:10px 8px;font-size:var(--sd-font-size-12, 12px);color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-bool-toggle{display:inline-flex;align-items:center;gap:4px}.c-bool-toggle ::ng-deep .mdc-button,.c-bool-toggle ::ng-deep button[mat-button],.c-bool-toggle ::ng-deep button[mat-stroked-button],.c-bool-toggle ::ng-deep button[mat-flat-button]{border-radius:var(--sd-radius-999, 999px);min-width:0;padding:0 12px}\n"], dependencies: [{ kind: "directive", type: ɵSdQueryPanelDirective, selector: "ng-template[sdQueryPanel]", inputs: ["sdQueryPanel", "sdQueryPanelAlign", "sdQueryPanelControls"], outputs: ["opened", "closed"], exportAs: ["sdQueryPanel"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: SdOperator, selector: "sd-operator", inputs: ["model", "operators", "disabled", "autoId", "size", "readonly", "active", "showCode"], outputs: ["modelChange"] }, { kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "virtualScroll", "itemSize", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "items", "model"], outputs: ["operatorChange", "sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "labelPlacement", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "type", "mask", "inputmode", "autocomplete", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdInputNumber, selector: "sd-input-number", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "type", "precision", "format", "min", "max", "validator", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "inputmode", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdDate, selector: "sd-date", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus"] }, { kind: "component", type: SdDatetime, selector: "sd-datetime", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "showSeconds", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["modelChange", "sdChange", "sdFocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
795
1466
  }
796
1467
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQueryChipPopover, decorators: [{
797
1468
  type: Component,
798
1469
  args: [{ selector: 'sd-query-chip-popover', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1470
+ ɵSdQueryPanelDirective,
799
1471
  SdIcon,
800
1472
  CommonModule,
801
1473
  FormsModule,
802
- MatMenuModule,
803
- MatTooltipModule,
804
1474
  SdButton,
805
1475
  SdOperator,
806
1476
  SdSelect,
@@ -808,51 +1478,59 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
808
1478
  SdInputNumber,
809
1479
  SdDate,
810
1480
  SdDatetime,
811
- ], template: "<!--\n Chip popover \u2014 operator + value editor for the popover-mode chip.\n Visual layout mirrors the previous inline `<mat-menu #chipPopover>` in query-bar.\n Body branches on operator + field.type \u2014 8 paths preserved exactly.\n-->\n<mat-menu #menu=\"matMenu\" class=\"c-chip-popover\" xPosition=\"after\" yPosition=\"below\" (closed)=\"onMenuClosed()\">\n <ng-template matMenuContent>\n @let _field = field();\n @let _editingOperator = editingOperator();\n @let _editingValue = editingValue();\n @let _editingOptions = editingOptions();\n @let _editingOptionsLoading = editingOptionsLoading();\n @let _switchPickerMenu = switchPickerMenu();\n\n @if (_field) {\n <!-- why: header/body c\u1EE7a popover l\u00E0 NH\u00D3M control (role=\"group\"), kh\u00F4ng ph\u1EA3i n\u00FAt \u2014 n\u00EAn ch\u00FAng\n KH\u00D4NG \u0111\u01B0\u1EE3c nh\u1EADn tabindex; tab ph\u1EA3i \u0111i th\u1EB3ng v\u00E0o c\u00E1c control b\u00EAn trong. Th\u00EAm ch\u1EB7n Enter\n b\u00EAn c\u1EA1nh ch\u1EB7n click: c\u1EA3 hai ch\u1EC9 \u0111\u1EC3 mat-menu kh\u00F4ng t\u1EF1 \u0111\u00F3ng khi ng\u01B0\u1EDDi d\u00F9ng thao t\u00E1c trong\n popover; Escape v\u00E0 ph\u00EDm m\u0169i t\u00EAn v\u1EABn b\u1ECDt l\u00EAn \u0111\u1EC3 menu \u0111\u00F3ng/\u0111i\u1EC1u h\u01B0\u1EDBng b\u00ECnh th\u01B0\u1EDDng. -->\n <div class=\"c-pop-header\" role=\"group\" (click)=\"$event.stopPropagation()\" (keydown.enter)=\"$event.stopPropagation()\">\n <sd-icon [name]=\"iconFor(_field)\"></sd-icon>\n <!-- why: nested mat-menu trigger to swap the chip's field \u2014 parent provides\n the field-picker MatMenu via [switchPickerMenu]. -->\n @if (_switchPickerMenu) {\n <button\n type=\"button\"\n class=\"c-pop-header-field\"\n [matMenuTriggerFor]=\"_switchPickerMenu\"\n [matTooltip]=\"swapFieldTooltip()\">\n <span>{{ _field.label }}</span>\n <sd-icon name=\"unfold_more\"></sd-icon>\n </button>\n } @else {\n <span class=\"c-pop-header-field\">{{ _field.label }}</span>\n }\n <!-- Operator selector (right-aligned). Disabled when field has \u22641 operator. -->\n <sd-operator\n class=\"c-pop-header-operator\"\n size=\"sm\"\n [autoId]=\"chipAutoId('operator')\"\n [operators]=\"allowedOperators()\"\n [model]=\"_editingOperator\"\n [disabled]=\"!showOperatorSelector()\"\n (modelChange)=\"onEditingOperatorChange($any($event))\" />\n </div>\n\n <div class=\"c-pop-body\" role=\"group\" (click)=\"$event.stopPropagation()\" (keydown.enter)=\"$event.stopPropagation()\">\n @if (!isNoDataOperator(_editingOperator)) {\n @if (_editingOperator === 'BETWEEN') {\n @if (_field.type === 'date') {\n <div class=\"c-pop-between\">\n <sd-date size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-from')\"\n [placeholder]=\"fromPlaceholder()\"\n [model]=\"$any(_editingValue)?.from\"\n (sdChange)=\"onEditingRangeFrom($event)\">\n </sd-date>\n <sd-date size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-to')\"\n [placeholder]=\"toPlaceholder()\"\n [model]=\"$any(_editingValue)?.to\"\n (sdChange)=\"onEditingRangeTo($event)\">\n </sd-date>\n </div>\n } @else if (_field.type === 'datetime') {\n <div class=\"c-pop-between\">\n <sd-datetime size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-from')\"\n [placeholder]=\"fromPlaceholder()\"\n [model]=\"$any(_editingValue)?.from\"\n (sdChange)=\"onEditingRangeFrom($event)\">\n </sd-datetime>\n <sd-datetime size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-to')\"\n [placeholder]=\"toPlaceholder()\"\n [model]=\"$any(_editingValue)?.to\"\n (sdChange)=\"onEditingRangeTo($event)\">\n </sd-datetime>\n </div>\n } @else {\n <div class=\"c-pop-between\">\n <sd-input-number size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-from')\"\n [placeholder]=\"fromPlaceholder()\"\n [model]=\"$any(_editingValue)?.from\"\n (sdChange)=\"onEditingRangeFrom($event)\">\n </sd-input-number>\n <sd-input-number size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-to')\"\n [placeholder]=\"toPlaceholder()\"\n [model]=\"$any(_editingValue)?.to\"\n (sdChange)=\"onEditingRangeTo($event)\">\n </sd-input-number>\n </div>\n }\n } @else if (_field.type === 'boolean') {\n <div class=\"c-pop-boolean c-bool-toggle\">\n <sd-button\n [autoId]=\"chipAutoId('value-true')\"\n [type]=\"_editingValue === true ? 'fill' : 'outline'\"\n color=\"success\"\n [title]=\"$any(_field).trueLabel || booleanTrueLabel()\"\n (click)=\"onEditingValueInput(true)\">\n </sd-button>\n <sd-button\n [autoId]=\"chipAutoId('value-false')\"\n [type]=\"_editingValue === false ? 'fill' : 'outline'\"\n color=\"warning\"\n [title]=\"$any(_field).falseLabel || booleanFalseLabel()\"\n (click)=\"onEditingValueInput(false)\">\n </sd-button>\n </div>\n } @else if (_field.type === 'values' || _field.type === 'lazy-values') {\n @let _opt = $any(_field).option;\n <sd-select size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"selectValuePlaceholder()\"\n [items]=\"_editingOptions\"\n [valueField]=\"_opt.valueField\"\n [displayField]=\"_opt.displayField\"\n [multiple]=\"multiple()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-select>\n @if (_editingOptionsLoading) {\n <div class=\"c-pop-values-loading\">{{ loadingValuesLabel() }}</div>\n }\n } @else if (_field.type === 'date') {\n <sd-date size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"selectValuePlaceholder()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-date>\n } @else if (_field.type === 'datetime') {\n <sd-datetime size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"selectValuePlaceholder()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-datetime>\n } @else if (_field.type === 'number') {\n <sd-input-number size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"enterValuePlaceholder()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-input-number>\n } @else {\n <sd-input size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"enterValuePlaceholder()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-input>\n }\n }\n </div>\n }\n </ng-template>\n</mat-menu>\n", styles: [":host{display:contents}::ng-deep .mat-mdc-menu-panel.c-chip-popover{min-width:280px;max-width:320px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--sd-query-bar-border-soft, #e2e4e7);font-size:var(--sd-font-size-13, 13px);font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-query-bar-text, #212121)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header>sd-icon{font-size:var(--sd-font-size-16, 16px);width:16px;height:16px;color:var(--sd-primary)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header .c-pop-header-operator{margin-left:auto}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header-field{display:inline-flex;align-items:center;gap:4px;padding:2px 4px 2px 6px;margin-left:-4px;background:transparent;border:1px solid transparent;border-radius:var(--sd-radius-4, 4px);font:inherit;font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-query-bar-text, #212121);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease,border-color var(--sd-duration-fast, .12s) ease}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header-field sd-icon{font-size:var(--sd-font-size-14, 14px)!important;width:14px!important;height:14px!important;color:var(--sd-query-bar-text-muted, #7a7a7a)!important}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header-field:hover{background:var(--sd-query-bar-bg-soft, #f5f6f7);border-color:var(--sd-query-bar-border-soft, #e2e4e7)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-body{padding:10px 12px;display:flex;flex-direction:column;gap:12px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-between{display:grid;grid-template-columns:1fr 1fr;gap:8px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-boolean{display:flex;gap:8px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-boolean button{flex:1;height:32px;border:1px solid var(--sd-query-bar-border, #d6d8db);border-radius:6px;background:var(--sd-query-bar-bg, #ffffff);font:inherit;font-size:var(--sd-font-size-13, 13px);cursor:pointer}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-values-loading{padding:10px 8px;font-size:var(--sd-font-size-12, 12px);color:var(--sd-query-bar-text-muted, #7a7a7a)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-bool-toggle{display:inline-flex;align-items:center;gap:4px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-bool-toggle .mdc-button,::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-bool-toggle button[mat-button],::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-bool-toggle button[mat-stroked-button],::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-bool-toggle button[mat-flat-button]{border-radius:var(--sd-radius-999, 999px);min-width:0;padding:0 12px}\n"] }]
812
- }], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], chipIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "chipIndex", required: false }] }], autoIdBase: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoIdBase", required: false }] }], switchPickerMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "switchPickerMenu", required: false }] }], commit: [{ type: i0.Output, args: ["commit"] }], swapField: [{ type: i0.Output, args: ["swapField"] }], menu: [{ type: i0.ViewChild, args: ['menu', { isSignal: true }] }] } });
1481
+ ], template: "<!--\n Chip popover \u2014 operator + value editor for the popover-mode chip.\n Dialog panel theo khung Action Popover (handoff m\u1EE5c 4); header, th\u00E2n, \u0111\u1ED9 r\u1ED9ng gi\u1EEF nh\u01B0 b\u1EA3n tr\u01B0\u1EDBc.\n Body branches on operator + field.type \u2014 8 paths preserved exactly.\n-->\n<ng-template sdQueryPanel=\"dialog\" #panel=\"sdQueryPanel\" (closed)=\"onMenuClosed($event)\">\n @let _field = currentField();\n @let _editingOperator = editingOperator();\n @let _editingValue = editingValue();\n @let _editingOptions = editingOptions();\n @let _editingOptionsLoading = editingOptionsLoading();\n\n <div\n class=\"sd-query-panel sd-query-panel--form c-chip-popover\"\n role=\"dialog\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"labelId\"\n [attr.data-autoid]=\"autoIdBase() ? autoIdBase() + '-panel-chip' : null\">\n @if (_field) {\n <!-- why: header/body c\u1EE7a popover l\u00E0 NH\u00D3M control (role=\"group\"), kh\u00F4ng ph\u1EA3i n\u00FAt \u2014 n\u00EAn ch\u00FAng KH\u00D4NG \u0111\u01B0\u1EE3c nh\u1EADn tabindex;\n tab \u0111i th\u1EB3ng v\u00E0o c\u00E1c control b\u00EAn trong. B\u1ECF ch\u1EB7n click / Enter c\u1EE7a b\u1EA3n tr\u01B0\u1EDBc: panel kh\u00F4ng t\u1EF1 \u0111\u00F3ng khi b\u1EA5m b\u00EAn\n trong, n\u00EAn kh\u00F4ng c\u00F2n g\u00EC ph\u1EA3i ch\u1EB7n. -->\n <div class=\"c-pop-header\" role=\"group\">\n <sd-icon [name]=\"iconFor(_field)\" aria-hidden=\"true\"></sd-icon>\n <!-- why: \u0111\u1ED5i field trong chip \u0111\u00E3 b\u1ECF (handoff M7) \u2014 nh\u00E3n t\u0129nh, l\u00E0 t\u00EAn c\u1EE7a dialog. -->\n <span class=\"c-pop-header-field\" [id]=\"labelId\">{{ _field.label }}</span>\n <!-- Operator selector (right-aligned). Disabled when field has \u22641 operator. -->\n <sd-operator\n class=\"c-pop-header-operator\"\n size=\"sm\"\n [autoId]=\"chipAutoId('operator')\"\n [operators]=\"allowedOperators()\"\n [model]=\"_editingOperator\"\n [disabled]=\"!showOperatorSelector()\"\n (modelChange)=\"onEditingOperatorChange($any($event))\" />\n </div>\n\n <div class=\"c-pop-body\" role=\"group\" data-sd-query-panel-initial [attr.aria-describedby]=\"minOneHint() ? hintId : null\">\n @if (!isNoDataOperator(_editingOperator)) {\n @if (_editingOperator === 'BETWEEN') {\n @if (_field.type === 'date') {\n <div class=\"c-pop-between\">\n <sd-date size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-from')\"\n [placeholder]=\"fromPlaceholder()\"\n [model]=\"$any(_editingValue)?.from\"\n (sdChange)=\"onEditingRangeFrom($event)\">\n </sd-date>\n <sd-date size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-to')\"\n [placeholder]=\"toPlaceholder()\"\n [model]=\"$any(_editingValue)?.to\"\n (sdChange)=\"onEditingRangeTo($event)\">\n </sd-date>\n </div>\n } @else if (_field.type === 'datetime') {\n <div class=\"c-pop-between\">\n <sd-datetime size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-from')\"\n [placeholder]=\"fromPlaceholder()\"\n [model]=\"$any(_editingValue)?.from\"\n (sdChange)=\"onEditingRangeFrom($event)\">\n </sd-datetime>\n <sd-datetime size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-to')\"\n [placeholder]=\"toPlaceholder()\"\n [model]=\"$any(_editingValue)?.to\"\n (sdChange)=\"onEditingRangeTo($event)\">\n </sd-datetime>\n </div>\n } @else {\n <div class=\"c-pop-between\">\n <sd-input-number size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-from')\"\n [placeholder]=\"fromPlaceholder()\"\n [model]=\"$any(_editingValue)?.from\"\n (sdChange)=\"onEditingRangeFrom($event)\">\n </sd-input-number>\n <sd-input-number size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value-to')\"\n [placeholder]=\"toPlaceholder()\"\n [model]=\"$any(_editingValue)?.to\"\n (sdChange)=\"onEditingRangeTo($event)\">\n </sd-input-number>\n </div>\n }\n } @else if (_field.type === 'boolean') {\n <div class=\"c-pop-boolean c-bool-toggle\">\n <sd-button\n [autoId]=\"chipAutoId('value-true')\"\n [type]=\"_editingValue === true ? 'fill' : 'outline'\"\n color=\"success\"\n [title]=\"$any(_field).trueLabel || booleanTrueLabel()\"\n (click)=\"onEditingValueInput(true)\">\n </sd-button>\n <sd-button\n [autoId]=\"chipAutoId('value-false')\"\n [type]=\"_editingValue === false ? 'fill' : 'outline'\"\n color=\"warning\"\n [title]=\"$any(_field).falseLabel || booleanFalseLabel()\"\n (click)=\"onEditingValueInput(false)\">\n </sd-button>\n </div>\n } @else if (_field.type === 'values' || _field.type === 'lazy-values') {\n @let _opt = $any(_field).option;\n <sd-select size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"selectValuePlaceholder()\"\n [items]=\"_editingOptions\"\n [valueField]=\"_opt.valueField\"\n [displayField]=\"_opt.displayField\"\n [multiple]=\"multiple()\"\n [required]=\"required()\"\n [clearable]=\"!required()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-select>\n @if (minOneHint()) {\n <div class=\"c-pop-required-hint\" aria-live=\"polite\" [id]=\"hintId\">{{ minOneLabel() }}</div>\n }\n @if (_editingOptionsLoading) {\n <div class=\"c-pop-values-loading\">{{ loadingValuesLabel() }}</div>\n }\n } @else if (_field.type === 'date') {\n <sd-date size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"selectValuePlaceholder()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-date>\n } @else if (_field.type === 'datetime') {\n <sd-datetime size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"selectValuePlaceholder()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-datetime>\n } @else if (_field.type === 'number') {\n <sd-input-number size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"enterValuePlaceholder()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-input-number>\n } @else {\n <sd-input size=\"sm\" hideInlineError\n [autoId]=\"chipAutoId('value')\"\n [placeholder]=\"enterValuePlaceholder()\"\n [model]=\"$any(_editingValue)\"\n (sdChange)=\"onEditingValueInput($event)\">\n </sd-input>\n }\n }\n </div>\n }\n </div>\n</ng-template>\n", styles: [":host{display:contents}.c-chip-popover{box-sizing:border-box;min-width:min(160px,100vw - 16px);max-height:min(360px,100dvh - 16px);overflow:auto;border:1px solid var(--sd-border, #dde0e5);border-radius:var(--sd-radius-8, 8px);background:var(--sd-surface, var(--sd-white, #fff));color:var(--sd-text, #1a1b1f);box-shadow:0 4px 12px #0f172a24,0 1px 3px #0f172a1a;overflow:hidden;display:flex;flex-direction:column;min-width:min(280px,100vw - 16px);max-width:min(320px,100vw - 16px)}.c-chip-popover:focus{outline:none}.c-chip-popover ::ng-deep .mat-mdc-form-field .mat-mdc-select-arrow,.c-chip-popover ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-icon-suffix sd-icon{color:var(--sd-query-bar-text-secondary, #5f6368)}.c-chip-popover ::ng-deep .mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--sd-primary)}.c-pop-header{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--sd-query-bar-border-soft, #e2e4e7);font-size:var(--sd-font-size-13, 13px);font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-query-bar-text, #212121)}.c-pop-header>sd-icon{font-size:var(--sd-font-size-16, 16px);width:16px;height:16px;color:var(--sd-primary)}.c-pop-header .c-pop-header-operator{margin-left:auto}.c-pop-header-field{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-pop-body{padding:10px 12px;display:flex;flex-direction:column;gap:12px;min-height:0;overflow-y:auto}.c-pop-between{display:grid;grid-template-columns:1fr 1fr;gap:8px}.c-pop-boolean{display:flex;gap:8px}.c-pop-boolean ::ng-deep button{flex:1;height:32px;border:1px solid var(--sd-query-bar-border, #d6d8db);border-radius:6px;background:var(--sd-query-bar-bg, #ffffff);font:inherit;font-size:var(--sd-font-size-13, 13px);cursor:pointer}.c-pop-required-hint{margin-top:-8px;font-size:var(--sd-font-size-12, 12px);color:var(--sd-text-secondary, #555)}.c-pop-values-loading{padding:10px 8px;font-size:var(--sd-font-size-12, 12px);color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-bool-toggle{display:inline-flex;align-items:center;gap:4px}.c-bool-toggle ::ng-deep .mdc-button,.c-bool-toggle ::ng-deep button[mat-button],.c-bool-toggle ::ng-deep button[mat-stroked-button],.c-bool-toggle ::ng-deep button[mat-flat-button]{border-radius:var(--sd-radius-999, 999px);min-width:0;padding:0 12px}\n"] }]
1482
+ }], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], chipIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "chipIndex", required: false }] }], autoIdBase: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoIdBase", required: false }] }], commit: [{ type: i0.Output, args: ["commit"] }], panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }] } });
813
1483
 
814
- /** More fields than this get a find box at the top of the picker. */
815
- const FIND_THRESHOLD = 8;
816
- /** Keys the find box leaves to mat-menu: close, move into the list, leave the menu. */
817
- const MENU_KEYS = new Set(['Escape', 'ArrowDown', 'ArrowUp', 'Tab']);
1484
+ /** From this many fields the picker gets a find box at the top (PD after R1, G-2). */
1485
+ const FIND_MIN_FIELDS = 10;
1486
+ let nextListId = 0;
818
1487
  /**
819
- * Field picker mat-menu for `sd-query-bar`.
1488
+ * Field picker of `sd-query-bar`: a listbox panel (handoff section 3). The "+" button opens it with
1489
+ * `[sdQueryPanelTrigger]="picker.panel()"`; the chosen field comes back through `(pick)`. Fields in `[usedKeys]`
1490
+ * render disabled with a check.
820
1491
  *
821
- * Shared between two flows in the bar:
822
- * - "Add filter" — pass `[usedKeys]` (a Set of field keys already on the bar) so
823
- * those entries render disabled with a check.
824
- * - "Đổi field" inside the chip popover — pass `[currentKey]` to disable the
825
- * currently-bound field.
826
- *
827
- * Parent triggers via `[matMenuTriggerFor]="picker.menu()"` and receives the
828
- * chosen field through `(pick)`.
1492
+ * Keyboard: without a find box focus moves over the options (↑ ↓ Home End, Enter picks). With the find box focus stays
1493
+ * in it and the arrows move `aria-activedescendant` (combobox). No typeahead.
829
1494
  */
830
1495
  class SdQueryFieldPicker {
831
1496
  #i18n = inject(I18nService);
832
- #injector = inject(Injector);
833
1497
  emptyLabel = computed(() => this.#i18n.t('core.component.query-bar.field-empty'), ...(ngDevMode ? [{ debugName: "emptyLabel" }] : /* istanbul ignore next */ []));
834
1498
  findLabel = computed(() => this.#i18n.t('core.component.query-bar.find-field'), ...(ngDevMode ? [{ debugName: "findLabel" }] : /* istanbul ignore next */ []));
835
- /** Field list shown in the menu (caller-supplied; rendered in input order). */
1499
+ /**
1500
+ * Name of the listbox: the label of what opens it — the + button in popover mode, the Add condition box inline. The
1501
+ * find box label is a command ("Tìm kiếm"), not a name for the list.
1502
+ */
1503
+ listLabel = computed(() => this.#i18n.t(this.findBox() ? 'core.component.query-bar.add-filter' : 'core.component.query-bar.add-condition'), ...(ngDevMode ? [{ debugName: "listLabel" }] : /* istanbul ignore next */ []));
1504
+ /** Field list shown in the panel (caller-supplied; rendered in input order). */
836
1505
  fields = input([], ...(ngDevMode ? [{ debugName: "fields" }] : /* istanbul ignore next */ []));
837
- /** Single key disabled with a trailing check — used in the chip-popover "Đổi field" flow. */
838
- currentKey = input(undefined, ...(ngDevMode ? [{ debugName: "currentKey" }] : /* istanbul ignore next */ []));
839
- /** Set of keys already in use — used in the "Add filter" flow to grey out duplicates. */
1506
+ /** Set of keys already in use — those render disabled with a check. */
840
1507
  usedKeys = input(new Set(), ...(ngDevMode ? [{ debugName: "usedKeys" }] : /* istanbul ignore next */ []));
1508
+ /** Prefix of `data-autoid` (handoff section 12). */
1509
+ autoId = input(undefined, ...(ngDevMode ? [{ debugName: "autoId" }] : /* istanbul ignore next */ []));
1510
+ /**
1511
+ * `false`: no find box in the panel — an input outside (the inline "Add condition" combobox) types the filter through
1512
+ * `setQuery()` and moves the active option.
1513
+ */
1514
+ findBox = input(true, ...(ngDevMode ? [{ debugName: "findBox" }] : /* istanbul ignore next */ []));
841
1515
  /** Emits when the user picks an enabled field. */
842
1516
  pick = output();
843
- /** MatMenu instance — parent binds `[matMenuTriggerFor]="picker.menu()"`. */
844
- menu = viewChild.required(MatMenu);
1517
+ /** The panel closed. */
1518
+ closed = output();
1519
+ /** The panel — the trigger binds `[sdQueryPanelTrigger]="picker.panel()"`. */
1520
+ panel = viewChild.required('panel');
845
1521
  iconFor = sdQueryFieldIcon;
846
- // ---------------------------------------------------------------------------
847
- // Groups + find box (long field lists, e.g. sd-table "Bộ lọc" / "Cột")
848
- // ---------------------------------------------------------------------------
849
- /** Text typed in the find box; reset when the menu closes. */
1522
+ listId = `sd-query-field-list-${nextListId++}`;
1523
+ /** Text typed in the find box; reset when the panel closes. */
850
1524
  query = signal('', ...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
851
- /** Find box above more than eight fields. */
852
- searchable = computed(() => this.fields().length > FIND_THRESHOLD, ...(ngDevMode ? [{ debugName: "searchable" }] : /* istanbul ignore next */ []));
1525
+ /** Key of the option the arrows point at (`aria-activedescendant` / roving focus). */
1526
+ activeKey = signal(null, ...(ngDevMode ? [{ debugName: "activeKey" }] : /* istanbul ignore next */ []));
1527
+ /** Find box from ten fields (not when an outside input types the filter). */
1528
+ searchable = computed(() => this.findBox() && this.fields().length >= FIND_MIN_FIELDS, ...(ngDevMode ? [{ debugName: "searchable" }] : /* istanbul ignore next */ []));
1529
+ /** The list follows the typed text: with the find box, or with the outside combobox. */
1530
+ #filterable = computed(() => this.searchable() || !this.findBox(), ...(ngDevMode ? [{ debugName: "#filterable" }] : /* istanbul ignore next */ []));
853
1531
  /** Fields grouped by `field.group` in order of first appearance, filtered by the find box. */
854
1532
  groups = computed(() => {
855
- const term = this.searchable() ? sdNormalizeSearchText(this.query().trim()) : '';
1533
+ const term = this.#filterable() ? sdNormalizeSearchText(this.query().trim()) : '';
856
1534
  const groups = [];
857
1535
  const byLabel = new Map();
858
1536
  for (const field of this.fields()) {
@@ -861,7 +1539,7 @@ class SdQueryFieldPicker {
861
1539
  const label = field.group ?? '';
862
1540
  let group = byLabel.get(label);
863
1541
  if (!group) {
864
- group = { label, fields: [] };
1542
+ group = { label, headingId: `${this.listId}-group-${groups.length}`, fields: [] };
865
1543
  byLabel.set(label, group);
866
1544
  groups.push(group);
867
1545
  }
@@ -871,47 +1549,126 @@ class SdQueryFieldPicker {
871
1549
  }, ...(ngDevMode ? [{ debugName: "groups" }] : /* istanbul ignore next */ []));
872
1550
  /** One group needs no heading. Counted on the whole list so filtering does not hide headings. */
873
1551
  showGroupHeadings = computed(() => new Set(this.fields().map(field => field.group ?? '')).size > 1, ...(ngDevMode ? [{ debugName: "showGroupHeadings" }] : /* istanbul ignore next */ []));
874
- findInput = viewChild('findInput', ...(ngDevMode ? [{ debugName: "findInput" }] : /* istanbul ignore next */ []));
1552
+ /** Visible fields in order, with the id of their option element. */
1553
+ #visible = computed(() => {
1554
+ const ids = new Map();
1555
+ const list = this.groups().flatMap(group => group.fields);
1556
+ list.forEach((field, index) => ids.set(field.key, `${this.listId}-option-${index}`));
1557
+ return { list, ids };
1558
+ }, ...(ngDevMode ? [{ debugName: "#visible" }] : /* istanbul ignore next */ []));
1559
+ /** Id of the active option, for `aria-activedescendant`. */
1560
+ activeId = computed(() => {
1561
+ const key = this.activeKey();
1562
+ return key === null ? null : (this.#visible().ids.get(key) ?? null);
1563
+ }, ...(ngDevMode ? [{ debugName: "activeId" }] : /* istanbul ignore next */ []));
1564
+ optionId(field) {
1565
+ return this.#visible().ids.get(field.key) ?? '';
1566
+ }
1567
+ isDisabled(field) {
1568
+ return field.disabled === true || this.usedKeys().has(field.key);
1569
+ }
1570
+ /** "Used" check icon — when the field is in `usedKeys`. */
1571
+ isUsed(field) {
1572
+ return this.usedKeys().has(field.key);
1573
+ }
1574
+ /** Find box typed: filter, then point at the first enabled match (none while the box is empty). */
1575
+ setQuery(text) {
1576
+ this.query.set(text);
1577
+ this.activeKey.set(text.trim() ? (this.#enabled()[0]?.key ?? null) : null);
1578
+ }
875
1579
  /**
876
- * Called by the trigger's `(menuOpened)`: land in the find box. why: mat-menu focuses its first
877
- * item after rendering (afterNextRender), so the find box takes focus in a later render callback.
1580
+ * Moves the active option over the enabled ones, wrapping: `1` / `-1`, or `'first'` / `'last'`. With `focus`, the
1581
+ * option also takes focus (no find box).
878
1582
  */
879
- focusFind() {
880
- if (!this.searchable())
1583
+ move(step, focus = false) {
1584
+ const enabled = this.#enabled();
1585
+ if (!enabled.length)
881
1586
  return;
882
- afterNextRender(() => this.findInput()?.nativeElement.focus(), { injector: this.#injector });
1587
+ const current = enabled.findIndex(field => field.key === this.activeKey());
1588
+ let index;
1589
+ if (step === 'first')
1590
+ index = 0;
1591
+ else if (step === 'last')
1592
+ index = enabled.length - 1;
1593
+ else if (current < 0)
1594
+ index = step > 0 ? 0 : enabled.length - 1;
1595
+ else
1596
+ index = (current + step + enabled.length) % enabled.length;
1597
+ const key = enabled[index].key;
1598
+ this.activeKey.set(key);
1599
+ if (focus)
1600
+ this.panel()
1601
+ .element()
1602
+ ?.querySelector(`#${CSS.escape(this.#visible().ids.get(key) ?? '')}`)
1603
+ ?.focus();
1604
+ }
1605
+ /** Picks the active option; `false` when there is none. */
1606
+ pickActive() {
1607
+ const field = this.#enabled().find(item => item.key === this.activeKey());
1608
+ if (!field)
1609
+ return false;
1610
+ this.select(field);
1611
+ return true;
883
1612
  }
884
- onFindKeydown(event) {
885
- if (!MENU_KEYS.has(event.key))
886
- event.stopPropagation();
1613
+ /** Picks `field` unless it is disabled: the panel closes first, then `(pick)` fires. */
1614
+ select(field) {
1615
+ if (this.isDisabled(field))
1616
+ return;
1617
+ this.panel().close('select');
1618
+ this.pick.emit(field);
1619
+ }
1620
+ /** Keys inside the panel (find box or an option). */
1621
+ onKeydown(event) {
1622
+ const inFind = event.target.tagName === 'INPUT';
1623
+ switch (event.key) {
1624
+ case 'ArrowDown':
1625
+ this.move(1, !inFind);
1626
+ break;
1627
+ case 'ArrowUp':
1628
+ this.move(-1, !inFind);
1629
+ break;
1630
+ case 'Home':
1631
+ case 'End':
1632
+ // In the find box Home / End move the caret.
1633
+ if (inFind)
1634
+ return;
1635
+ this.move(event.key === 'Home' ? 'first' : 'last', true);
1636
+ break;
1637
+ case 'Enter':
1638
+ if (inFind)
1639
+ this.pickActive();
1640
+ else {
1641
+ const field = this.#visible().list.find(item => this.optionId(item) === event.target.id);
1642
+ if (field)
1643
+ this.select(field);
1644
+ }
1645
+ break;
1646
+ default:
1647
+ return;
1648
+ }
1649
+ event.preventDefault();
887
1650
  }
888
- /** Per-field disabled state — current key OR used key OR field's own disabled flag. */
889
- disabledMap = computed(() => {
890
- const set = new Set(this.usedKeys());
891
- const cur = this.currentKey();
892
- if (cur)
893
- set.add(cur);
894
- return set;
895
- }, ...(ngDevMode ? [{ debugName: "disabledMap" }] : /* istanbul ignore next */ []));
896
- isDisabled(field) {
897
- return field.disabled === true || this.disabledMap().has(field.key);
1651
+ /** An option took focus (roving focus, or a click): it becomes the active one. */
1652
+ onOptionFocus(field) {
1653
+ this.activeKey.set(field.key);
898
1654
  }
899
- /** "Current" check icon — only when the field matches `currentKey`. */
900
- isCurrent(field) {
901
- return field.key === this.currentKey();
1655
+ /** Panel closed: forget the find text and the active option. */
1656
+ reset() {
1657
+ this.query.set('');
1658
+ this.activeKey.set(null);
902
1659
  }
903
- /** "Used" check icon — when the field is in `usedKeys` (not the same as current). */
904
- isUsed(field) {
905
- return this.usedKeys().has(field.key);
1660
+ #enabled() {
1661
+ return this.#visible().list.filter(field => !this.isDisabled(field));
906
1662
  }
907
1663
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQueryFieldPicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
908
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdQueryFieldPicker, isStandalone: true, selector: "sd-query-field-picker", inputs: { fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null }, currentKey: { classPropertyName: "currentKey", publicName: "currentKey", isSignal: true, isRequired: false, transformFunction: null }, usedKeys: { classPropertyName: "usedKeys", publicName: "usedKeys", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pick: "pick" }, viewQueries: [{ propertyName: "menu", first: true, predicate: MatMenu, descendants: true, isSignal: true }, { propertyName: "findInput", first: true, predicate: ["findInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<mat-menu #m=\"matMenu\" xPosition=\"after\" yPosition=\"below\" class=\"c-field-picker-menu\" (closed)=\"query.set('')\">\n @if (searchable()) {\n <!-- why: \u00F4 l\u1ECDc n\u1EB1m trong mat-menu \u2014 ch\u1EB7n click (menu t\u1EF1 \u0111\u00F3ng) v\u00E0 ph\u00EDm g\u00F5 (typeahead c\u1EE7a menu\n s\u1EBD nh\u1EA3y focus sang m\u1EE5c), ch\u1EC9 \u0111\u1EC3 Escape / m\u0169i t\u00EAn xu\u1ED1ng / Tab \u0111i ti\u1EBFp cho menu. -->\n <div class=\"c-field-find\" role=\"group\" (click)=\"$event.stopPropagation()\" (keydown)=\"onFindKeydown($event)\">\n <sd-icon class=\"c-field-find-icon\" name=\"search\"></sd-icon>\n <input\n #findInput\n class=\"c-field-find-input\"\n type=\"text\"\n autocomplete=\"off\"\n [placeholder]=\"findLabel()\"\n [attr.aria-label]=\"findLabel()\"\n [value]=\"query()\"\n (input)=\"query.set(findInput.value)\" />\n </div>\n }\n @for (group of groups(); track group.label) {\n @if (showGroupHeadings()) {\n <div class=\"c-field-group\" role=\"presentation\">{{ group.label }}</div>\n }\n @for (field of group.fields; track $index) {\n <button\n type=\"button\"\n mat-menu-item\n [disabled]=\"isDisabled(field)\"\n (click)=\"pick.emit(field)\">\n <sd-icon class=\"c-field-item-icon\" [name]=\"iconFor(field)\"></sd-icon>\n <span class=\"c-field-item-label\">{{ field.label }}</span>\n <span class=\"c-field-item-type\">{{ field.type }}</span>\n @if (isCurrent(field) || isUsed(field)) {\n <sd-icon class=\"c-field-item-check\" name=\"check\"></sd-icon>\n }\n </button>\n }\n } @empty {\n <div class=\"c-field-empty\">{{ emptyLabel() }}</div>\n }\n</mat-menu>\n", styles: ["::ng-deep .mat-mdc-menu-panel.c-field-picker-menu{min-width:200px;max-width:260px}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .mat-mdc-menu-item{min-height:36px}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .mat-mdc-menu-item .mat-mdc-menu-item-text{display:flex;align-items:center;flex:1;min-width:0}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-item-icon{font-size:var(--sd-font-size-16, 16px);width:16px;height:16px;margin-right:8px;color:var(--sd-query-bar-text-secondary, #5f6368);flex-shrink:0}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-item-label{flex:1 1 auto;min-width:0;font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text, #212121);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-item-type{flex-shrink:0;margin-left:auto;padding-left:12px;font-family:Roboto Mono,monospace;font-size:var(--sd-font-size-11, 11px);color:var(--sd-query-bar-text-muted, #7a7a7a)}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-item-check{flex-shrink:0;font-size:var(--sd-font-size-14, 14px);width:14px;height:14px;margin-left:6px;color:var(--sd-primary)}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-empty{padding:12px 16px;font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text-muted, #7a7a7a)}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-group{padding:8px 16px 4px;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);letter-spacing:.04em;text-transform:uppercase;color:var(--sd-query-bar-text-muted, #7a7a7a)}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-find{display:flex;align-items:center;gap:6px;margin:4px 8px;padding:0 8px;height:32px;border:1px solid var(--sd-query-bar-border, #d6d8db);border-radius:var(--sd-radius-6, 6px)}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-find:focus-within{border-color:var(--sd-primary);outline:2px solid var(--sd-focus-ring-color);outline-offset:-1px}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-find-icon{font-size:var(--sd-font-size-16, 16px);width:16px;height:16px;color:var(--sd-query-bar-text-muted, #7a7a7a)}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-find-input{flex:1;min-width:0;border:0;outline:0;background:transparent;font:inherit;font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text, #212121)}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1664
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdQueryFieldPicker, isStandalone: true, selector: "sd-query-field-picker", inputs: { fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null }, usedKeys: { classPropertyName: "usedKeys", publicName: "usedKeys", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, findBox: { classPropertyName: "findBox", publicName: "findBox", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pick: "pick", closed: "closed" }, viewQueries: [{ propertyName: "panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _autoId = autoId();\n@let _activeKey = activeKey();\n@let _showHeadings = showGroupHeadings();\n\n<ng-template #option let-field>\n @let _disabled = isDisabled(field);\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"c-field-item\"\n [id]=\"optionId(field)\"\n [class.c-field-item--active]=\"field.key === _activeKey\"\n [attr.aria-selected]=\"field.key === _activeKey\"\n [attr.aria-disabled]=\"_disabled ? 'true' : null\"\n (focus)=\"onOptionFocus(field)\"\n (click)=\"select(field)\">\n <sd-icon class=\"c-field-item-icon\" size=\"16px\" [name]=\"iconFor(field)\" aria-hidden=\"true\"></sd-icon>\n <span class=\"c-field-item-label\">{{ field.label }}</span>\n <span class=\"c-field-item-type\">{{ field.type }}</span>\n @if (isUsed(field)) {\n <sd-icon class=\"c-field-item-check\" size=\"14px\" name=\"check\" aria-hidden=\"true\"></sd-icon>\n }\n </button>\n</ng-template>\n\n<!-- Panel danh s\u00E1ch theo khung Action Popover (handoff m\u1EE5c 3). why: \u00F4 t\u00ECm n\u1EB1m ngo\u00E0i listbox \u2014 n\u00F3 l\u00E0 combobox \u0111i\u1EC1u khi\u1EC3n\n listbox qua aria-activedescendant, focus th\u1EADt \u1EDF l\u1EA1i trong \u00F4. -->\n<ng-template sdQueryPanel=\"listbox\" #panel=\"sdQueryPanel\" [sdQueryPanelControls]=\"listId\" (closed)=\"reset(); closed.emit($event)\">\n <div\n class=\"sd-query-panel sd-query-panel--list c-field-picker-menu\"\n tabindex=\"-1\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-panel-field-picker' : null\"\n (keydown)=\"onKeydown($event)\">\n @if (searchable()) {\n <sd-search-field class=\"c-field-find\" size=\"sm\">\n <input\n sdSearchFieldInput\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-autocomplete=\"list\"\n aria-expanded=\"true\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeId()\"\n [attr.aria-label]=\"findLabel()\"\n [placeholder]=\"findLabel()\"\n [value]=\"query()\"\n (input)=\"setQuery($any($event.target).value)\" />\n </sd-search-field>\n }\n <div class=\"c-field-list\" role=\"listbox\" [id]=\"listId\" [attr.aria-label]=\"listLabel()\">\n @for (group of groups(); track group.label) {\n @if (_showHeadings) {\n <div role=\"group\" [attr.aria-labelledby]=\"group.headingId\">\n <div class=\"c-field-group\" role=\"presentation\" [id]=\"group.headingId\">{{ group.label }}</div>\n @for (field of group.fields; track field.key) {\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: field }\" />\n }\n </div>\n } @else {\n @for (field of group.fields; track field.key) {\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: field }\" />\n }\n }\n }\n </div>\n @if (!groups().length) {\n <div class=\"c-field-empty\" role=\"status\">{{ emptyLabel() }}</div>\n }\n </div>\n</ng-template>\n", styles: [".c-field-picker-menu{box-sizing:border-box;min-width:min(160px,100vw - 16px);max-width:min(320px,100vw - 16px);max-height:min(360px,100dvh - 16px);overflow:auto;border:1px solid var(--sd-border, #dde0e5);border-radius:var(--sd-radius-8, 8px);background:var(--sd-surface, var(--sd-white, #fff));color:var(--sd-text, #1a1b1f);box-shadow:0 4px 12px #0f172a24,0 1px 3px #0f172a1a;padding:4px;min-width:min(200px,100vw - 16px);max-width:min(260px,100vw - 16px)}.c-field-picker-menu:focus{outline:none}.c-field-find{margin:4px 4px 6px}.c-field-group{padding:4px 12px;font-size:var(--sd-font-size-12, 12px);color:var(--sd-text-secondary, #555)}.c-field-item{display:flex;align-items:center;gap:8px;box-sizing:border-box;width:100%;min-height:40px;padding:8px 12px;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:inherit;font:inherit;font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px);text-align:start;overflow-wrap:anywhere;cursor:pointer}.c-field-item:hover:not(:disabled),.c-field-item:focus-visible{background:color-mix(in srgb,var(--sd-action-accent, var(--sd-text, #1a1b1f)) 8%,transparent)}.c-field-item:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}.c-field-item:disabled{opacity:.45;cursor:default}@media(pointer:coarse){.c-field-item{min-height:44px}}.c-field-item.c-field-item--active{background:color-mix(in srgb,var(--sd-text, #1a1b1f) 8%,transparent);outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}.c-field-item[aria-disabled=true]{opacity:.45;cursor:default}.c-field-item[aria-disabled=true]:hover{background:transparent}.c-field-item-icon{flex:0 0 16px;width:16px;height:16px;font-size:var(--sd-font-size-16, 16px);color:var(--sd-query-bar-text-secondary, #5f6368)}.c-field-item-label{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.c-field-item-type{flex-shrink:0;margin-left:auto;padding-left:4px;font-family:Roboto Mono,monospace;font-size:var(--sd-font-size-11, 11px);color:var(--sd-query-bar-text-secondary, #5f6368)}.c-field-item-check{flex:0 0 14px;width:14px;height:14px;font-size:var(--sd-font-size-14, 14px);color:var(--sd-primary)}.c-field-empty{padding:12px;font-size:var(--sd-font-size-13, 13px);color:var(--sd-text-secondary, #555)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "directive", type: ɵSdQueryPanelDirective, selector: "ng-template[sdQueryPanel]", inputs: ["sdQueryPanel", "sdQueryPanelAlign", "sdQueryPanelControls"], outputs: ["opened", "closed"], exportAs: ["sdQueryPanel"] }, { kind: "component", type: _SdSearchField, selector: "sd-search-field", inputs: ["size", "clearable", "clearLabel", "autoId"], outputs: ["cleared"] }, { kind: "directive", type: _SdSearchFieldInputDirective, selector: "input[sdSearchFieldInput]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
909
1665
  }
910
1666
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQueryFieldPicker, decorators: [{
911
1667
  type: Component,
912
- args: [{ selector: 'sd-query-field-picker', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SdIcon, MatMenuModule], template: "<mat-menu #m=\"matMenu\" xPosition=\"after\" yPosition=\"below\" class=\"c-field-picker-menu\" (closed)=\"query.set('')\">\n @if (searchable()) {\n <!-- why: \u00F4 l\u1ECDc n\u1EB1m trong mat-menu \u2014 ch\u1EB7n click (menu t\u1EF1 \u0111\u00F3ng) v\u00E0 ph\u00EDm g\u00F5 (typeahead c\u1EE7a menu\n s\u1EBD nh\u1EA3y focus sang m\u1EE5c), ch\u1EC9 \u0111\u1EC3 Escape / m\u0169i t\u00EAn xu\u1ED1ng / Tab \u0111i ti\u1EBFp cho menu. -->\n <div class=\"c-field-find\" role=\"group\" (click)=\"$event.stopPropagation()\" (keydown)=\"onFindKeydown($event)\">\n <sd-icon class=\"c-field-find-icon\" name=\"search\"></sd-icon>\n <input\n #findInput\n class=\"c-field-find-input\"\n type=\"text\"\n autocomplete=\"off\"\n [placeholder]=\"findLabel()\"\n [attr.aria-label]=\"findLabel()\"\n [value]=\"query()\"\n (input)=\"query.set(findInput.value)\" />\n </div>\n }\n @for (group of groups(); track group.label) {\n @if (showGroupHeadings()) {\n <div class=\"c-field-group\" role=\"presentation\">{{ group.label }}</div>\n }\n @for (field of group.fields; track $index) {\n <button\n type=\"button\"\n mat-menu-item\n [disabled]=\"isDisabled(field)\"\n (click)=\"pick.emit(field)\">\n <sd-icon class=\"c-field-item-icon\" [name]=\"iconFor(field)\"></sd-icon>\n <span class=\"c-field-item-label\">{{ field.label }}</span>\n <span class=\"c-field-item-type\">{{ field.type }}</span>\n @if (isCurrent(field) || isUsed(field)) {\n <sd-icon class=\"c-field-item-check\" name=\"check\"></sd-icon>\n }\n </button>\n }\n } @empty {\n <div class=\"c-field-empty\">{{ emptyLabel() }}</div>\n }\n</mat-menu>\n", styles: ["::ng-deep .mat-mdc-menu-panel.c-field-picker-menu{min-width:200px;max-width:260px}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .mat-mdc-menu-item{min-height:36px}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .mat-mdc-menu-item .mat-mdc-menu-item-text{display:flex;align-items:center;flex:1;min-width:0}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-item-icon{font-size:var(--sd-font-size-16, 16px);width:16px;height:16px;margin-right:8px;color:var(--sd-query-bar-text-secondary, #5f6368);flex-shrink:0}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-item-label{flex:1 1 auto;min-width:0;font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text, #212121);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-item-type{flex-shrink:0;margin-left:auto;padding-left:12px;font-family:Roboto Mono,monospace;font-size:var(--sd-font-size-11, 11px);color:var(--sd-query-bar-text-muted, #7a7a7a)}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-item-check{flex-shrink:0;font-size:var(--sd-font-size-14, 14px);width:14px;height:14px;margin-left:6px;color:var(--sd-primary)}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-empty{padding:12px 16px;font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text-muted, #7a7a7a)}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-group{padding:8px 16px 4px;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);letter-spacing:.04em;text-transform:uppercase;color:var(--sd-query-bar-text-muted, #7a7a7a)}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-find{display:flex;align-items:center;gap:6px;margin:4px 8px;padding:0 8px;height:32px;border:1px solid var(--sd-query-bar-border, #d6d8db);border-radius:var(--sd-radius-6, 6px)}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-find:focus-within{border-color:var(--sd-primary);outline:2px solid var(--sd-focus-ring-color);outline-offset:-1px}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-find-icon{font-size:var(--sd-font-size-16, 16px);width:16px;height:16px;color:var(--sd-query-bar-text-muted, #7a7a7a)}::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .c-field-find-input{flex:1;min-width:0;border:0;outline:0;background:transparent;font:inherit;font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text, #212121)}\n"] }]
913
- }], propDecorators: { fields: [{ type: i0.Input, args: [{ isSignal: true, alias: "fields", required: false }] }], currentKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentKey", required: false }] }], usedKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "usedKeys", required: false }] }], pick: [{ type: i0.Output, args: ["pick"] }], menu: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatMenu), { isSignal: true }] }], findInput: [{ type: i0.ViewChild, args: ['findInput', { isSignal: true }] }] } });
1668
+ args: [{ selector: 'sd-query-field-picker', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, SdIcon, ɵSdQueryPanelDirective, _SdSearchField, _SdSearchFieldInputDirective], template: "@let _autoId = autoId();\n@let _activeKey = activeKey();\n@let _showHeadings = showGroupHeadings();\n\n<ng-template #option let-field>\n @let _disabled = isDisabled(field);\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"c-field-item\"\n [id]=\"optionId(field)\"\n [class.c-field-item--active]=\"field.key === _activeKey\"\n [attr.aria-selected]=\"field.key === _activeKey\"\n [attr.aria-disabled]=\"_disabled ? 'true' : null\"\n (focus)=\"onOptionFocus(field)\"\n (click)=\"select(field)\">\n <sd-icon class=\"c-field-item-icon\" size=\"16px\" [name]=\"iconFor(field)\" aria-hidden=\"true\"></sd-icon>\n <span class=\"c-field-item-label\">{{ field.label }}</span>\n <span class=\"c-field-item-type\">{{ field.type }}</span>\n @if (isUsed(field)) {\n <sd-icon class=\"c-field-item-check\" size=\"14px\" name=\"check\" aria-hidden=\"true\"></sd-icon>\n }\n </button>\n</ng-template>\n\n<!-- Panel danh s\u00E1ch theo khung Action Popover (handoff m\u1EE5c 3). why: \u00F4 t\u00ECm n\u1EB1m ngo\u00E0i listbox \u2014 n\u00F3 l\u00E0 combobox \u0111i\u1EC1u khi\u1EC3n\n listbox qua aria-activedescendant, focus th\u1EADt \u1EDF l\u1EA1i trong \u00F4. -->\n<ng-template sdQueryPanel=\"listbox\" #panel=\"sdQueryPanel\" [sdQueryPanelControls]=\"listId\" (closed)=\"reset(); closed.emit($event)\">\n <div\n class=\"sd-query-panel sd-query-panel--list c-field-picker-menu\"\n tabindex=\"-1\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-panel-field-picker' : null\"\n (keydown)=\"onKeydown($event)\">\n @if (searchable()) {\n <sd-search-field class=\"c-field-find\" size=\"sm\">\n <input\n sdSearchFieldInput\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-autocomplete=\"list\"\n aria-expanded=\"true\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeId()\"\n [attr.aria-label]=\"findLabel()\"\n [placeholder]=\"findLabel()\"\n [value]=\"query()\"\n (input)=\"setQuery($any($event.target).value)\" />\n </sd-search-field>\n }\n <div class=\"c-field-list\" role=\"listbox\" [id]=\"listId\" [attr.aria-label]=\"listLabel()\">\n @for (group of groups(); track group.label) {\n @if (_showHeadings) {\n <div role=\"group\" [attr.aria-labelledby]=\"group.headingId\">\n <div class=\"c-field-group\" role=\"presentation\" [id]=\"group.headingId\">{{ group.label }}</div>\n @for (field of group.fields; track field.key) {\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: field }\" />\n }\n </div>\n } @else {\n @for (field of group.fields; track field.key) {\n <ng-container [ngTemplateOutlet]=\"option\" [ngTemplateOutletContext]=\"{ $implicit: field }\" />\n }\n }\n }\n </div>\n @if (!groups().length) {\n <div class=\"c-field-empty\" role=\"status\">{{ emptyLabel() }}</div>\n }\n </div>\n</ng-template>\n", styles: [".c-field-picker-menu{box-sizing:border-box;min-width:min(160px,100vw - 16px);max-width:min(320px,100vw - 16px);max-height:min(360px,100dvh - 16px);overflow:auto;border:1px solid var(--sd-border, #dde0e5);border-radius:var(--sd-radius-8, 8px);background:var(--sd-surface, var(--sd-white, #fff));color:var(--sd-text, #1a1b1f);box-shadow:0 4px 12px #0f172a24,0 1px 3px #0f172a1a;padding:4px;min-width:min(200px,100vw - 16px);max-width:min(260px,100vw - 16px)}.c-field-picker-menu:focus{outline:none}.c-field-find{margin:4px 4px 6px}.c-field-group{padding:4px 12px;font-size:var(--sd-font-size-12, 12px);color:var(--sd-text-secondary, #555)}.c-field-item{display:flex;align-items:center;gap:8px;box-sizing:border-box;width:100%;min-height:40px;padding:8px 12px;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:inherit;font:inherit;font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px);text-align:start;overflow-wrap:anywhere;cursor:pointer}.c-field-item:hover:not(:disabled),.c-field-item:focus-visible{background:color-mix(in srgb,var(--sd-action-accent, var(--sd-text, #1a1b1f)) 8%,transparent)}.c-field-item:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}.c-field-item:disabled{opacity:.45;cursor:default}@media(pointer:coarse){.c-field-item{min-height:44px}}.c-field-item.c-field-item--active{background:color-mix(in srgb,var(--sd-text, #1a1b1f) 8%,transparent);outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}.c-field-item[aria-disabled=true]{opacity:.45;cursor:default}.c-field-item[aria-disabled=true]:hover{background:transparent}.c-field-item-icon{flex:0 0 16px;width:16px;height:16px;font-size:var(--sd-font-size-16, 16px);color:var(--sd-query-bar-text-secondary, #5f6368)}.c-field-item-label{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.c-field-item-type{flex-shrink:0;margin-left:auto;padding-left:4px;font-family:Roboto Mono,monospace;font-size:var(--sd-font-size-11, 11px);color:var(--sd-query-bar-text-secondary, #5f6368)}.c-field-item-check{flex:0 0 14px;width:14px;height:14px;font-size:var(--sd-font-size-14, 14px);color:var(--sd-primary)}.c-field-empty{padding:12px;font-size:var(--sd-font-size-13, 13px);color:var(--sd-text-secondary, #555)}\n"] }]
1669
+ }], propDecorators: { fields: [{ type: i0.Input, args: [{ isSignal: true, alias: "fields", required: false }] }], usedKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "usedKeys", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], findBox: [{ type: i0.Input, args: [{ isSignal: true, alias: "findBox", required: false }] }], pick: [{ type: i0.Output, args: ["pick"] }], closed: [{ type: i0.Output, args: ["closed"] }], panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }] } });
914
1670
 
1671
+ let nextHintId = 0;
915
1672
  /**
916
1673
  * Completed inline chip (non-string/number — those use `<sd-query-inline-value-chip>`).
917
1674
  *
@@ -934,6 +1691,8 @@ class SdQueryInlineChip {
934
1691
  // và với build chip, nếu không cùng một field sẽ hiện hai ngôn ngữ tuỳ chỗ.
935
1692
  booleanTrueLabel = computed(() => this.#i18n.t('core.component.query-bar.boolean.true'), ...(ngDevMode ? [{ debugName: "booleanTrueLabel" }] : /* istanbul ignore next */ []));
936
1693
  booleanFalseLabel = computed(() => this.#i18n.t('core.component.query-bar.boolean.false'), ...(ngDevMode ? [{ debugName: "booleanFalseLabel" }] : /* istanbul ignore next */ []));
1694
+ /** `aria-label` of the × — names the field, in the current language. */
1695
+ removeLabel = computed(() => this.#i18n.t('core.component.query-bar.remove-filter', { label: this.field().label }), ...(ngDevMode ? [{ debugName: "removeLabel" }] : /* istanbul ignore next */ []));
937
1696
  // ---------------------------------------------------------------------------
938
1697
  // Inputs
939
1698
  // ---------------------------------------------------------------------------
@@ -955,6 +1714,8 @@ class SdQueryInlineChip {
955
1714
  isNoData = input(false, ...(ngDevMode ? [{ debugName: "isNoData" }] : /* istanbul ignore next */ []));
956
1715
  /** Pinned chip — no × button. */
957
1716
  pinned = input(false, ...(ngDevMode ? [{ debugName: "pinned" }] : /* istanbul ignore next */ []));
1717
+ /** Required field: `aria-required`, no empty selection (handoff B3). */
1718
+ required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
958
1719
  /** Required chip without a value — error look, `aria-invalid`. */
959
1720
  invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
960
1721
  /** Id set as `aria-describedby` (the host's required hint). */
@@ -988,6 +1749,21 @@ class SdQueryInlineChip {
988
1749
  operator = computed(() => this.filter().operator, ...(ngDevMode ? [{ debugName: "operator" }] : /* istanbul ignore next */ []));
989
1750
  /** Data payload — convenience accessor for template. */
990
1751
  data = computed(() => this.filter().data, ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
1752
+ /**
1753
+ * Model handed to the select. Follows `data`, and is reset to a copy of it when a required chip refuses an empty
1754
+ * selection — the new reference makes sd-select drop the deselection it already shows.
1755
+ */
1756
+ selectModel = linkedSignal(() => this.data(), ...(ngDevMode ? [{ debugName: "selectModel" }] : /* istanbul ignore next */ []));
1757
+ /** "Choose at least one value." under a required multi-value chip that was just refused an empty selection. */
1758
+ minOneHint = signal(false, ...(ngDevMode ? [{ debugName: "minOneHint" }] : /* istanbul ignore next */ []));
1759
+ minOneLabel = computed(() => this.#i18n.t('core.component.query-bar.required-min-one'), ...(ngDevMode ? [{ debugName: "minOneLabel" }] : /* istanbul ignore next */ []));
1760
+ hintId = `sd-query-inline-chip-hint-${nextHintId++}`;
1761
+ /** `aria-describedby` of the chip: the host's required hint and, while shown, the min-one line. */
1762
+ describedByIds = computed(() => [this.describedBy(), this.minOneHint() ? this.hintId : undefined].filter(Boolean).join(' ') || null, ...(ngDevMode ? [{ debugName: "describedByIds" }] : /* istanbul ignore next */ []));
1763
+ /** Date, date-time and date-range controls — a refused empty value is written back into them (B3). */
1764
+ dateControl = viewChild(SdDate, ...(ngDevMode ? [{ debugName: "dateControl" }] : /* istanbul ignore next */ []));
1765
+ datetimeControl = viewChild(SdDatetime, ...(ngDevMode ? [{ debugName: "datetimeControl" }] : /* istanbul ignore next */ []));
1766
+ dateRangeControl = viewChild(SdDateRange, ...(ngDevMode ? [{ debugName: "dateRangeControl" }] : /* istanbul ignore next */ []));
991
1767
  // ---------------------------------------------------------------------------
992
1768
  // Edit lifecycle
993
1769
  // ---------------------------------------------------------------------------
@@ -1006,14 +1782,42 @@ class SdQueryInlineChip {
1006
1782
  * forwards the value; it no longer toggles `#editing` (that's boolean-only now).
1007
1783
  */
1008
1784
  emitSingleCommit(v) {
1785
+ if (this.#keepsRequired(v))
1786
+ return;
1009
1787
  this.commit.emit(v);
1010
1788
  }
1011
1789
  /** BETWEEN commit — sd-date-range (viewed='inline') emits `{from, to}`; chip just forwards it. */
1012
1790
  emitRangeCommit(ev) {
1791
+ if (this.#keepsRequired(ev ?? { from: null, to: null }))
1792
+ return;
1013
1793
  this.commitRange.emit(ev ?? null);
1014
1794
  }
1795
+ /**
1796
+ * B3: a required chip that has a value refuses an empty date, date-time or range — nothing is emitted and the control
1797
+ * shows the previous value again. `true` when refused.
1798
+ */
1799
+ #keepsRequired(next) {
1800
+ const filter = this.filter();
1801
+ if (!this.required() || !ɵsdQueryFilterActive(filter) || ɵsdQueryFilterActive({ ...filter, data: next }))
1802
+ return false;
1803
+ // why: `[model]="data"` không đổi nên Angular không đẩy lại input, trong khi model của control đã bị chính nó ghi rỗng —
1804
+ // ghi thẳng giá trị trước vào model của control.
1805
+ const previous = this.data();
1806
+ this.dateControl()?.valueModel.set(previous);
1807
+ this.datetimeControl()?.valueModel.set(previous);
1808
+ this.dateRangeControl()?.valueModel.set(previous);
1809
+ return true;
1810
+ }
1015
1811
  /** Multi-select live emit (sd-select inline). */
1016
1812
  emitLive(v) {
1813
+ if (this.required() && Array.isArray(v) && v.length === 0) {
1814
+ // B3: keep the previous values of a required chip and say why.
1815
+ const previous = this.data();
1816
+ this.selectModel.set(Array.isArray(previous) ? [...previous] : previous);
1817
+ this.minOneHint.set(true);
1818
+ return;
1819
+ }
1820
+ this.minOneHint.set(false);
1017
1821
  this.liveChange.emit(v);
1018
1822
  }
1019
1823
  /** Boolean toggle commit — exits edit. */
@@ -1022,17 +1826,17 @@ class SdQueryInlineChip {
1022
1826
  this.#editing.set(false);
1023
1827
  }
1024
1828
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQueryInlineChip, deps: [], target: i0.ɵɵFactoryTarget.Component });
1025
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdQueryInlineChip, isStandalone: true, selector: "sd-query-inline-chip", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: true, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, showOperator: { classPropertyName: "showOperator", publicName: "showOperator", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, valueText: { classPropertyName: "valueText", publicName: "valueText", isSignal: true, isRequired: false, transformFunction: null }, isNoData: { classPropertyName: "isNoData", publicName: "isNoData", isSignal: true, isRequired: false, transformFunction: null }, pinned: { classPropertyName: "pinned", publicName: "pinned", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, describedBy: { classPropertyName: "describedBy", publicName: "describedBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { commit: "commit", commitRange: "commitRange", liveChange: "liveChange", remove: "remove" }, ngImport: i0, template: "<!--\n Completed inline chip \u2014 non-string/number/seamless branches.\n Edit lifecycle is self-managed: click enters edit + auto-opens picker,\n focusout outside the wrapper exits edit, picker emits commit single OR\n liveChange (multi) OR commitRange (BETWEEN).\n-->\n@let _field = field();\n@let _operator = operator();\n@let _data = data();\n@let _multiple = multiple();\n@let _editing = editing();\n@let _isNoData = isNoData();\n@let _autoId = autoId();\n\n<div\n class=\"c-token\"\n [class.c-token-editing]=\"_editing\"\n [class.c-token-pinned]=\"pinned()\"\n [class.c-token-invalid]=\"invalid()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy() ?? null\">\n <sd-icon class=\"c-token-icon\" [name]=\"iconName()\"></sd-icon>\n <span class=\"c-token-field\">{{ _field.label }}</span>\n\n @if (!_isNoData && showOperator()) {\n <sd-operator class=\"c-token-op\" [operators]=\"[_operator]\" [model]=\"_operator\" size=\"xs\" readonly />\n } @else if (!_isNoData) {\n <span class=\"c-token-sep\">:</span>\n }\n\n @if (!_isNoData) {\n @if (_field.type === 'boolean') {\n @if (_editing) {\n <!-- why: native button thay sd-button \u2014 mat-button MDC baseline 36px bu\u1ED9c\n ph\u1EA3i hack height/padding overrides; chip 28/32px nh\u1ECF h\u01A1n nhi\u1EC1u. T\u1EF1 v\u1EBD\n pill nh\u1ECF v\u1EDBi CSS scoped trong chip, kh\u00F4ng qua MDC, g\u1ECDn + chu\u1EA9n baseline. -->\n <span class=\"c-token-value c-token-value-edit c-bool-toggle\">\n <button\n type=\"button\"\n class=\"c-bool-btn c-bool-true\"\n [class.c-bool-active]=\"_data === true\"\n [attr.data-autoId]=\"_autoId + '-true'\"\n (click)=\"emitBoolean(true)\">\n {{ $any(_field).trueLabel || booleanTrueLabel() }}\n </button>\n <button\n type=\"button\"\n class=\"c-bool-btn c-bool-false\"\n [class.c-bool-active]=\"_data === false\"\n [attr.data-autoId]=\"_autoId + '-false'\"\n (click)=\"emitBoolean(false)\">\n {{ $any(_field).falseLabel || booleanFalseLabel() }}\n </button>\n </span>\n } @else {\n <button type=\"button\" class=\"c-token-value\" (click)=\"enterEdit()\">{{ valueText() }}</button>\n }\n } @else if ((_field.type === 'date' || _field.type === 'datetime') && _operator === 'BETWEEN') {\n <!-- why: sd-date-range [viewed]=\"'inline'\" t\u1EF1 qu\u1EA3n click\u2192edit + focusout (datetime downgrade v\u1EC1 date).\n Chip kh\u00F4ng wiring lifecycle n\u1EEFa; [clearable]=false v\u00EC chip c\u00F3 \u00D7 ri\u00EAng. -->\n <span class=\"c-token-value c-token-value-edit\">\n <sd-date-range size=\"sm\"\n [autoId]=\"_autoId\"\n [viewed]=\"'inline'\"\n [clearable]=\"false\"\n [model]=\"$any(_data)\"\n (sdChange)=\"emitRangeCommit($any($event))\"></sd-date-range>\n </span>\n } @else if (_field.type === 'values' || _field.type === 'lazy-values') {\n @let _opt = $any(_field).option;\n <!-- why: sd-select [viewed]=\"'inline'\" t\u1EF1 qu\u1EA3n click\u2192edit + focusout\u2192tho\u00E1t + bare editor.\n Chip kh\u00F4ng wiring lifecycle cho nh\u00E1nh n\u00E0y n\u1EEFa (b\u1ECF enterEdit/onFocusOut/bare). -->\n <span class=\"c-token-value c-token-value-edit\">\n <sd-select #chipPicker size=\"sm\" minWidthPanel=\"300px\"\n [autoId]=\"_autoId\"\n [items]=\"_field.type === 'lazy-values' ? $any(_opt).search : $any(_opt.items)\"\n [valueField]=\"_opt.valueField\"\n [displayField]=\"_opt.displayField\"\n [multiple]=\"_multiple\"\n [viewed]=\"'inline'\"\n [clearable]=\"false\"\n [model]=\"$any(_data)\"\n (sdChange)=\"_multiple ? emitLive($event) : emitSingleCommit($event)\">\n <!-- why: viewed mode m\u1EB7c \u0111\u1ECBnh d\u00F9ng comma-joined cho multi \u2014 qu\u00E1 d\u00E0i cho chip.\n Override b\u1EB1ng template \"head +N\" gi\u1ED1ng popover chipValueText. -->\n <ng-template #sdValue let-selectedItems=\"selectedItems\">\n @if ((selectedItems?.length ?? 0) > 1) {\n <span class=\"c-token-multi-head\">{{ $any(selectedItems)[0][_opt.displayField] }}</span> +{{ selectedItems.length - 1 }}\n } @else if ((selectedItems?.length ?? 0) === 1) {\n <span class=\"c-token-multi-head\">{{ $any(selectedItems)[0][_opt.displayField] }}</span>\n }\n </ng-template>\n </sd-select>\n </span>\n } @else if (_field.type === 'date') {\n <span class=\"c-token-value c-token-value-edit\">\n <sd-date size=\"sm\"\n [autoId]=\"_autoId\"\n [viewed]=\"'inline'\"\n [clearable]=\"false\"\n [model]=\"$any(_data)\"\n (sdChange)=\"emitSingleCommit($any($event))\"></sd-date>\n </span>\n } @else if (_field.type === 'datetime') {\n <span class=\"c-token-value c-token-value-edit\">\n <sd-datetime size=\"sm\"\n [autoId]=\"_autoId\"\n [viewed]=\"'inline'\"\n [clearable]=\"false\"\n [model]=\"$any(_data)\"\n (sdChange)=\"emitSingleCommit($any($event))\"></sd-datetime>\n </span>\n } @else {\n <!-- Fallback (unforeseen type) \u2014 read-only display via valueText. -->\n <span class=\"c-token-value\">{{ valueText() }}</span>\n }\n }\n\n @if (!pinned()) {\n <button type=\"button\" class=\"c-token-remove\" aria-label=\"Remove filter\" (click)=\"remove.emit()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n</div>\n", styles: [":host{display:contents}.c-token{display:inline-flex;align-items:center;gap:4px;padding:0 0 0 12px;border:1px solid var(--sd-primary-light);border-radius:999px;background:var(--sd-primary-light);font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text-secondary, #5f6368);white-space:nowrap;overflow:hidden}:host-context(.c-density-compact) .c-token{height:28px}:host-context(.c-density-comfortable) .c-token{height:32px}.c-token.c-token-pinned{padding-right:12px}.c-token.c-token-invalid{border-color:var(--sd-query-bar-chip-danger, #d23535);background:var(--sd-query-bar-chip-danger-bg, #fff5f5);color:var(--sd-query-bar-chip-danger, #d23535)}.c-token-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px;line-height:14px;color:inherit}.c-token-field{font-weight:var(--sd-font-weight-medium, 500);line-height:1}.c-token-op{display:inline-flex;align-items:center;color:inherit}.c-token-sep{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-token-value{border:none;background:transparent;padding:0;font:inherit;font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-primary);cursor:pointer}.c-token-value:hover{text-decoration:underline}.c-token-value-edit{display:inline-flex;align-items:center;gap:4px;max-width:240px}.c-token-value-edit sd-date-range{display:inline-flex;max-width:220px;min-width:0;flex:0 1 auto}.c-token-value-edit sd-select,.c-token-value-edit sd-date,.c-token-value-edit sd-datetime{display:inline-flex;align-items:center;line-height:1}.c-token ::ng-deep .mat-mdc-form-field{line-height:1}.c-token ::ng-deep .mat-mdc-text-field-wrapper,.c-token ::ng-deep .mat-mdc-form-field-flex{padding:0;min-height:0;background:transparent}.c-token ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}.c-token ::ng-deep .mat-mdc-select-value,.c-token ::ng-deep .mat-mdc-input-element,.c-token ::ng-deep input{line-height:1;font-size:var(--sd-font-size-13, 13px);padding:0;height:auto;color:inherit}.c-token ::ng-deep .mat-mdc-select-value{display:inline-flex;align-items:center;min-width:0;max-width:200px;overflow:hidden;text-overflow:ellipsis;color:var(--sd-primary);font-weight:var(--sd-font-weight-medium, 500)}.c-token ::ng-deep .sd-suffix-icon{display:none}.c-token-multi-head{display:inline-block;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}.c-bool-toggle{display:inline-flex;align-items:center;gap:4px}.c-bool-btn{display:inline-flex;align-items:center;justify-content:center;height:18px;min-width:0;padding:0 8px;border:1px solid currentColor;border-radius:var(--sd-radius-999, 999px);background:transparent;font:inherit;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:1;cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;transition:background var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}:host-context(.c-density-comfortable) .c-bool-btn{height:20px;padding:0 10px;font-size:var(--sd-font-size-12, 12px)}.c-bool-true{color:var(--sd-success)}.c-bool-false{color:var(--sd-warning)}.c-bool-active.c-bool-true{background:var(--sd-success);color:var(--sd-text-on-solid, #ffffff);border-color:var(--sd-success)}.c-bool-active.c-bool-false{background:var(--sd-warning);color:var(--sd-text-on-solid, #ffffff);border-color:var(--sd-warning)}.c-bool-btn:hover:not(.c-bool-active).c-bool-true{background:var(--sd-success-light)}.c-bool-btn:hover:not(.c-bool-active).c-bool-false{background:var(--sd-warning-light)}.c-token-remove{align-self:stretch;display:inline-flex;align-items:center;justify-content:center;border:none;border-left:1px solid rgba(0,0,0,.04);border-radius:0;background:transparent;cursor:pointer;color:inherit}:host-context(.c-density-compact) .c-token-remove{width:26px}:host-context(.c-density-comfortable) .c-token-remove{width:28px}.c-token-remove sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-token-remove:hover{background:#0000000d}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "component", type: SdOperator, selector: "sd-operator", inputs: ["model", "operators", "disabled", "autoId", "size", "readonly", "active", "showCode"], outputs: ["modelChange"] }, { kind: "component", type: SdDate, selector: "sd-date", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus"] }, { kind: "component", type: SdDateRange, selector: "sd-date-range", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "hideInlineError", "required", "disabled", "viewed", "clearable", "appearance", "floatLabel", "min", "max", "transform", "model"], outputs: ["operatorChange", "modelChange", "sdChange"] }, { kind: "component", type: SdDatetime, selector: "sd-datetime", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "showSeconds", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["modelChange", "sdChange", "sdFocus"] }, { kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "virtualScroll", "itemSize", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "items", "model"], outputs: ["operatorChange", "sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1829
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdQueryInlineChip, isStandalone: true, selector: "sd-query-inline-chip", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: true, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, showOperator: { classPropertyName: "showOperator", publicName: "showOperator", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, valueText: { classPropertyName: "valueText", publicName: "valueText", isSignal: true, isRequired: false, transformFunction: null }, isNoData: { classPropertyName: "isNoData", publicName: "isNoData", isSignal: true, isRequired: false, transformFunction: null }, pinned: { classPropertyName: "pinned", publicName: "pinned", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, describedBy: { classPropertyName: "describedBy", publicName: "describedBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { commit: "commit", commitRange: "commitRange", liveChange: "liveChange", remove: "remove" }, viewQueries: [{ propertyName: "dateControl", first: true, predicate: SdDate, descendants: true, isSignal: true }, { propertyName: "datetimeControl", first: true, predicate: SdDatetime, descendants: true, isSignal: true }, { propertyName: "dateRangeControl", first: true, predicate: SdDateRange, descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n Completed inline chip \u2014 non-string/number/seamless branches.\n Edit lifecycle is self-managed: click enters edit + auto-opens picker,\n focusout outside the wrapper exits edit, picker emits commit single OR\n liveChange (multi) OR commitRange (BETWEEN).\n-->\n@let _field = field();\n@let _operator = operator();\n@let _data = data();\n@let _multiple = multiple();\n@let _editing = editing();\n@let _isNoData = isNoData();\n@let _autoId = autoId();\n\n<div\n class=\"c-token\"\n [class.c-token-editing]=\"_editing\"\n [class.c-token-pinned]=\"pinned()\"\n [class.c-token-invalid]=\"invalid()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedByIds()\">\n <sd-icon class=\"c-token-icon\" [name]=\"iconName()\"></sd-icon>\n <span class=\"c-token-field\">{{ _field.label }}</span>\n\n @if (!_isNoData && showOperator()) {\n <sd-operator class=\"c-token-op\" [operators]=\"[_operator]\" [model]=\"_operator\" size=\"xs\" readonly />\n } @else if (!_isNoData) {\n <span class=\"c-token-sep\">:</span>\n }\n\n @if (!_isNoData) {\n @if (_field.type === 'boolean') {\n @if (_editing) {\n <!-- why: native button thay sd-button \u2014 mat-button MDC baseline 36px bu\u1ED9c\n ph\u1EA3i hack height/padding overrides; chip 28/32px nh\u1ECF h\u01A1n nhi\u1EC1u. T\u1EF1 v\u1EBD\n pill nh\u1ECF v\u1EDBi CSS scoped trong chip, kh\u00F4ng qua MDC, g\u1ECDn + chu\u1EA9n baseline. -->\n <span class=\"c-token-value c-token-value-edit c-bool-toggle\">\n <button\n type=\"button\"\n class=\"c-bool-btn c-bool-true\"\n [class.c-bool-active]=\"_data === true\"\n [attr.data-autoId]=\"_autoId + '-true'\"\n (click)=\"emitBoolean(true)\">\n {{ $any(_field).trueLabel || booleanTrueLabel() }}\n </button>\n <button\n type=\"button\"\n class=\"c-bool-btn c-bool-false\"\n [class.c-bool-active]=\"_data === false\"\n [attr.data-autoId]=\"_autoId + '-false'\"\n (click)=\"emitBoolean(false)\">\n {{ $any(_field).falseLabel || booleanFalseLabel() }}\n </button>\n </span>\n } @else {\n <button type=\"button\" class=\"c-token-value\" (click)=\"enterEdit()\">{{ valueText() }}</button>\n }\n } @else if ((_field.type === 'date' || _field.type === 'datetime') && _operator === 'BETWEEN') {\n <!-- why: sd-date-range [viewed]=\"'inline'\" t\u1EF1 qu\u1EA3n click\u2192edit + focusout (datetime downgrade v\u1EC1 date).\n Chip kh\u00F4ng wiring lifecycle n\u1EEFa; [clearable]=false v\u00EC chip c\u00F3 \u00D7 ri\u00EAng. -->\n <span class=\"c-token-value c-token-value-edit\">\n <sd-date-range size=\"sm\"\n [autoId]=\"_autoId\"\n [viewed]=\"'inline'\"\n [clearable]=\"false\"\n [model]=\"$any(_data)\"\n (sdChange)=\"emitRangeCommit($any($event))\"></sd-date-range>\n </span>\n } @else if (_field.type === 'values' || _field.type === 'lazy-values') {\n @let _opt = $any(_field).option;\n <!-- why: sd-select [viewed]=\"'inline'\" t\u1EF1 qu\u1EA3n click\u2192edit + focusout\u2192tho\u00E1t + bare editor.\n Chip kh\u00F4ng wiring lifecycle cho nh\u00E1nh n\u00E0y n\u1EEFa (b\u1ECF enterEdit/onFocusOut/bare). -->\n <span class=\"c-token-value c-token-value-edit\">\n <sd-select #chipPicker size=\"sm\" minWidthPanel=\"300px\"\n [autoId]=\"_autoId\"\n [items]=\"_field.type === 'lazy-values' ? $any(_opt).search : $any(_opt.items)\"\n [valueField]=\"_opt.valueField\"\n [displayField]=\"_opt.displayField\"\n [multiple]=\"_multiple\"\n [viewed]=\"'inline'\"\n [clearable]=\"false\"\n [required]=\"required()\"\n [model]=\"$any(selectModel())\"\n (sdChange)=\"_multiple ? emitLive($event) : emitSingleCommit($event)\">\n <!-- why: viewed mode m\u1EB7c \u0111\u1ECBnh d\u00F9ng comma-joined cho multi \u2014 qu\u00E1 d\u00E0i cho chip.\n Override b\u1EB1ng template \"head +N\" gi\u1ED1ng popover chipValueText. -->\n <ng-template #sdValue let-selectedItems=\"selectedItems\">\n @if ((selectedItems?.length ?? 0) > 1) {\n <span class=\"c-token-multi-head\">{{ $any(selectedItems)[0][_opt.displayField] }}</span> +{{ selectedItems.length - 1 }}\n } @else if ((selectedItems?.length ?? 0) === 1) {\n <span class=\"c-token-multi-head\">{{ $any(selectedItems)[0][_opt.displayField] }}</span>\n }\n </ng-template>\n </sd-select>\n </span>\n } @else if (_field.type === 'date') {\n <span class=\"c-token-value c-token-value-edit\">\n <sd-date size=\"sm\"\n [autoId]=\"_autoId\"\n [viewed]=\"'inline'\"\n [clearable]=\"false\"\n [model]=\"$any(_data)\"\n (sdChange)=\"emitSingleCommit($any($event))\"></sd-date>\n </span>\n } @else if (_field.type === 'datetime') {\n <span class=\"c-token-value c-token-value-edit\">\n <sd-datetime size=\"sm\"\n [autoId]=\"_autoId\"\n [viewed]=\"'inline'\"\n [clearable]=\"false\"\n [model]=\"$any(_data)\"\n (sdChange)=\"emitSingleCommit($any($event))\"></sd-datetime>\n </span>\n } @else {\n <!-- Fallback (unforeseen type) \u2014 read-only display via valueText. -->\n <span class=\"c-token-value\">{{ valueText() }}</span>\n }\n }\n\n @if (!pinned()) {\n <button type=\"button\" class=\"c-token-remove\" [attr.aria-label]=\"removeLabel()\" (click)=\"remove.emit()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n</div>\n<!-- why: ngo\u00E0i .c-token (overflow: hidden c\u1EAFt n\u1ED9i dung) \u2014 host l\u00E0 display: contents n\u00EAn d\u00F2ng nh\u1EAFc n\u1EB1m ngay sau chip. -->\n@if (minOneHint()) {\n <span class=\"c-token-required-hint\" aria-live=\"polite\" [id]=\"hintId\">{{ minOneLabel() }}</span>\n}\n", styles: [":host{display:contents}.c-token{display:inline-flex;align-items:center;gap:4px;padding:0 0 0 12px;border:1px solid var(--sd-primary-light);border-radius:999px;background:var(--sd-primary-light);font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text-secondary, #5f6368);white-space:nowrap;overflow:hidden}:host-context(.c-density-compact) .c-token{height:28px}:host-context(.c-density-comfortable) .c-token{height:32px}.c-token.c-token-pinned{padding-right:12px}.c-token.c-token-invalid{border-color:var(--sd-query-bar-chip-danger, #d23535);background:var(--sd-query-bar-chip-danger-bg, #fff5f5);color:var(--sd-query-bar-chip-danger, #d23535)}.c-token:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.c-token-required-hint{align-self:center;font-size:var(--sd-font-size-12, 12px);color:var(--sd-text-secondary, #555);white-space:nowrap}.c-token-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px;line-height:14px;color:inherit}.c-token-field{font-weight:var(--sd-font-weight-medium, 500);line-height:1}.c-token-op{display:inline-flex;align-items:center;color:inherit}.c-token-sep{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-token-value{border:none;background:transparent;padding:0;font:inherit;font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-primary);cursor:pointer}.c-token-value:hover{text-decoration:underline}.c-token-value-edit{display:inline-flex;align-items:center;gap:4px;max-width:240px}.c-token-value-edit sd-date-range{display:inline-flex;max-width:220px;min-width:0;flex:0 1 auto}.c-token-value-edit sd-select,.c-token-value-edit sd-date,.c-token-value-edit sd-datetime{display:inline-flex;align-items:center;line-height:1}.c-token ::ng-deep .mat-mdc-form-field{line-height:1}.c-token ::ng-deep .mat-mdc-text-field-wrapper,.c-token ::ng-deep .mat-mdc-form-field-flex{padding:0;min-height:0;background:transparent}.c-token ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}.c-token ::ng-deep .mat-mdc-select-value,.c-token ::ng-deep .mat-mdc-input-element,.c-token ::ng-deep input{line-height:1;font-size:var(--sd-font-size-13, 13px);padding:0;height:auto;color:inherit}.c-token ::ng-deep .mat-mdc-select-value{display:inline-flex;align-items:center;min-width:0;max-width:200px;overflow:hidden;text-overflow:ellipsis;color:var(--sd-primary);font-weight:var(--sd-font-weight-medium, 500)}.c-token ::ng-deep .sd-suffix-icon{display:none}.c-token-multi-head{display:inline-block;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}.c-bool-toggle{display:inline-flex;align-items:center;gap:4px}.c-bool-btn{display:inline-flex;align-items:center;justify-content:center;height:18px;min-width:0;padding:0 8px;border:1px solid currentColor;border-radius:var(--sd-radius-999, 999px);background:transparent;font:inherit;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:1;cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;transition:background var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}:host-context(.c-density-comfortable) .c-bool-btn{height:20px;padding:0 10px;font-size:var(--sd-font-size-12, 12px)}.c-bool-true{color:var(--sd-success)}.c-bool-false{color:var(--sd-warning)}.c-bool-active.c-bool-true{background:var(--sd-success);color:var(--sd-text-on-solid, #ffffff);border-color:var(--sd-success)}.c-bool-active.c-bool-false{background:var(--sd-warning);color:var(--sd-text-on-solid, #ffffff);border-color:var(--sd-warning)}.c-bool-btn:hover:not(.c-bool-active).c-bool-true{background:var(--sd-success-light)}.c-bool-btn:hover:not(.c-bool-active).c-bool-false{background:var(--sd-warning-light)}.c-token-remove{align-self:stretch;display:inline-flex;align-items:center;justify-content:center;border:none;border-left:1px solid rgba(0,0,0,.04);border-radius:0;background:transparent;cursor:pointer;color:inherit}:host-context(.c-density-compact) .c-token-remove{width:26px}:host-context(.c-density-comfortable) .c-token-remove{width:28px}.c-token-remove sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-token-remove:hover{background:#0000000d}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "component", type: SdOperator, selector: "sd-operator", inputs: ["model", "operators", "disabled", "autoId", "size", "readonly", "active", "showCode"], outputs: ["modelChange"] }, { kind: "component", type: SdDate, selector: "sd-date", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus"] }, { kind: "component", type: SdDateRange, selector: "sd-date-range", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "hideInlineError", "required", "disabled", "viewed", "clearable", "appearance", "floatLabel", "min", "max", "transform", "model"], outputs: ["operatorChange", "modelChange", "sdChange"] }, { kind: "component", type: SdDatetime, selector: "sd-datetime", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "showSeconds", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["modelChange", "sdChange", "sdFocus"] }, { kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "virtualScroll", "itemSize", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "items", "model"], outputs: ["operatorChange", "sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1026
1830
  }
1027
1831
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQueryInlineChip, decorators: [{
1028
1832
  type: Component,
1029
- args: [{ selector: 'sd-query-inline-chip', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SdIcon, CommonModule, SdOperator, SdDate, SdDateRange, SdDatetime, SdSelect], template: "<!--\n Completed inline chip \u2014 non-string/number/seamless branches.\n Edit lifecycle is self-managed: click enters edit + auto-opens picker,\n focusout outside the wrapper exits edit, picker emits commit single OR\n liveChange (multi) OR commitRange (BETWEEN).\n-->\n@let _field = field();\n@let _operator = operator();\n@let _data = data();\n@let _multiple = multiple();\n@let _editing = editing();\n@let _isNoData = isNoData();\n@let _autoId = autoId();\n\n<div\n class=\"c-token\"\n [class.c-token-editing]=\"_editing\"\n [class.c-token-pinned]=\"pinned()\"\n [class.c-token-invalid]=\"invalid()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy() ?? null\">\n <sd-icon class=\"c-token-icon\" [name]=\"iconName()\"></sd-icon>\n <span class=\"c-token-field\">{{ _field.label }}</span>\n\n @if (!_isNoData && showOperator()) {\n <sd-operator class=\"c-token-op\" [operators]=\"[_operator]\" [model]=\"_operator\" size=\"xs\" readonly />\n } @else if (!_isNoData) {\n <span class=\"c-token-sep\">:</span>\n }\n\n @if (!_isNoData) {\n @if (_field.type === 'boolean') {\n @if (_editing) {\n <!-- why: native button thay sd-button \u2014 mat-button MDC baseline 36px bu\u1ED9c\n ph\u1EA3i hack height/padding overrides; chip 28/32px nh\u1ECF h\u01A1n nhi\u1EC1u. T\u1EF1 v\u1EBD\n pill nh\u1ECF v\u1EDBi CSS scoped trong chip, kh\u00F4ng qua MDC, g\u1ECDn + chu\u1EA9n baseline. -->\n <span class=\"c-token-value c-token-value-edit c-bool-toggle\">\n <button\n type=\"button\"\n class=\"c-bool-btn c-bool-true\"\n [class.c-bool-active]=\"_data === true\"\n [attr.data-autoId]=\"_autoId + '-true'\"\n (click)=\"emitBoolean(true)\">\n {{ $any(_field).trueLabel || booleanTrueLabel() }}\n </button>\n <button\n type=\"button\"\n class=\"c-bool-btn c-bool-false\"\n [class.c-bool-active]=\"_data === false\"\n [attr.data-autoId]=\"_autoId + '-false'\"\n (click)=\"emitBoolean(false)\">\n {{ $any(_field).falseLabel || booleanFalseLabel() }}\n </button>\n </span>\n } @else {\n <button type=\"button\" class=\"c-token-value\" (click)=\"enterEdit()\">{{ valueText() }}</button>\n }\n } @else if ((_field.type === 'date' || _field.type === 'datetime') && _operator === 'BETWEEN') {\n <!-- why: sd-date-range [viewed]=\"'inline'\" t\u1EF1 qu\u1EA3n click\u2192edit + focusout (datetime downgrade v\u1EC1 date).\n Chip kh\u00F4ng wiring lifecycle n\u1EEFa; [clearable]=false v\u00EC chip c\u00F3 \u00D7 ri\u00EAng. -->\n <span class=\"c-token-value c-token-value-edit\">\n <sd-date-range size=\"sm\"\n [autoId]=\"_autoId\"\n [viewed]=\"'inline'\"\n [clearable]=\"false\"\n [model]=\"$any(_data)\"\n (sdChange)=\"emitRangeCommit($any($event))\"></sd-date-range>\n </span>\n } @else if (_field.type === 'values' || _field.type === 'lazy-values') {\n @let _opt = $any(_field).option;\n <!-- why: sd-select [viewed]=\"'inline'\" t\u1EF1 qu\u1EA3n click\u2192edit + focusout\u2192tho\u00E1t + bare editor.\n Chip kh\u00F4ng wiring lifecycle cho nh\u00E1nh n\u00E0y n\u1EEFa (b\u1ECF enterEdit/onFocusOut/bare). -->\n <span class=\"c-token-value c-token-value-edit\">\n <sd-select #chipPicker size=\"sm\" minWidthPanel=\"300px\"\n [autoId]=\"_autoId\"\n [items]=\"_field.type === 'lazy-values' ? $any(_opt).search : $any(_opt.items)\"\n [valueField]=\"_opt.valueField\"\n [displayField]=\"_opt.displayField\"\n [multiple]=\"_multiple\"\n [viewed]=\"'inline'\"\n [clearable]=\"false\"\n [model]=\"$any(_data)\"\n (sdChange)=\"_multiple ? emitLive($event) : emitSingleCommit($event)\">\n <!-- why: viewed mode m\u1EB7c \u0111\u1ECBnh d\u00F9ng comma-joined cho multi \u2014 qu\u00E1 d\u00E0i cho chip.\n Override b\u1EB1ng template \"head +N\" gi\u1ED1ng popover chipValueText. -->\n <ng-template #sdValue let-selectedItems=\"selectedItems\">\n @if ((selectedItems?.length ?? 0) > 1) {\n <span class=\"c-token-multi-head\">{{ $any(selectedItems)[0][_opt.displayField] }}</span> +{{ selectedItems.length - 1 }}\n } @else if ((selectedItems?.length ?? 0) === 1) {\n <span class=\"c-token-multi-head\">{{ $any(selectedItems)[0][_opt.displayField] }}</span>\n }\n </ng-template>\n </sd-select>\n </span>\n } @else if (_field.type === 'date') {\n <span class=\"c-token-value c-token-value-edit\">\n <sd-date size=\"sm\"\n [autoId]=\"_autoId\"\n [viewed]=\"'inline'\"\n [clearable]=\"false\"\n [model]=\"$any(_data)\"\n (sdChange)=\"emitSingleCommit($any($event))\"></sd-date>\n </span>\n } @else if (_field.type === 'datetime') {\n <span class=\"c-token-value c-token-value-edit\">\n <sd-datetime size=\"sm\"\n [autoId]=\"_autoId\"\n [viewed]=\"'inline'\"\n [clearable]=\"false\"\n [model]=\"$any(_data)\"\n (sdChange)=\"emitSingleCommit($any($event))\"></sd-datetime>\n </span>\n } @else {\n <!-- Fallback (unforeseen type) \u2014 read-only display via valueText. -->\n <span class=\"c-token-value\">{{ valueText() }}</span>\n }\n }\n\n @if (!pinned()) {\n <button type=\"button\" class=\"c-token-remove\" aria-label=\"Remove filter\" (click)=\"remove.emit()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n</div>\n", styles: [":host{display:contents}.c-token{display:inline-flex;align-items:center;gap:4px;padding:0 0 0 12px;border:1px solid var(--sd-primary-light);border-radius:999px;background:var(--sd-primary-light);font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text-secondary, #5f6368);white-space:nowrap;overflow:hidden}:host-context(.c-density-compact) .c-token{height:28px}:host-context(.c-density-comfortable) .c-token{height:32px}.c-token.c-token-pinned{padding-right:12px}.c-token.c-token-invalid{border-color:var(--sd-query-bar-chip-danger, #d23535);background:var(--sd-query-bar-chip-danger-bg, #fff5f5);color:var(--sd-query-bar-chip-danger, #d23535)}.c-token-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px;line-height:14px;color:inherit}.c-token-field{font-weight:var(--sd-font-weight-medium, 500);line-height:1}.c-token-op{display:inline-flex;align-items:center;color:inherit}.c-token-sep{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-token-value{border:none;background:transparent;padding:0;font:inherit;font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-primary);cursor:pointer}.c-token-value:hover{text-decoration:underline}.c-token-value-edit{display:inline-flex;align-items:center;gap:4px;max-width:240px}.c-token-value-edit sd-date-range{display:inline-flex;max-width:220px;min-width:0;flex:0 1 auto}.c-token-value-edit sd-select,.c-token-value-edit sd-date,.c-token-value-edit sd-datetime{display:inline-flex;align-items:center;line-height:1}.c-token ::ng-deep .mat-mdc-form-field{line-height:1}.c-token ::ng-deep .mat-mdc-text-field-wrapper,.c-token ::ng-deep .mat-mdc-form-field-flex{padding:0;min-height:0;background:transparent}.c-token ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}.c-token ::ng-deep .mat-mdc-select-value,.c-token ::ng-deep .mat-mdc-input-element,.c-token ::ng-deep input{line-height:1;font-size:var(--sd-font-size-13, 13px);padding:0;height:auto;color:inherit}.c-token ::ng-deep .mat-mdc-select-value{display:inline-flex;align-items:center;min-width:0;max-width:200px;overflow:hidden;text-overflow:ellipsis;color:var(--sd-primary);font-weight:var(--sd-font-weight-medium, 500)}.c-token ::ng-deep .sd-suffix-icon{display:none}.c-token-multi-head{display:inline-block;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}.c-bool-toggle{display:inline-flex;align-items:center;gap:4px}.c-bool-btn{display:inline-flex;align-items:center;justify-content:center;height:18px;min-width:0;padding:0 8px;border:1px solid currentColor;border-radius:var(--sd-radius-999, 999px);background:transparent;font:inherit;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:1;cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;transition:background var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}:host-context(.c-density-comfortable) .c-bool-btn{height:20px;padding:0 10px;font-size:var(--sd-font-size-12, 12px)}.c-bool-true{color:var(--sd-success)}.c-bool-false{color:var(--sd-warning)}.c-bool-active.c-bool-true{background:var(--sd-success);color:var(--sd-text-on-solid, #ffffff);border-color:var(--sd-success)}.c-bool-active.c-bool-false{background:var(--sd-warning);color:var(--sd-text-on-solid, #ffffff);border-color:var(--sd-warning)}.c-bool-btn:hover:not(.c-bool-active).c-bool-true{background:var(--sd-success-light)}.c-bool-btn:hover:not(.c-bool-active).c-bool-false{background:var(--sd-warning-light)}.c-token-remove{align-self:stretch;display:inline-flex;align-items:center;justify-content:center;border:none;border-left:1px solid rgba(0,0,0,.04);border-radius:0;background:transparent;cursor:pointer;color:inherit}:host-context(.c-density-compact) .c-token-remove{width:26px}:host-context(.c-density-comfortable) .c-token-remove{width:28px}.c-token-remove sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-token-remove:hover{background:#0000000d}\n"] }]
1030
- }], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: true }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], showOperator: [{ type: i0.Input, args: [{ isSignal: true, alias: "showOperator", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], valueText: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueText", required: false }] }], isNoData: [{ type: i0.Input, args: [{ isSignal: true, alias: "isNoData", required: false }] }], pinned: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinned", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], describedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "describedBy", required: false }] }], commit: [{ type: i0.Output, args: ["commit"] }], commitRange: [{ type: i0.Output, args: ["commitRange"] }], liveChange: [{ type: i0.Output, args: ["liveChange"] }], remove: [{ type: i0.Output, args: ["remove"] }] } });
1833
+ args: [{ selector: 'sd-query-inline-chip', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SdIcon, CommonModule, SdOperator, SdDate, SdDateRange, SdDatetime, SdSelect], template: "<!--\n Completed inline chip \u2014 non-string/number/seamless branches.\n Edit lifecycle is self-managed: click enters edit + auto-opens picker,\n focusout outside the wrapper exits edit, picker emits commit single OR\n liveChange (multi) OR commitRange (BETWEEN).\n-->\n@let _field = field();\n@let _operator = operator();\n@let _data = data();\n@let _multiple = multiple();\n@let _editing = editing();\n@let _isNoData = isNoData();\n@let _autoId = autoId();\n\n<div\n class=\"c-token\"\n [class.c-token-editing]=\"_editing\"\n [class.c-token-pinned]=\"pinned()\"\n [class.c-token-invalid]=\"invalid()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedByIds()\">\n <sd-icon class=\"c-token-icon\" [name]=\"iconName()\"></sd-icon>\n <span class=\"c-token-field\">{{ _field.label }}</span>\n\n @if (!_isNoData && showOperator()) {\n <sd-operator class=\"c-token-op\" [operators]=\"[_operator]\" [model]=\"_operator\" size=\"xs\" readonly />\n } @else if (!_isNoData) {\n <span class=\"c-token-sep\">:</span>\n }\n\n @if (!_isNoData) {\n @if (_field.type === 'boolean') {\n @if (_editing) {\n <!-- why: native button thay sd-button \u2014 mat-button MDC baseline 36px bu\u1ED9c\n ph\u1EA3i hack height/padding overrides; chip 28/32px nh\u1ECF h\u01A1n nhi\u1EC1u. T\u1EF1 v\u1EBD\n pill nh\u1ECF v\u1EDBi CSS scoped trong chip, kh\u00F4ng qua MDC, g\u1ECDn + chu\u1EA9n baseline. -->\n <span class=\"c-token-value c-token-value-edit c-bool-toggle\">\n <button\n type=\"button\"\n class=\"c-bool-btn c-bool-true\"\n [class.c-bool-active]=\"_data === true\"\n [attr.data-autoId]=\"_autoId + '-true'\"\n (click)=\"emitBoolean(true)\">\n {{ $any(_field).trueLabel || booleanTrueLabel() }}\n </button>\n <button\n type=\"button\"\n class=\"c-bool-btn c-bool-false\"\n [class.c-bool-active]=\"_data === false\"\n [attr.data-autoId]=\"_autoId + '-false'\"\n (click)=\"emitBoolean(false)\">\n {{ $any(_field).falseLabel || booleanFalseLabel() }}\n </button>\n </span>\n } @else {\n <button type=\"button\" class=\"c-token-value\" (click)=\"enterEdit()\">{{ valueText() }}</button>\n }\n } @else if ((_field.type === 'date' || _field.type === 'datetime') && _operator === 'BETWEEN') {\n <!-- why: sd-date-range [viewed]=\"'inline'\" t\u1EF1 qu\u1EA3n click\u2192edit + focusout (datetime downgrade v\u1EC1 date).\n Chip kh\u00F4ng wiring lifecycle n\u1EEFa; [clearable]=false v\u00EC chip c\u00F3 \u00D7 ri\u00EAng. -->\n <span class=\"c-token-value c-token-value-edit\">\n <sd-date-range size=\"sm\"\n [autoId]=\"_autoId\"\n [viewed]=\"'inline'\"\n [clearable]=\"false\"\n [model]=\"$any(_data)\"\n (sdChange)=\"emitRangeCommit($any($event))\"></sd-date-range>\n </span>\n } @else if (_field.type === 'values' || _field.type === 'lazy-values') {\n @let _opt = $any(_field).option;\n <!-- why: sd-select [viewed]=\"'inline'\" t\u1EF1 qu\u1EA3n click\u2192edit + focusout\u2192tho\u00E1t + bare editor.\n Chip kh\u00F4ng wiring lifecycle cho nh\u00E1nh n\u00E0y n\u1EEFa (b\u1ECF enterEdit/onFocusOut/bare). -->\n <span class=\"c-token-value c-token-value-edit\">\n <sd-select #chipPicker size=\"sm\" minWidthPanel=\"300px\"\n [autoId]=\"_autoId\"\n [items]=\"_field.type === 'lazy-values' ? $any(_opt).search : $any(_opt.items)\"\n [valueField]=\"_opt.valueField\"\n [displayField]=\"_opt.displayField\"\n [multiple]=\"_multiple\"\n [viewed]=\"'inline'\"\n [clearable]=\"false\"\n [required]=\"required()\"\n [model]=\"$any(selectModel())\"\n (sdChange)=\"_multiple ? emitLive($event) : emitSingleCommit($event)\">\n <!-- why: viewed mode m\u1EB7c \u0111\u1ECBnh d\u00F9ng comma-joined cho multi \u2014 qu\u00E1 d\u00E0i cho chip.\n Override b\u1EB1ng template \"head +N\" gi\u1ED1ng popover chipValueText. -->\n <ng-template #sdValue let-selectedItems=\"selectedItems\">\n @if ((selectedItems?.length ?? 0) > 1) {\n <span class=\"c-token-multi-head\">{{ $any(selectedItems)[0][_opt.displayField] }}</span> +{{ selectedItems.length - 1 }}\n } @else if ((selectedItems?.length ?? 0) === 1) {\n <span class=\"c-token-multi-head\">{{ $any(selectedItems)[0][_opt.displayField] }}</span>\n }\n </ng-template>\n </sd-select>\n </span>\n } @else if (_field.type === 'date') {\n <span class=\"c-token-value c-token-value-edit\">\n <sd-date size=\"sm\"\n [autoId]=\"_autoId\"\n [viewed]=\"'inline'\"\n [clearable]=\"false\"\n [model]=\"$any(_data)\"\n (sdChange)=\"emitSingleCommit($any($event))\"></sd-date>\n </span>\n } @else if (_field.type === 'datetime') {\n <span class=\"c-token-value c-token-value-edit\">\n <sd-datetime size=\"sm\"\n [autoId]=\"_autoId\"\n [viewed]=\"'inline'\"\n [clearable]=\"false\"\n [model]=\"$any(_data)\"\n (sdChange)=\"emitSingleCommit($any($event))\"></sd-datetime>\n </span>\n } @else {\n <!-- Fallback (unforeseen type) \u2014 read-only display via valueText. -->\n <span class=\"c-token-value\">{{ valueText() }}</span>\n }\n }\n\n @if (!pinned()) {\n <button type=\"button\" class=\"c-token-remove\" [attr.aria-label]=\"removeLabel()\" (click)=\"remove.emit()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n</div>\n<!-- why: ngo\u00E0i .c-token (overflow: hidden c\u1EAFt n\u1ED9i dung) \u2014 host l\u00E0 display: contents n\u00EAn d\u00F2ng nh\u1EAFc n\u1EB1m ngay sau chip. -->\n@if (minOneHint()) {\n <span class=\"c-token-required-hint\" aria-live=\"polite\" [id]=\"hintId\">{{ minOneLabel() }}</span>\n}\n", styles: [":host{display:contents}.c-token{display:inline-flex;align-items:center;gap:4px;padding:0 0 0 12px;border:1px solid var(--sd-primary-light);border-radius:999px;background:var(--sd-primary-light);font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text-secondary, #5f6368);white-space:nowrap;overflow:hidden}:host-context(.c-density-compact) .c-token{height:28px}:host-context(.c-density-comfortable) .c-token{height:32px}.c-token.c-token-pinned{padding-right:12px}.c-token.c-token-invalid{border-color:var(--sd-query-bar-chip-danger, #d23535);background:var(--sd-query-bar-chip-danger-bg, #fff5f5);color:var(--sd-query-bar-chip-danger, #d23535)}.c-token:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.c-token-required-hint{align-self:center;font-size:var(--sd-font-size-12, 12px);color:var(--sd-text-secondary, #555);white-space:nowrap}.c-token-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px;line-height:14px;color:inherit}.c-token-field{font-weight:var(--sd-font-weight-medium, 500);line-height:1}.c-token-op{display:inline-flex;align-items:center;color:inherit}.c-token-sep{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-token-value{border:none;background:transparent;padding:0;font:inherit;font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-primary);cursor:pointer}.c-token-value:hover{text-decoration:underline}.c-token-value-edit{display:inline-flex;align-items:center;gap:4px;max-width:240px}.c-token-value-edit sd-date-range{display:inline-flex;max-width:220px;min-width:0;flex:0 1 auto}.c-token-value-edit sd-select,.c-token-value-edit sd-date,.c-token-value-edit sd-datetime{display:inline-flex;align-items:center;line-height:1}.c-token ::ng-deep .mat-mdc-form-field{line-height:1}.c-token ::ng-deep .mat-mdc-text-field-wrapper,.c-token ::ng-deep .mat-mdc-form-field-flex{padding:0;min-height:0;background:transparent}.c-token ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}.c-token ::ng-deep .mat-mdc-select-value,.c-token ::ng-deep .mat-mdc-input-element,.c-token ::ng-deep input{line-height:1;font-size:var(--sd-font-size-13, 13px);padding:0;height:auto;color:inherit}.c-token ::ng-deep .mat-mdc-select-value{display:inline-flex;align-items:center;min-width:0;max-width:200px;overflow:hidden;text-overflow:ellipsis;color:var(--sd-primary);font-weight:var(--sd-font-weight-medium, 500)}.c-token ::ng-deep .sd-suffix-icon{display:none}.c-token-multi-head{display:inline-block;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}.c-bool-toggle{display:inline-flex;align-items:center;gap:4px}.c-bool-btn{display:inline-flex;align-items:center;justify-content:center;height:18px;min-width:0;padding:0 8px;border:1px solid currentColor;border-radius:var(--sd-radius-999, 999px);background:transparent;font:inherit;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:1;cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;transition:background var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}:host-context(.c-density-comfortable) .c-bool-btn{height:20px;padding:0 10px;font-size:var(--sd-font-size-12, 12px)}.c-bool-true{color:var(--sd-success)}.c-bool-false{color:var(--sd-warning)}.c-bool-active.c-bool-true{background:var(--sd-success);color:var(--sd-text-on-solid, #ffffff);border-color:var(--sd-success)}.c-bool-active.c-bool-false{background:var(--sd-warning);color:var(--sd-text-on-solid, #ffffff);border-color:var(--sd-warning)}.c-bool-btn:hover:not(.c-bool-active).c-bool-true{background:var(--sd-success-light)}.c-bool-btn:hover:not(.c-bool-active).c-bool-false{background:var(--sd-warning-light)}.c-token-remove{align-self:stretch;display:inline-flex;align-items:center;justify-content:center;border:none;border-left:1px solid rgba(0,0,0,.04);border-radius:0;background:transparent;cursor:pointer;color:inherit}:host-context(.c-density-compact) .c-token-remove{width:26px}:host-context(.c-density-comfortable) .c-token-remove{width:28px}.c-token-remove sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-token-remove:hover{background:#0000000d}\n"] }]
1834
+ }], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: true }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], showOperator: [{ type: i0.Input, args: [{ isSignal: true, alias: "showOperator", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], valueText: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueText", required: false }] }], isNoData: [{ type: i0.Input, args: [{ isSignal: true, alias: "isNoData", required: false }] }], pinned: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinned", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], describedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "describedBy", required: false }] }], commit: [{ type: i0.Output, args: ["commit"] }], commitRange: [{ type: i0.Output, args: ["commitRange"] }], liveChange: [{ type: i0.Output, args: ["liveChange"] }], remove: [{ type: i0.Output, args: ["remove"] }], dateControl: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdDate), { isSignal: true }] }], datetimeControl: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdDatetime), { isSignal: true }] }], dateRangeControl: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdDateRange), { isSignal: true }] }] } });
1031
1835
 
1032
1836
  /**
1033
- * Compact popover-mode chip face. Click → opens the parent-supplied [menu] (mat-menu
1034
- * containing the chip editor). Inert div[role=button] so the nested <sd-operator>
1035
- * doesn't end up as a button-in-button (invalid HTML).
1837
+ * Compact popover-mode chip face. Click, Enter or Space → opens the parent-supplied [panel] (the chip popover dialog).
1838
+ * Inert div[role=button] so the nested <sd-operator> doesn't end up as a button-in-button (invalid HTML).
1839
+ * The × is a `<button>` beside that trigger, never inside it.
1036
1840
  */
1037
1841
  class SdQueryPopoverChip {
1038
1842
  /** Resolved field (from the bar's `fieldByKey()` map). `undefined` → render raw key. */
@@ -1051,58 +1855,56 @@ class SdQueryPopoverChip {
1051
1855
  pinned = input(false, ...(ngDevMode ? [{ debugName: "pinned" }] : /* istanbul ignore next */ []));
1052
1856
  /** Read-only chip — does not open its popover. */
1053
1857
  disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
1858
+ /** Chip of a required field — `aria-required`. */
1859
+ required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
1054
1860
  /** Required chip without a value — error look, `aria-invalid`. */
1055
1861
  invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
1056
1862
  /** Id set as `aria-describedby` (the host's required hint). */
1057
1863
  describedBy = input(undefined, ...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
1058
- /** Chip popover mat-menu instance supplied by the parent. */
1059
- menu = input.required(...(ngDevMode ? [{ debugName: "menu" }] : /* istanbul ignore next */ []));
1060
- /** Fired when the chip popover opens (parent seeds its editing state). */
1864
+ /** Chip popover panel supplied by the parent. */
1865
+ panel = input.required(...(ngDevMode ? [{ debugName: "panel" }] : /* istanbul ignore next */ []));
1866
+ /** Fired when the chip popover opens, before it renders (parent seeds its editing state). */
1061
1867
  open = output();
1062
1868
  /** Fired when the user clicks the × removal icon. */
1063
1869
  remove = output();
1064
1870
  iconFor = sdQueryFieldIcon;
1871
+ #i18n = inject(I18nService);
1872
+ /** `aria-label` of the × — names the field, in the current language. */
1873
+ removeLabel = computed(() => this.#i18n.t('core.component.query-bar.remove-filter', { label: this.field()?.label || this.filterField() }), ...(ngDevMode ? [{ debugName: "removeLabel" }] : /* istanbul ignore next */ []));
1065
1874
  filterField() {
1066
1875
  return this.filter().field;
1067
1876
  }
1068
1877
  filterOperator() {
1069
1878
  return this.filter().operator;
1070
1879
  }
1071
- // why: parent's add/swap flow auto-opens the chip popover after render, and removeFilter
1072
- // closes the open one — expose open/close so the parent doesn't need a ViewChild on the
1073
- // internal MatMenuTrigger directive.
1074
- trigger = viewChild('chipTrigger', { ...(ngDevMode ? { debugName: "trigger" } : /* istanbul ignore next */ {}), read: MatMenuTrigger });
1880
+ // why: parent's add flow auto-opens the chip popover after render, and removeFilter closes the open one — expose
1881
+ // open/close so the parent doesn't need a ViewChild on the internal panel trigger.
1882
+ trigger = viewChild('chipTrigger', { ...(ngDevMode ? { debugName: "trigger" } : /* istanbul ignore next */ {}), read: ɵSdQueryPanelTriggerDirective });
1883
+ /** The chip popover is open for this chip. */
1884
+ isOpen() {
1885
+ return !!this.trigger()?.expanded();
1886
+ }
1075
1887
  /**
1076
1888
  * Opens the chip popover. With `returnFocusTo`, that element (e.g. the host control that asked
1077
1889
  * for the chip) gets focus back when the popover closes, instead of the chip.
1078
1890
  */
1079
1891
  openMenu(returnFocusTo) {
1080
- const trigger = this.trigger();
1081
- if (!trigger)
1082
- return;
1083
- if (returnFocusTo) {
1084
- trigger.restoreFocus = false;
1085
- trigger.menuClosed.pipe(take(1)).subscribe(() => {
1086
- trigger.restoreFocus = true;
1087
- returnFocusTo.focus();
1088
- });
1089
- }
1090
- trigger.openMenu();
1892
+ this.trigger()?.openMenu(returnFocusTo);
1091
1893
  }
1092
1894
  closeMenu() {
1093
1895
  this.trigger()?.closeMenu();
1094
1896
  }
1095
1897
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQueryPopoverChip, deps: [], target: i0.ɵɵFactoryTarget.Component });
1096
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdQueryPopoverChip, isStandalone: true, selector: "sd-query-popover-chip", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: true, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: true, transformFunction: null }, showOperator: { classPropertyName: "showOperator", publicName: "showOperator", isSignal: true, isRequired: false, transformFunction: null }, valueText: { classPropertyName: "valueText", publicName: "valueText", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, pinned: { classPropertyName: "pinned", publicName: "pinned", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, describedBy: { classPropertyName: "describedBy", publicName: "describedBy", isSignal: true, isRequired: false, transformFunction: null }, menu: { classPropertyName: "menu", publicName: "menu", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { open: "open", remove: "remove" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["chipTrigger"], descendants: true, read: MatMenuTrigger, isSignal: true }], ngImport: i0, template: "<!-- why: div[role=button] (not <button>) so the nested <sd-operator> isn't button-in-button (invalid HTML). -->\n@let _active = active();\n@let _field = field();\n@let _filterField = filterField();\n@let _filterOperator = filterOperator();\n@let _emptyText = emptyText();\n@let _invalid = invalid();\n\n@if (disabled()) {\n <!-- why: chip ch\u1EC9 \u0111\u1ECDc kh\u00F4ng g\u1EAFn matMenuTrigger \u2014 kh\u00F4ng c\u00F3 c\u00E1ch n\u00E0o m\u1EDF popover, k\u1EC3 c\u1EA3 openMenu() c\u1EE7a parent. -->\n <div\n role=\"button\"\n tabindex=\"0\"\n aria-disabled=\"true\"\n class=\"c-chip c-chip-disabled\"\n [class.c-chip-active]=\"_active\"\n [class.c-chip-inactive]=\"!_active\"\n [attr.data-field]=\"_filterField\"\n [matTooltip]=\"_field?.label || _filterField\">\n <ng-container [ngTemplateOutlet]=\"face\" />\n </div>\n} @else {\n <div\n #chipTrigger=\"matMenuTrigger\"\n role=\"button\"\n tabindex=\"0\"\n class=\"c-chip\"\n [class.c-chip-active]=\"_active\"\n [class.c-chip-inactive]=\"!_active\"\n [class.c-chip-pinned]=\"pinned()\"\n [class.c-chip-invalid]=\"_invalid\"\n [attr.aria-invalid]=\"_invalid ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy() ?? null\"\n [attr.data-field]=\"_filterField\"\n [matTooltip]=\"_field?.label || _filterField\"\n [matMenuTriggerFor]=\"menu()\"\n (menuOpened)=\"open.emit()\"\n (keydown.enter)=\"chipTrigger.openMenu()\"\n (keydown.space)=\"$event.preventDefault(); chipTrigger.openMenu()\">\n <ng-container [ngTemplateOutlet]=\"face\" />\n </div>\n}\n\n<ng-template #face>\n <sd-icon class=\"c-chip-icon\" [name]=\"_field ? iconFor(_field) : 'tune'\"></sd-icon>\n <span class=\"c-chip-label\">{{ _field?.label || _filterField }}</span>\n\n @if (showOperator() && _active) {\n <sd-operator class=\"c-chip-operator\" [operators]=\"[_filterOperator]\" [model]=\"_filterOperator\" size=\"xs\" readonly />\n } @else if (_active || _emptyText) {\n <span class=\"c-chip-sep\">:</span>\n }\n\n @if (_active) {\n <span class=\"c-chip-value\">{{ valueText() }}</span>\n } @else if (_emptyText) {\n <span class=\"c-chip-value c-chip-value--empty\">{{ _emptyText }}</span>\n }\n\n <sd-icon class=\"c-chip-chevron\" name=\"arrow_drop_down\"></sd-icon>\n\n @if (_active && !pinned() && !disabled()) {\n <span\n role=\"button\"\n tabindex=\"0\"\n class=\"c-chip-remove\"\n aria-label=\"Remove filter\"\n (click)=\"$event.stopPropagation(); remove.emit()\"\n (keydown.enter)=\"$event.stopPropagation(); remove.emit()\">\n <sd-icon name=\"close\"></sd-icon>\n </span>\n }\n</ng-template>\n", styles: [":host{display:contents}.c-chip{display:inline-flex;align-items:center;gap:4px;padding:0 4px 0 10px;border-radius:999px;border:1px solid var(--sd-query-bar-border, #d6d8db);background:var(--sd-query-bar-bg, #ffffff);cursor:pointer;font-family:inherit;font-size:var(--sd-font-size-13, 13px);font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-query-bar-text-secondary, #5f6368);transition:background-color var(--sd-duration-fast, .12s) ease,border-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}:host-context(.c-density-compact) .c-chip{height:28px}:host-context(.c-density-comfortable) .c-chip{height:32px}.c-chip:hover{border-color:var(--sd-primary)}.c-chip.c-chip-active{border-color:var(--sd-primary-light);background:var(--sd-primary-light)}.c-chip.c-chip-active .c-chip-value{color:var(--sd-primary)}.c-chip.c-chip-inactive{padding-right:10px}.c-chip.c-chip-pinned.c-chip-active{padding-right:4px}.c-chip.c-chip-invalid{border-color:var(--sd-query-bar-chip-danger, #d23535);background:var(--sd-query-bar-chip-danger-bg, #fff5f5);color:var(--sd-query-bar-chip-danger, #d23535)}.c-chip.c-chip-invalid .c-chip-value{color:var(--sd-query-bar-chip-danger, #d23535)}.c-chip.c-chip-disabled{cursor:default;opacity:.6}.c-chip.c-chip-disabled:hover{border-color:var(--sd-query-bar-border, #d6d8db)}.c-chip.c-chip-disabled.c-chip-active:hover{border-color:var(--sd-primary-light)}.c-chip .c-chip-icon{font-size:var(--sd-font-size-16, 16px);width:16px;height:16px}.c-chip .c-chip-label{font-weight:var(--sd-font-weight-medium, 500);white-space:nowrap}.c-chip .c-chip-operator{display:inline-flex;align-items:center;color:inherit}.c-chip .c-chip-sep{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-chip .c-chip-value{font-weight:var(--sd-font-weight-medium, 500);max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-chip .c-chip-value.c-chip-value--empty{font-weight:var(--sd-font-weight-regular, 400);color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-chip .c-chip-chevron{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px;color:currentColor}.c-chip .c-chip-remove{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;cursor:pointer;color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-chip .c-chip-remove sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-chip .c-chip-remove:hover{background:#0000000f}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "directive", type: i1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: SdOperator, selector: "sd-operator", inputs: ["model", "operators", "disabled", "autoId", "size", "readonly", "active", "showCode"], outputs: ["modelChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1898
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdQueryPopoverChip, isStandalone: true, selector: "sd-query-popover-chip", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: true, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: true, transformFunction: null }, showOperator: { classPropertyName: "showOperator", publicName: "showOperator", isSignal: true, isRequired: false, transformFunction: null }, valueText: { classPropertyName: "valueText", publicName: "valueText", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, pinned: { classPropertyName: "pinned", publicName: "pinned", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, describedBy: { classPropertyName: "describedBy", publicName: "describedBy", isSignal: true, isRequired: false, transformFunction: null }, panel: { classPropertyName: "panel", publicName: "panel", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { open: "open", remove: "remove" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["chipTrigger"], descendants: true, read: ɵSdQueryPanelTriggerDirective, isSignal: true }], ngImport: i0, template: "<!-- why: div[role=button] (not <button>) so the nested <sd-operator> isn't button-in-button (invalid HTML). -->\n@let _active = active();\n@let _field = field();\n@let _filterField = filterField();\n@let _filterOperator = filterOperator();\n@let _emptyText = emptyText();\n@let _invalid = invalid();\n@let _removable = _active && !pinned();\n\n<!-- why: n\u00FAt \u00D7 l\u00E0 anh em c\u1EE7a trigger, kh\u00F4ng n\u1EB1m trong n\u00F3 (n\u00FAt l\u1ED3ng n\u00FAt \u2014 R1 G-4). V\u1ECF `.c-chip-shell` \u0111\u1EB7t \u00D7 \u0111\u00E8 l\u00EAn \u0111u\u00F4i\n vi\u00EAn chip, n\u00EAn chip gi\u1EEF nguy\u00EAn k\u00EDch th\u01B0\u1EDBc v\u00E0 h\u00ECnh d\u1EA1ng. -->\n<div class=\"c-chip-shell\">\n @if (disabled()) {\n <!-- why: chip ch\u1EC9 \u0111\u1ECDc kh\u00F4ng g\u1EAFn trigger c\u1EE7a panel \u2014 kh\u00F4ng c\u00F3 c\u00E1ch n\u00E0o m\u1EDF popover, k\u1EC3 c\u1EA3 openMenu() c\u1EE7a parent. -->\n <div\n role=\"button\"\n tabindex=\"0\"\n aria-disabled=\"true\"\n class=\"c-chip c-chip-disabled\"\n [class.c-chip-active]=\"_active\"\n [class.c-chip-inactive]=\"!_active\"\n [attr.data-field]=\"_filterField\"\n [matTooltip]=\"_field?.label || _filterField\">\n <ng-container [ngTemplateOutlet]=\"face\" />\n </div>\n } @else {\n <div\n #chipTrigger\n role=\"button\"\n tabindex=\"0\"\n class=\"c-chip\"\n [class.c-chip-active]=\"_active\"\n [class.c-chip-inactive]=\"!_active\"\n [class.c-chip-pinned]=\"pinned()\"\n [class.c-chip-removable]=\"_removable\"\n [class.c-chip-invalid]=\"_invalid\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"_invalid ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy() ?? null\"\n [attr.data-field]=\"_filterField\"\n [matTooltip]=\"_field?.label || _filterField\"\n [sdQueryPanelTrigger]=\"panel()\"\n (panelOpened)=\"open.emit()\">\n <ng-container [ngTemplateOutlet]=\"face\" />\n </div>\n\n @if (_removable) {\n <button type=\"button\" class=\"c-chip-remove\" [attr.aria-label]=\"removeLabel()\" (click)=\"$event.stopPropagation(); remove.emit()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n }\n</div>\n\n<ng-template #face>\n <sd-icon class=\"c-chip-icon\" [name]=\"_field ? iconFor(_field) : 'tune'\"></sd-icon>\n <span class=\"c-chip-label\">{{ _field?.label || _filterField }}</span>\n\n @if (showOperator() && _active) {\n <sd-operator class=\"c-chip-operator\" [operators]=\"[_filterOperator]\" [model]=\"_filterOperator\" size=\"xs\" readonly />\n } @else if (_active || _emptyText) {\n <span class=\"c-chip-sep\">:</span>\n }\n\n @if (_active) {\n <span class=\"c-chip-value\">{{ valueText() }}</span>\n } @else if (_emptyText) {\n <span class=\"c-chip-value c-chip-value--empty\">{{ _emptyText }}</span>\n }\n\n <sd-icon class=\"c-chip-chevron\" name=\"arrow_drop_down\"></sd-icon>\n</ng-template>\n", styles: [":host{display:contents}.c-chip-shell{position:relative;display:inline-flex;align-items:center}.c-chip{display:inline-flex;align-items:center;gap:4px;padding:0 4px 0 10px;border-radius:999px;border:1px solid var(--sd-query-bar-border, #d6d8db);background:var(--sd-query-bar-bg, #ffffff);cursor:pointer;font-family:inherit;font-size:var(--sd-font-size-13, 13px);font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-query-bar-text-secondary, #5f6368);transition:background-color var(--sd-duration-fast, .12s) ease,border-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}:host-context(.c-density-compact) .c-chip{height:28px}:host-context(.c-density-comfortable) .c-chip{height:32px}.c-chip:hover{border-color:var(--sd-primary)}.c-chip.c-chip-active{border-color:var(--sd-primary-light);background:var(--sd-primary-light)}.c-chip.c-chip-active .c-chip-value{color:var(--sd-primary)}.c-chip.c-chip-inactive{padding-right:10px}.c-chip.c-chip-pinned.c-chip-active{padding-right:4px}.c-chip.c-chip-removable{padding-right:28px}.c-chip.c-chip-invalid{border-color:var(--sd-query-bar-chip-danger, #d23535);background:var(--sd-query-bar-chip-danger-bg, #fff5f5);color:var(--sd-query-bar-chip-danger, #d23535)}.c-chip.c-chip-invalid .c-chip-value{color:var(--sd-query-bar-chip-danger, #d23535)}.c-chip.c-chip-disabled{cursor:default;opacity:.6}.c-chip.c-chip-disabled:hover{border-color:var(--sd-query-bar-border, #d6d8db)}.c-chip.c-chip-disabled.c-chip-active:hover{border-color:var(--sd-primary-light)}.c-chip .c-chip-icon{font-size:var(--sd-font-size-16, 16px);width:16px;height:16px}.c-chip .c-chip-label{font-weight:var(--sd-font-weight-medium, 500);white-space:nowrap}.c-chip .c-chip-operator{display:inline-flex;align-items:center;color:inherit}.c-chip .c-chip-sep{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-chip .c-chip-value{font-weight:var(--sd-font-weight-medium, 500);max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-chip .c-chip-value.c-chip-value--empty{font-weight:var(--sd-font-weight-regular, 400);color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-chip .c-chip-chevron{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px;color:currentColor}.c-chip-remove{position:absolute;top:50%;right:5px;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:20px;height:20px;padding:0;border:0;border-radius:50%;background:transparent;font:inherit;cursor:pointer;color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-chip-remove sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-chip-remove:hover{background:#0000000f}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: SdOperator, selector: "sd-operator", inputs: ["model", "operators", "disabled", "autoId", "size", "readonly", "active", "showCode"], outputs: ["modelChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: ɵSdQueryPanelTriggerDirective, selector: "[sdQueryPanelTrigger]", inputs: ["sdQueryPanelTrigger"], outputs: ["panelOpened", "panelClosed"], exportAs: ["sdQueryPanelTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1097
1899
  }
1098
1900
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQueryPopoverChip, decorators: [{
1099
1901
  type: Component,
1100
- args: [{ selector: 'sd-query-popover-chip', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SdIcon, MatMenuModule, MatTooltipModule, SdOperator, NgTemplateOutlet], template: "<!-- why: div[role=button] (not <button>) so the nested <sd-operator> isn't button-in-button (invalid HTML). -->\n@let _active = active();\n@let _field = field();\n@let _filterField = filterField();\n@let _filterOperator = filterOperator();\n@let _emptyText = emptyText();\n@let _invalid = invalid();\n\n@if (disabled()) {\n <!-- why: chip ch\u1EC9 \u0111\u1ECDc kh\u00F4ng g\u1EAFn matMenuTrigger \u2014 kh\u00F4ng c\u00F3 c\u00E1ch n\u00E0o m\u1EDF popover, k\u1EC3 c\u1EA3 openMenu() c\u1EE7a parent. -->\n <div\n role=\"button\"\n tabindex=\"0\"\n aria-disabled=\"true\"\n class=\"c-chip c-chip-disabled\"\n [class.c-chip-active]=\"_active\"\n [class.c-chip-inactive]=\"!_active\"\n [attr.data-field]=\"_filterField\"\n [matTooltip]=\"_field?.label || _filterField\">\n <ng-container [ngTemplateOutlet]=\"face\" />\n </div>\n} @else {\n <div\n #chipTrigger=\"matMenuTrigger\"\n role=\"button\"\n tabindex=\"0\"\n class=\"c-chip\"\n [class.c-chip-active]=\"_active\"\n [class.c-chip-inactive]=\"!_active\"\n [class.c-chip-pinned]=\"pinned()\"\n [class.c-chip-invalid]=\"_invalid\"\n [attr.aria-invalid]=\"_invalid ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy() ?? null\"\n [attr.data-field]=\"_filterField\"\n [matTooltip]=\"_field?.label || _filterField\"\n [matMenuTriggerFor]=\"menu()\"\n (menuOpened)=\"open.emit()\"\n (keydown.enter)=\"chipTrigger.openMenu()\"\n (keydown.space)=\"$event.preventDefault(); chipTrigger.openMenu()\">\n <ng-container [ngTemplateOutlet]=\"face\" />\n </div>\n}\n\n<ng-template #face>\n <sd-icon class=\"c-chip-icon\" [name]=\"_field ? iconFor(_field) : 'tune'\"></sd-icon>\n <span class=\"c-chip-label\">{{ _field?.label || _filterField }}</span>\n\n @if (showOperator() && _active) {\n <sd-operator class=\"c-chip-operator\" [operators]=\"[_filterOperator]\" [model]=\"_filterOperator\" size=\"xs\" readonly />\n } @else if (_active || _emptyText) {\n <span class=\"c-chip-sep\">:</span>\n }\n\n @if (_active) {\n <span class=\"c-chip-value\">{{ valueText() }}</span>\n } @else if (_emptyText) {\n <span class=\"c-chip-value c-chip-value--empty\">{{ _emptyText }}</span>\n }\n\n <sd-icon class=\"c-chip-chevron\" name=\"arrow_drop_down\"></sd-icon>\n\n @if (_active && !pinned() && !disabled()) {\n <span\n role=\"button\"\n tabindex=\"0\"\n class=\"c-chip-remove\"\n aria-label=\"Remove filter\"\n (click)=\"$event.stopPropagation(); remove.emit()\"\n (keydown.enter)=\"$event.stopPropagation(); remove.emit()\">\n <sd-icon name=\"close\"></sd-icon>\n </span>\n }\n</ng-template>\n", styles: [":host{display:contents}.c-chip{display:inline-flex;align-items:center;gap:4px;padding:0 4px 0 10px;border-radius:999px;border:1px solid var(--sd-query-bar-border, #d6d8db);background:var(--sd-query-bar-bg, #ffffff);cursor:pointer;font-family:inherit;font-size:var(--sd-font-size-13, 13px);font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-query-bar-text-secondary, #5f6368);transition:background-color var(--sd-duration-fast, .12s) ease,border-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}:host-context(.c-density-compact) .c-chip{height:28px}:host-context(.c-density-comfortable) .c-chip{height:32px}.c-chip:hover{border-color:var(--sd-primary)}.c-chip.c-chip-active{border-color:var(--sd-primary-light);background:var(--sd-primary-light)}.c-chip.c-chip-active .c-chip-value{color:var(--sd-primary)}.c-chip.c-chip-inactive{padding-right:10px}.c-chip.c-chip-pinned.c-chip-active{padding-right:4px}.c-chip.c-chip-invalid{border-color:var(--sd-query-bar-chip-danger, #d23535);background:var(--sd-query-bar-chip-danger-bg, #fff5f5);color:var(--sd-query-bar-chip-danger, #d23535)}.c-chip.c-chip-invalid .c-chip-value{color:var(--sd-query-bar-chip-danger, #d23535)}.c-chip.c-chip-disabled{cursor:default;opacity:.6}.c-chip.c-chip-disabled:hover{border-color:var(--sd-query-bar-border, #d6d8db)}.c-chip.c-chip-disabled.c-chip-active:hover{border-color:var(--sd-primary-light)}.c-chip .c-chip-icon{font-size:var(--sd-font-size-16, 16px);width:16px;height:16px}.c-chip .c-chip-label{font-weight:var(--sd-font-weight-medium, 500);white-space:nowrap}.c-chip .c-chip-operator{display:inline-flex;align-items:center;color:inherit}.c-chip .c-chip-sep{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-chip .c-chip-value{font-weight:var(--sd-font-weight-medium, 500);max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-chip .c-chip-value.c-chip-value--empty{font-weight:var(--sd-font-weight-regular, 400);color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-chip .c-chip-chevron{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px;color:currentColor}.c-chip .c-chip-remove{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;cursor:pointer;color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-chip .c-chip-remove sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-chip .c-chip-remove:hover{background:#0000000f}\n"] }]
1101
- }], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: true }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: true }] }], showOperator: [{ type: i0.Input, args: [{ isSignal: true, alias: "showOperator", required: false }] }], valueText: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueText", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], pinned: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinned", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], describedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "describedBy", required: false }] }], menu: [{ type: i0.Input, args: [{ isSignal: true, alias: "menu", required: true }] }], open: [{ type: i0.Output, args: ["open"] }], remove: [{ type: i0.Output, args: ["remove"] }], trigger: [{ type: i0.ViewChild, args: ['chipTrigger', { ...{ read: MatMenuTrigger }, isSignal: true }] }] } });
1902
+ args: [{ selector: 'sd-query-popover-chip', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SdIcon, MatTooltipModule, SdOperator, NgTemplateOutlet, ɵSdQueryPanelTriggerDirective], template: "<!-- why: div[role=button] (not <button>) so the nested <sd-operator> isn't button-in-button (invalid HTML). -->\n@let _active = active();\n@let _field = field();\n@let _filterField = filterField();\n@let _filterOperator = filterOperator();\n@let _emptyText = emptyText();\n@let _invalid = invalid();\n@let _removable = _active && !pinned();\n\n<!-- why: n\u00FAt \u00D7 l\u00E0 anh em c\u1EE7a trigger, kh\u00F4ng n\u1EB1m trong n\u00F3 (n\u00FAt l\u1ED3ng n\u00FAt \u2014 R1 G-4). V\u1ECF `.c-chip-shell` \u0111\u1EB7t \u00D7 \u0111\u00E8 l\u00EAn \u0111u\u00F4i\n vi\u00EAn chip, n\u00EAn chip gi\u1EEF nguy\u00EAn k\u00EDch th\u01B0\u1EDBc v\u00E0 h\u00ECnh d\u1EA1ng. -->\n<div class=\"c-chip-shell\">\n @if (disabled()) {\n <!-- why: chip ch\u1EC9 \u0111\u1ECDc kh\u00F4ng g\u1EAFn trigger c\u1EE7a panel \u2014 kh\u00F4ng c\u00F3 c\u00E1ch n\u00E0o m\u1EDF popover, k\u1EC3 c\u1EA3 openMenu() c\u1EE7a parent. -->\n <div\n role=\"button\"\n tabindex=\"0\"\n aria-disabled=\"true\"\n class=\"c-chip c-chip-disabled\"\n [class.c-chip-active]=\"_active\"\n [class.c-chip-inactive]=\"!_active\"\n [attr.data-field]=\"_filterField\"\n [matTooltip]=\"_field?.label || _filterField\">\n <ng-container [ngTemplateOutlet]=\"face\" />\n </div>\n } @else {\n <div\n #chipTrigger\n role=\"button\"\n tabindex=\"0\"\n class=\"c-chip\"\n [class.c-chip-active]=\"_active\"\n [class.c-chip-inactive]=\"!_active\"\n [class.c-chip-pinned]=\"pinned()\"\n [class.c-chip-removable]=\"_removable\"\n [class.c-chip-invalid]=\"_invalid\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"_invalid ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy() ?? null\"\n [attr.data-field]=\"_filterField\"\n [matTooltip]=\"_field?.label || _filterField\"\n [sdQueryPanelTrigger]=\"panel()\"\n (panelOpened)=\"open.emit()\">\n <ng-container [ngTemplateOutlet]=\"face\" />\n </div>\n\n @if (_removable) {\n <button type=\"button\" class=\"c-chip-remove\" [attr.aria-label]=\"removeLabel()\" (click)=\"$event.stopPropagation(); remove.emit()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n }\n</div>\n\n<ng-template #face>\n <sd-icon class=\"c-chip-icon\" [name]=\"_field ? iconFor(_field) : 'tune'\"></sd-icon>\n <span class=\"c-chip-label\">{{ _field?.label || _filterField }}</span>\n\n @if (showOperator() && _active) {\n <sd-operator class=\"c-chip-operator\" [operators]=\"[_filterOperator]\" [model]=\"_filterOperator\" size=\"xs\" readonly />\n } @else if (_active || _emptyText) {\n <span class=\"c-chip-sep\">:</span>\n }\n\n @if (_active) {\n <span class=\"c-chip-value\">{{ valueText() }}</span>\n } @else if (_emptyText) {\n <span class=\"c-chip-value c-chip-value--empty\">{{ _emptyText }}</span>\n }\n\n <sd-icon class=\"c-chip-chevron\" name=\"arrow_drop_down\"></sd-icon>\n</ng-template>\n", styles: [":host{display:contents}.c-chip-shell{position:relative;display:inline-flex;align-items:center}.c-chip{display:inline-flex;align-items:center;gap:4px;padding:0 4px 0 10px;border-radius:999px;border:1px solid var(--sd-query-bar-border, #d6d8db);background:var(--sd-query-bar-bg, #ffffff);cursor:pointer;font-family:inherit;font-size:var(--sd-font-size-13, 13px);font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-query-bar-text-secondary, #5f6368);transition:background-color var(--sd-duration-fast, .12s) ease,border-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}:host-context(.c-density-compact) .c-chip{height:28px}:host-context(.c-density-comfortable) .c-chip{height:32px}.c-chip:hover{border-color:var(--sd-primary)}.c-chip.c-chip-active{border-color:var(--sd-primary-light);background:var(--sd-primary-light)}.c-chip.c-chip-active .c-chip-value{color:var(--sd-primary)}.c-chip.c-chip-inactive{padding-right:10px}.c-chip.c-chip-pinned.c-chip-active{padding-right:4px}.c-chip.c-chip-removable{padding-right:28px}.c-chip.c-chip-invalid{border-color:var(--sd-query-bar-chip-danger, #d23535);background:var(--sd-query-bar-chip-danger-bg, #fff5f5);color:var(--sd-query-bar-chip-danger, #d23535)}.c-chip.c-chip-invalid .c-chip-value{color:var(--sd-query-bar-chip-danger, #d23535)}.c-chip.c-chip-disabled{cursor:default;opacity:.6}.c-chip.c-chip-disabled:hover{border-color:var(--sd-query-bar-border, #d6d8db)}.c-chip.c-chip-disabled.c-chip-active:hover{border-color:var(--sd-primary-light)}.c-chip .c-chip-icon{font-size:var(--sd-font-size-16, 16px);width:16px;height:16px}.c-chip .c-chip-label{font-weight:var(--sd-font-weight-medium, 500);white-space:nowrap}.c-chip .c-chip-operator{display:inline-flex;align-items:center;color:inherit}.c-chip .c-chip-sep{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-chip .c-chip-value{font-weight:var(--sd-font-weight-medium, 500);max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-chip .c-chip-value.c-chip-value--empty{font-weight:var(--sd-font-weight-regular, 400);color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-chip .c-chip-chevron{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px;color:currentColor}.c-chip-remove{position:absolute;top:50%;right:5px;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:20px;height:20px;padding:0;border:0;border-radius:50%;background:transparent;font:inherit;cursor:pointer;color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-chip-remove sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-chip-remove:hover{background:#0000000f}\n"] }]
1903
+ }], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: true }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: true }] }], showOperator: [{ type: i0.Input, args: [{ isSignal: true, alias: "showOperator", required: false }] }], valueText: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueText", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], pinned: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinned", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], describedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "describedBy", required: false }] }], panel: [{ type: i0.Input, args: [{ isSignal: true, alias: "panel", required: true }] }], open: [{ type: i0.Output, args: ["open"] }], remove: [{ type: i0.Output, args: ["remove"] }], trigger: [{ type: i0.ViewChild, args: ['chipTrigger', { ...{ read: ɵSdQueryPanelTriggerDirective }, isSignal: true }] }] } });
1102
1904
 
1103
1905
  const DATE_FORMAT = 'dd/MM/yyyy';
1104
1906
  const DATETIME_FORMAT = 'dd/MM/yyyy HH:mm';
1105
- const hasValue$1 = (value) => value !== null && value !== undefined && value !== '';
1907
+ const hasValue = (value) => value !== null && value !== undefined && value !== '';
1106
1908
  /**
1107
1909
  * Value text of a chip, shared by the query bar and the sd-table phone filters so both show the same string:
1108
1910
  * one value → its label; several → `first +n`; a date range in one year → `01/10 – 31/10/2026`; one open end →
@@ -1127,8 +1929,8 @@ const ɵsdQueryChipValueText = (filter, field, context) => {
1127
1929
  };
1128
1930
  /** `01/10 – 31/10/2026` inside one year, `From …` / `To …` when one end is open. */
1129
1931
  const rangeText = (field, range, context) => {
1130
- const hasFrom = hasValue$1(range.from);
1131
- const hasTo = hasValue$1(range.to);
1932
+ const hasFrom = hasValue(range.from);
1933
+ const hasTo = hasValue(range.to);
1132
1934
  if (field?.type === 'date' && hasFrom && hasTo) {
1133
1935
  const year = context.toFormat(range.from, 'yyyy');
1134
1936
  if (year && year === context.toFormat(range.to, 'yyyy')) {
@@ -1199,7 +2001,7 @@ class ɵSdQueryChipLabels {
1199
2001
  if (field?.type !== 'values' && field?.type !== 'lazy-values')
1200
2002
  return;
1201
2003
  const data = filter.data;
1202
- const values = Array.isArray(data) ? data : hasValue$1(data) ? [data] : [];
2004
+ const values = Array.isArray(data) ? data : hasValue(data) ? [data] : [];
1203
2005
  if (!values.length)
1204
2006
  return;
1205
2007
  const key = field.key;
@@ -1261,7 +2063,6 @@ const stringify = (value) => {
1261
2063
 
1262
2064
  /** Shared empty array — stable reference so template bindings don't churn change detection. */
1263
2065
  const EMPTY_ARRAY = [];
1264
- const hasValue = (value) => value !== null && value !== undefined && value !== '';
1265
2066
  class SdQueryBar {
1266
2067
  #i18n = inject(I18nService);
1267
2068
  #injector = inject(Injector);
@@ -1316,7 +2117,7 @@ class SdQueryBar {
1316
2117
  /**
1317
2118
  * Editing mode:
1318
2119
  * - `'popover'` (default) → compact chips; click a chip to edit operator + value in a
1319
- * mat-menu popover, commit with "Áp dụng".
2120
+ * popover panel; the value is committed when the popover closes.
1320
2121
  * - `'inline'` → GitLab-style. Each filter's operator + value controls render directly
1321
2122
  * on the bar (no popup, no per-filter apply). Edits update `filters` live; the user
1322
2123
  * presses the search button (or Enter) once to fire `(apply)`.
@@ -1338,9 +2139,30 @@ class SdQueryBar {
1338
2139
  * saving a filter captures live filters/logic/search.
1339
2140
  */
1340
2141
  currentQuery = computed(() => this.#buildQuery(), ...(ngDevMode ? [{ debugName: "currentQuery" }] : /* istanbul ignore next */ []));
1341
- /** Receive an applied filter from the saved-filters menu — re-install bar state + trigger apply. */
2142
+ /**
2143
+ * Receive an applied filter from the saved-filters menu — re-install bar state + trigger apply (handoff B4). Entries of
2144
+ * fields the bar no longer has, or of disabled fields, are dropped. A required or pinned field takes the saved chip
2145
+ * only when it has a value; otherwise its current chip (operator included) stays. Required and pinned chips come
2146
+ * first, in field order.
2147
+ */
1342
2148
  onApplyFilter(saved) {
1343
- this.filters.set(saved.query.filters ?? []);
2149
+ const fields = this.fieldByKey();
2150
+ const keyOf = (filter) => ('field' in filter ? filter.field : '');
2151
+ const usable = (saved.query.filters ?? []).filter(filter => {
2152
+ const field = fields[keyOf(filter)];
2153
+ return !!field && !field.disabled;
2154
+ });
2155
+ const current = this.filters();
2156
+ const locked = [];
2157
+ for (const field of this.resolvedFields()) {
2158
+ if (!this.isLocked(field))
2159
+ continue;
2160
+ const key = field.key;
2161
+ const fromSaved = usable.find(filter => keyOf(filter) === key && this.isFilterActive(filter));
2162
+ locked.push(fromSaved ?? current.find(filter => keyOf(filter) === key) ?? this.#emptyChip(field));
2163
+ }
2164
+ const rest = usable.filter(filter => !this.isLocked(fields[keyOf(filter)]));
2165
+ this.filters.set([...locked, ...rest]);
1344
2166
  this.logic.set(saved.query.logic ?? 'AND');
1345
2167
  if (saved.query.search !== undefined)
1346
2168
  this.search.set(saved.query.search);
@@ -1374,6 +2196,12 @@ class SdQueryBar {
1374
2196
  // ---------------------------------------------------------------------------
1375
2197
  /** Placeholder của ô tìm kiếm tự do bên trái; `option.searchPlaceholder` thắng i18n. */
1376
2198
  searchPlaceholder = computed(() => this.option()?.searchPlaceholder ?? this.#i18n.t('core.component.query-bar.search-placeholder'), ...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []));
2199
+ /** Tên của ô tìm cho trình đọc màn hình: `option.searchPlaceholder` nếu host đặt, không thì key `search`. */
2200
+ searchLabel = computed(() => this.option()?.searchPlaceholder ?? this.#i18n.t('core.component.query-bar.search'), ...(ngDevMode ? [{ debugName: "searchLabel" }] : /* istanbul ignore next */ []));
2201
+ /** Nhãn nút xoá của ô tìm. */
2202
+ searchClearLabel = computed(() => this.#i18n.t('core.component.query-bar.search-clear'), ...(ngDevMode ? [{ debugName: "searchClearLabel" }] : /* istanbul ignore next */ []));
2203
+ /** Nhãn và placeholder của ô Thêm điều kiện (mode inline). */
2204
+ addConditionLabel = computed(() => this.#i18n.t('core.component.query-bar.add-condition'), ...(ngDevMode ? [{ debugName: "addConditionLabel" }] : /* istanbul ignore next */ []));
1377
2205
  /** Chữ trên chip ghim đang rỗng. */
1378
2206
  allLabel = computed(() => this.#i18n.t('core.component.query-bar.all'), ...(ngDevMode ? [{ debugName: "allLabel" }] : /* istanbul ignore next */ []));
1379
2207
  /** Chữ trên chip bắt buộc đang rỗng — "Tất cả" sai nghĩa khi field không cho phép bỏ trống. */
@@ -1395,9 +2223,27 @@ class SdQueryBar {
1395
2223
  resolvedShowOperatorOnChip = computed(() => this.option()?.showOperatorOnChip ?? this.showOperatorOnChip(), ...(ngDevMode ? [{ debugName: "resolvedShowOperatorOnChip" }] : /* istanbul ignore next */ []));
1396
2224
  resolvedApplyOn = computed(() => this.option()?.applyOn ?? 'search', ...(ngDevMode ? [{ debugName: "resolvedApplyOn" }] : /* istanbul ignore next */ []));
1397
2225
  resolvedAppearance = computed(() => this.option()?.appearance ?? 'default', ...(ngDevMode ? [{ debugName: "resolvedAppearance" }] : /* istanbul ignore next */ []));
1398
- resolvedClearDisabled = computed(() => !!this.option()?.clearDisabled, ...(ngDevMode ? [{ debugName: "resolvedClearDisabled" }] : /* istanbul ignore next */ []));
2226
+ /**
2227
+ * Clear-all is disabled when the host says so, or — with the built-in clearAll() — when no chip but required ones has a
2228
+ * value: there is nothing left to clear (handoff B2).
2229
+ */
2230
+ resolvedClearDisabled = computed(() => {
2231
+ const option = this.option();
2232
+ return !!option?.clearDisabled || (!option?.onClearAll && this.activeCount() === 0);
2233
+ }, ...(ngDevMode ? [{ debugName: "resolvedClearDisabled" }] : /* istanbul ignore next */ []));
1399
2234
  resolvedInvalidHintId = computed(() => this.option()?.invalidHintId, ...(ngDevMode ? [{ debugName: "resolvedInvalidHintId" }] : /* istanbul ignore next */ []));
1400
2235
  constructor() {
2236
+ // why: B1 — field bắt buộc hoặc ghim luôn có chip. Thiếu thì thêm chip rỗng ngay trong lượt cập nhật filters này
2237
+ // (không phát apply); thanh không bao giờ bỏ chip đó.
2238
+ effect(() => {
2239
+ const filters = this.filters();
2240
+ const fields = this.resolvedFields();
2241
+ untracked(() => {
2242
+ const next = this.#withLockedChips(filters, fields);
2243
+ if (next !== filters)
2244
+ this.filters.set(next);
2245
+ });
2246
+ });
1401
2247
  effect(() => {
1402
2248
  const option = this.option();
1403
2249
  if (!option)
@@ -1437,11 +2283,11 @@ class SdQueryBar {
1437
2283
  }
1438
2284
  return set;
1439
2285
  }, ...(ngDevMode ? [{ debugName: "usedFieldKeys" }] : /* istanbul ignore next */ []));
1440
- /** Fields the user can add: pinned fields always have their chip, so the picker leaves them out. */
2286
+ /** Fields the user can add: pinned and required fields always have their chip, so the picker leaves them out. */
1441
2287
  pickerFields = computed(() => {
1442
2288
  const fields = this.resolvedFields();
1443
- // why: giữ nguyên ref khi không có field ghim để picker (OnPush) không bị dirty vô cớ.
1444
- return fields.some(field => field.pinned) ? fields.filter(field => !field.pinned) : fields;
2289
+ // why: giữ nguyên ref khi không có field ghim / bắt buộc để picker (OnPush) không bị dirty vô cớ.
2290
+ return fields.some(field => this.isLocked(field)) ? fields.filter(field => !this.isLocked(field)) : fields;
1445
2291
  }, ...(ngDevMode ? [{ debugName: "pickerFields" }] : /* istanbul ignore next */ []));
1446
2292
  /** "+" is disabled when nothing is left to add. */
1447
2293
  addDisabled = computed(() => {
@@ -1462,10 +2308,18 @@ class SdQueryBar {
1462
2308
  const invalid = required.filter(field => !filled.has(field.key));
1463
2309
  return invalid.length ? invalid : EMPTY_ARRAY;
1464
2310
  }, ...(ngDevMode ? [{ debugName: "invalidFields" }] : /* istanbul ignore next */ []));
1465
- /** Chips holding a value — the number shown in the clear-all label. */
1466
- activeCount = computed(() => this.filters().filter(filter => this.isFilterActive(filter)).length, ...(ngDevMode ? [{ debugName: "activeCount" }] : /* istanbul ignore next */ []));
2311
+ /**
2312
+ * Chips holding a value that Clear would empty — the number shown in the clear-all label. Required chips keep their
2313
+ * value on clear, so they are not counted (handoff B2).
2314
+ */
2315
+ activeCount = computed(() => this.filters().filter(filter => !this.fieldOf(filter)?.required && this.isFilterActive(filter)).length, ...(ngDevMode ? [{ debugName: "activeCount" }] : /* istanbul ignore next */ []));
1467
2316
  /** Render the global AND/OR connector text between chips when `logic === 'OR'`. */
1468
2317
  showOrConnector = computed(() => this.resolvedShowLogicToggle() && this.logic() === 'OR' && this.filters().length >= 2, ...(ngDevMode ? [{ debugName: "showOrConnector" }] : /* istanbul ignore next */ []));
2318
+ /**
2319
+ * "Save current filter" needs something to save: a chip with a value (required chips included — Bước 0, decision 2)
2320
+ * or text in the search box.
2321
+ */
2322
+ canSaveFilter = computed(() => this.filters().some(filter => this.isFilterActive(filter)) || (this.resolvedShowSearch() && this.search().trim().length > 0), ...(ngDevMode ? [{ debugName: "canSaveFilter" }] : /* istanbul ignore next */ []));
1469
2323
  /** Search button is actionable only when there is something to apply and no required field is empty. */
1470
2324
  canSearch = computed(() => (this.filters().length > 0 || this.search().trim().length > 0) && this.invalidFields().length === 0, ...(ngDevMode ? [{ debugName: "canSearch" }] : /* istanbul ignore next */ []));
1471
2325
  // ---------------------------------------------------------------------------
@@ -1547,16 +2401,7 @@ class SdQueryBar {
1547
2401
  * A BETWEEN range is active when either end is set; `{ from: null, to: null }` is empty.
1548
2402
  */
1549
2403
  isFilterActive(filter) {
1550
- if (SD_QUERY_NO_DATA_OPERATORS.includes(filter.operator))
1551
- return true;
1552
- const data = filter.data;
1553
- if (data === null || data === undefined || data === '')
1554
- return false;
1555
- if (Array.isArray(data))
1556
- return data.length > 0;
1557
- if (filter.operator === 'BETWEEN' && typeof data === 'object')
1558
- return hasValue(data.from) || hasValue(data.to);
1559
- return true;
2404
+ return ɵsdQueryFilterActive(filter);
1560
2405
  }
1561
2406
  /** Rendered value text on a chip. */
1562
2407
  chipValueText(filter) {
@@ -1572,9 +2417,16 @@ class SdQueryBar {
1572
2417
  fieldOf(filter) {
1573
2418
  return 'field' in filter ? this.fieldByKey()[filter.field] : undefined;
1574
2419
  }
1575
- /** Pinned chips have no remove button and survive removeFilter / clearAll. */
2420
+ /**
2421
+ * Pinned and required chips have no remove button and survive removeFilter / clearAll; an empty one is never dropped
2422
+ * (handoff B1: `required` implies `pinned`).
2423
+ */
1576
2424
  isPinned(filter) {
1577
- return !!this.fieldOf(filter)?.pinned;
2425
+ return this.isLocked(this.fieldOf(filter));
2426
+ }
2427
+ /** The field always has its chip on the bar: `pinned` or `required`. */
2428
+ isLocked(field) {
2429
+ return !!field && (!!field.pinned || !!field.required);
1578
2430
  }
1579
2431
  /** Empty chip of a required field. */
1580
2432
  isInvalid(filter) {
@@ -1643,17 +2495,36 @@ class SdQueryBar {
1643
2495
  /** Value committed by a completed inline chip (seamless input, picker, boolean toggle). */
1644
2496
  onInlineCommit(index, data) {
1645
2497
  const previous = this.filters()[index];
2498
+ if (this.#emptiesRequired(previous, { data }))
2499
+ return;
1646
2500
  this.updateFilterData(index, data);
1647
2501
  this.#applyIfChanged(previous, this.filters()[index]);
1648
2502
  }
1649
2503
  /** Range committed by a completed inline BETWEEN chip. */
1650
2504
  onInlineRange(index, ev) {
1651
2505
  const previous = this.filters()[index];
2506
+ if (this.#emptiesRequired(previous, { data: ev ?? { from: null, to: null } }))
2507
+ return;
1652
2508
  this.setFilterRange(index, ev);
1653
2509
  this.#applyIfChanged(previous, this.filters()[index]);
1654
2510
  }
2511
+ /**
2512
+ * B3: a required chip that has a value cannot become empty — the chips already refuse it; the bar refuses it too when
2513
+ * a host calls the mutators directly. The first empty state (B5) is the only empty one.
2514
+ */
2515
+ #emptiesRequired(previous, patch) {
2516
+ if (!previous || !this.fieldOf(previous)?.required || !this.isFilterActive(previous))
2517
+ return false;
2518
+ return !this.isFilterActive({ ...previous, ...patch });
2519
+ }
1655
2520
  /** Entry point from the field picker — start building a chip for `field`. */
1656
2521
  beginBuild(field) {
2522
+ // why: field ghim / bắt buộc luôn có chip sẵn (B1) — host gọi beginBuild cho nó thì đưa tới chip đó, không dựng chip thứ hai.
2523
+ const existing = this.isLocked(field) ? this.filters().findIndex(filter => 'field' in filter && filter.field === field.key) : -1;
2524
+ if (existing >= 0) {
2525
+ afterNextRender(() => this.#focusInlineChip(existing), { injector: this.#injector });
2526
+ return;
2527
+ }
1657
2528
  const allowed = sdQueryAllowedOperators(field);
1658
2529
  const def = sdQueryDefaultOperator(field);
1659
2530
  // why: date/datetime mặc định là BETWEEN — skip operator step để user vào value
@@ -1671,6 +2542,7 @@ class SdQueryBar {
1671
2542
  if (SD_QUERY_NO_DATA_OPERATORS.includes(operator)) {
1672
2543
  this.#pushComplete(field, operator, null);
1673
2544
  this.#building.set(null);
2545
+ this.#returnToAddInput();
1674
2546
  return;
1675
2547
  }
1676
2548
  this.#building.set({ field, operator, step: 'value' });
@@ -1684,6 +2556,7 @@ class SdQueryBar {
1684
2556
  if (SD_QUERY_NO_DATA_OPERATORS.includes(op)) {
1685
2557
  this.#pushComplete(b.field, op, null);
1686
2558
  this.#building.set(null);
2559
+ this.#returnToAddInput();
1687
2560
  return;
1688
2561
  }
1689
2562
  this.#building.set({ ...b, operator: op, step: 'value' });
@@ -1694,8 +2567,14 @@ class SdQueryBar {
1694
2567
  const b = this.#building();
1695
2568
  if (!b || !b.operator)
1696
2569
  return;
2570
+ // B3: an empty value never makes a chip for a required field.
2571
+ if (b.field.required && !this.isFilterActive({ field: b.field.key, operator: b.operator, data: value })) {
2572
+ this.cancelBuild();
2573
+ return;
2574
+ }
1697
2575
  this.#pushComplete(b.field, b.operator, value);
1698
2576
  this.#building.set(null);
2577
+ this.#returnToAddInput();
1699
2578
  }
1700
2579
  /**
1701
2580
  * Commit from the seamless build chip (string / number). An empty value (blur with no
@@ -1712,6 +2591,156 @@ class SdQueryBar {
1712
2591
  /** Abandon the in-progress chip. */
1713
2592
  cancelBuild() {
1714
2593
  this.#building.set(null);
2594
+ this.#returnToAddInput();
2595
+ }
2596
+ // ---------------------------------------------------------------------------
2597
+ // Inline mode — "Add condition" combobox (handoff section 8)
2598
+ // ---------------------------------------------------------------------------
2599
+ /** The "Add condition" input (inline mode). */
2600
+ addInput = viewChild('addInput', ...(ngDevMode ? [{ debugName: "addInput" }] : /* istanbul ignore next */ []));
2601
+ /** The field picker the box drives. */
2602
+ addPicker = viewChild(SdQueryFieldPicker, ...(ngDevMode ? [{ debugName: "addPicker" }] : /* istanbul ignore next */ []));
2603
+ /** Text typed in the box — filters the field list. */
2604
+ addQuery = signal('', ...(ngDevMode ? [{ debugName: "addQuery" }] : /* istanbul ignore next */ []));
2605
+ /** The chip the first Backspace on an empty box moved focus to; a second Backspace removes it. */
2606
+ #pendingRemove = null;
2607
+ /** A field was picked in the field picker: inline builds a chip from it, popover adds a chip and opens it. */
2608
+ onPick(field) {
2609
+ if (this.resolvedMode() !== 'inline') {
2610
+ this.addFilter(field);
2611
+ return;
2612
+ }
2613
+ this.addQuery.set('');
2614
+ this.beginBuild(field);
2615
+ }
2616
+ /** Opens the field list under the box, keeping focus in the box (combobox). */
2617
+ openAddList() {
2618
+ const input = this.addInput()?.nativeElement;
2619
+ const picker = this.addPicker();
2620
+ if (!input || !picker || input.disabled || picker.panel().isOpen())
2621
+ return;
2622
+ picker.setQuery(this.addQuery());
2623
+ picker.panel().open(input, { focus: false });
2624
+ }
2625
+ /** Typing filters the list and opens it; the first enabled match is pointed at. */
2626
+ onAddInput(text) {
2627
+ this.addQuery.set(text);
2628
+ this.addPicker()?.setQuery(text);
2629
+ this.openAddList();
2630
+ }
2631
+ onAddKeydown(event) {
2632
+ const picker = this.addPicker();
2633
+ if (!picker)
2634
+ return;
2635
+ const open = picker.panel().isOpen();
2636
+ switch (event.key) {
2637
+ case 'ArrowDown':
2638
+ if (!open) {
2639
+ this.openAddList();
2640
+ // Alt+ArrowDown only opens; ArrowDown also points at the first option.
2641
+ if (!event.altKey)
2642
+ picker.move(1);
2643
+ }
2644
+ else
2645
+ picker.move(1);
2646
+ break;
2647
+ case 'ArrowUp':
2648
+ if (!open)
2649
+ return;
2650
+ picker.move(-1);
2651
+ break;
2652
+ case 'Enter':
2653
+ if (open) {
2654
+ if (!picker.pickActive())
2655
+ return;
2656
+ }
2657
+ else if (!this.addQuery()) {
2658
+ // why: ô rỗng, danh sách đóng — Enter là "Tìm kiếm" của thanh, bị chặn khi còn field bắt buộc rỗng.
2659
+ this.applySearch();
2660
+ }
2661
+ else
2662
+ return;
2663
+ break;
2664
+ case 'Escape':
2665
+ if (!open && !this.addQuery())
2666
+ return;
2667
+ if (open)
2668
+ picker.panel().close('escape');
2669
+ this.addQuery.set('');
2670
+ event.stopPropagation();
2671
+ break;
2672
+ case 'Backspace':
2673
+ if (this.addQuery())
2674
+ return;
2675
+ this.#focusLastChip();
2676
+ break;
2677
+ case 'Tab':
2678
+ if (open)
2679
+ picker.panel().close('tab');
2680
+ return;
2681
+ default:
2682
+ return;
2683
+ }
2684
+ event.preventDefault();
2685
+ }
2686
+ /** A click on the empty part of the chip area (inline mode) focuses the box and opens the list. */
2687
+ onMainClick(event) {
2688
+ const target = event.target;
2689
+ if (this.resolvedMode() !== 'inline' || !target?.classList.contains('c-query-bar__main'))
2690
+ return;
2691
+ this.addInput()?.nativeElement.focus();
2692
+ this.openAddList();
2693
+ }
2694
+ /** Backspace / Delete on the chip the box pointed at removes it — never a required or pinned chip. */
2695
+ onMainKeydown(event) {
2696
+ const pending = this.#pendingRemove;
2697
+ if (!pending || event.target !== pending.element)
2698
+ return;
2699
+ if (event.key !== 'Backspace' && event.key !== 'Delete') {
2700
+ this.#pendingRemove = null;
2701
+ return;
2702
+ }
2703
+ event.preventDefault();
2704
+ const filter = this.filters()[pending.index];
2705
+ if (!filter || this.isPinned(filter) || this.fieldOf(filter)?.disabled)
2706
+ return;
2707
+ this.#pendingRemove = null;
2708
+ this.removeFilter(pending.index);
2709
+ afterNextRender(() => this.addInput()?.nativeElement.focus(), { injector: this.#injector });
2710
+ }
2711
+ /** First Backspace on an empty box: focus the last chip so a second Backspace removes it. */
2712
+ #focusLastChip() {
2713
+ const rendered = this.#chipElements();
2714
+ const last = rendered[rendered.length - 1];
2715
+ if (!last)
2716
+ return;
2717
+ if (!last.element.hasAttribute('tabindex'))
2718
+ last.element.tabIndex = -1;
2719
+ last.element.focus();
2720
+ this.#pendingRemove = last;
2721
+ }
2722
+ /** The focusable wrapper of each rendered inline chip, with the index of its filter. */
2723
+ #chipElements() {
2724
+ const elements = Array.from(this.#host.nativeElement.querySelectorAll('.c-query-bar__main > sd-query-inline-value-chip .c-seamless, .c-query-bar__main > sd-query-inline-chip .c-token, .c-query-bar__main > sd-query-popover-chip .c-chip'));
2725
+ // why: @for chỉ vẽ chip của field thanh biết — ghép phần tử thứ n với filter thứ n có field.
2726
+ const indexes = this.filters()
2727
+ .map((filter, index) => (this.fieldOf(filter) ? index : -1))
2728
+ .filter(index => index >= 0);
2729
+ return elements.map((element, position) => ({ element, index: indexes[position] })).filter(entry => entry.index !== undefined);
2730
+ }
2731
+ /**
2732
+ * After a chip is finished (value committed, build cancelled) focus goes back to the box, without opening the list —
2733
+ * unless the user has moved focus somewhere else meanwhile.
2734
+ */
2735
+ #returnToAddInput() {
2736
+ if (this.resolvedMode() !== 'inline')
2737
+ return;
2738
+ afterNextRender(() => {
2739
+ const active = document.activeElement;
2740
+ if (active && active !== document.body && !this.#host.nativeElement.contains(active))
2741
+ return;
2742
+ this.addInput()?.nativeElement.focus();
2743
+ }, { injector: this.#injector });
1715
2744
  }
1716
2745
  /**
1717
2746
  * Commit both ends of a BETWEEN range at once — called from `<sd-query-inline-chip>`'s
@@ -1756,18 +2785,35 @@ class SdQueryBar {
1756
2785
  afterNextRender(() => this.#focusInlineChip(index), { injector: this.#injector });
1757
2786
  return;
1758
2787
  }
1759
- if (index < 0)
2788
+ if (index < 0) {
1760
2789
  this.#addFilter(field, returnFocusTo ?? undefined);
2790
+ return;
2791
+ }
2792
+ const chip = this.popoverChips()[index];
2793
+ // why: icon ở header bấm lần nữa khi popover của nó đang mở thì đóng lại — menu Material trước đây có backdrop nuốt lần bấm đó
2794
+ // và đóng menu; panel mới không có backdrop.
2795
+ if (chip?.isOpen())
2796
+ chip.closeMenu();
1761
2797
  else
1762
- this.popoverChips()[index]?.openMenu(returnFocusTo ?? undefined);
2798
+ chip?.openMenu(returnFocusTo ?? undefined);
1763
2799
  }
1764
- /** Clear-all button: the host's `onClearAll` when given, else the built-in clearAll(). */
2800
+ /**
2801
+ * Clear-all button: the host's `onClearAll` when given, else the built-in clearAll(). With `applyOn: 'commit'` the
2802
+ * built-in path applies once when it emptied a chip that had a value (R2 G-10).
2803
+ */
1765
2804
  onClearClick() {
1766
2805
  const onClearAll = this.option()?.onClearAll;
1767
- if (onClearAll)
2806
+ if (onClearAll) {
1768
2807
  onClearAll();
1769
- else
1770
- this.clearAll();
2808
+ return;
2809
+ }
2810
+ // why: activeCount đếm đúng các chip có giá trị mà clearAll sẽ làm rỗng hoặc bỏ (chip bắt buộc giữ nguyên) — bằng 0
2811
+ // thì clearAll không đổi điều kiện lọc nào nên không áp dụng.
2812
+ const changed = this.activeCount() > 0;
2813
+ this.clearAll();
2814
+ // why: ở applyOn 'commit' thanh không có nút Tìm kiếm; không áp dụng ở đây thì host vẫn lọc theo các chip vừa xoá.
2815
+ if (changed && this.resolvedApplyOn() === 'commit')
2816
+ this.#applyChipChange();
1771
2817
  }
1772
2818
  /** Swap the field of an existing chip — reset operator + value to the new field's defaults. */
1773
2819
  changeFilterField(index, field) {
@@ -1778,9 +2824,8 @@ class SdQueryBar {
1778
2824
  const data = SD_QUERY_MULTI_OPERATORS.includes(operator) ? [] : null;
1779
2825
  list[index] = { field: field.key, operator, data };
1780
2826
  this.filters.set(list);
1781
- // why: clicking an item in the nested fieldSwitchPicker closes both the picker AND
1782
- // the parent chipPopover. Re-open the chip's popover on the next render so user can
1783
- // continue picking operator + value without a second manual click.
2827
+ // why: re-open the chip's popover on the next render so the user can pick operator + value for the new field
2828
+ // without a second click.
1784
2829
  afterNextRender(() => this.popoverChips()[index]?.openMenu(), { injector: this.#injector });
1785
2830
  }
1786
2831
  updateFilter(index, patch) {
@@ -1825,23 +2870,54 @@ class SdQueryBar {
1825
2870
  if (this.resolvedApplyOn() === 'commit' && this.isFilterActive(removed))
1826
2871
  this.#applyChipChange();
1827
2872
  }
1828
- /** Empties the bar. Pinned chips stay, reset to their field's default operator and no value. */
2873
+ /**
2874
+ * Empties the bar (handoff B2). Required chips stay as they are (operator and value); pinned chips stay, reset to their
2875
+ * field's default operator and no value; other chips go.
2876
+ */
1829
2877
  clearAll() {
1830
2878
  if (this.filters().length === 0)
1831
2879
  return;
1832
2880
  const kept = [];
1833
2881
  for (const filter of this.filters()) {
1834
2882
  const field = this.fieldOf(filter);
2883
+ if (field?.required) {
2884
+ kept.push(filter);
2885
+ continue;
2886
+ }
1835
2887
  if (!field?.pinned)
1836
2888
  continue;
1837
- const operator = sdQueryDefaultOperator(field);
1838
- const next = { field: field.key, operator, data: SD_QUERY_MULTI_OPERATORS.includes(operator) ? [] : null };
2889
+ const next = this.#emptyChip(field);
1839
2890
  this.#inheritRowId(filter, next);
1840
2891
  kept.push(next);
1841
2892
  }
1842
- this.filters.set(kept);
2893
+ this.filters.set(this.#withLockedChips(kept, this.resolvedFields()));
1843
2894
  this.editingIndex.set(null);
1844
2895
  }
2896
+ /** A chip of `field` with its default operator and no value. */
2897
+ #emptyChip(field) {
2898
+ const operator = sdQueryDefaultOperator(field);
2899
+ return { field: field.key, operator, data: SD_QUERY_MULTI_OPERATORS.includes(operator) ? [] : null };
2900
+ }
2901
+ /**
2902
+ * B1: every pinned or required field has a chip. Missing ones are added empty; the locked chips then come first in
2903
+ * field order, the others keep their order. Returns `filters` itself when nothing is missing.
2904
+ */
2905
+ #withLockedChips(filters, fields) {
2906
+ const locked = fields.filter(field => this.isLocked(field));
2907
+ if (!locked.length)
2908
+ return filters;
2909
+ const chips = new Map();
2910
+ for (const filter of filters)
2911
+ if ('field' in filter && !chips.has(filter.field))
2912
+ chips.set(filter.field, filter);
2913
+ if (locked.every(field => chips.has(field.key)))
2914
+ return filters;
2915
+ const keys = new Set(locked.map(field => field.key));
2916
+ return [
2917
+ ...locked.map(field => chips.get(field.key) ?? this.#emptyChip(field)),
2918
+ ...filters.filter(filter => !('field' in filter) || !keys.has(filter.field)),
2919
+ ];
2920
+ }
1845
2921
  setLogic(value) {
1846
2922
  if (this.logic() === value)
1847
2923
  return;
@@ -1854,6 +2930,18 @@ class SdQueryBar {
1854
2930
  this.#searchBase = this.search();
1855
2931
  this.search.set(value);
1856
2932
  }
2933
+ /** Clear button of the search box: empties the text and applies once (handoff 7.2). */
2934
+ clearSearch() {
2935
+ this.setSearch('');
2936
+ this.applySearch();
2937
+ }
2938
+ /** Escape in the search box: like the clear button when there is text; nothing on an empty box. */
2939
+ onSearchEscape(event) {
2940
+ if (!this.search())
2941
+ return;
2942
+ event.preventDefault();
2943
+ this.clearSearch();
2944
+ }
1857
2945
  /** Enter in the search box: applies the typed text too, unless a required field is still empty. */
1858
2946
  applySearch() {
1859
2947
  if (this.invalidFields().length)
@@ -1893,7 +2981,7 @@ class SdQueryBar {
1893
2981
  return;
1894
2982
  this.editingIndex.set(index);
1895
2983
  const field = this.fieldByKey()[filter.field];
1896
- this.chipPopover()?.seed(filter, field);
2984
+ this.chipPopover()?.seed(filter, field, index);
1897
2985
  }
1898
2986
  /**
1899
2987
  * Receive `(commit)` from the child popover — splice into filters, null the index. With
@@ -1918,7 +3006,7 @@ class SdQueryBar {
1918
3006
  return;
1919
3007
  }
1920
3008
  // why: popover chỉ đổi operator + value của CHÍNH chip đó → giữ track key, nếu không chip sẽ
1921
- // bị huỷ ngay lúc menu đóng (trigger của overlay biến mất giữa chừng).
3009
+ // bị huỷ ngay lúc panel đóng (trigger của overlay biến mất giữa chừng).
1922
3010
  this.#inheritRowId(previous, next);
1923
3011
  list[idx] = next;
1924
3012
  this.filters.set(list);
@@ -1962,16 +3050,20 @@ class SdQueryBar {
1962
3050
  chips[index]?.querySelector('input, button, [tabindex]:not([tabindex="-1"])')?.focus();
1963
3051
  }
1964
3052
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQueryBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
1965
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdQueryBar, isStandalone: true, selector: "sd-query-bar", inputs: { option: { classPropertyName: "option", publicName: "option", isSignal: true, isRequired: false, transformFunction: null }, autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null }, filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, logic: { classPropertyName: "logic", publicName: "logic", isSignal: true, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, showSearch: { classPropertyName: "showSearch", publicName: "showSearch", isSignal: true, isRequired: false, transformFunction: null }, showSavedFilters: { classPropertyName: "showSavedFilters", publicName: "showSavedFilters", isSignal: true, isRequired: false, transformFunction: null }, savedFiltersKey: { classPropertyName: "savedFiltersKey", publicName: "savedFiltersKey", isSignal: true, isRequired: false, transformFunction: null }, showLogicToggle: { classPropertyName: "showLogicToggle", publicName: "showLogicToggle", isSignal: true, isRequired: false, transformFunction: null }, showClearAll: { classPropertyName: "showClearAll", publicName: "showClearAll", isSignal: true, isRequired: false, transformFunction: null }, showOperatorOnChip: { classPropertyName: "showOperatorOnChip", publicName: "showOperatorOnChip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filters: "filtersChange", logic: "logicChange", search: "searchChange", queryChange: "queryChange", apply: "apply" }, viewQueries: [{ propertyName: "popoverChips", predicate: SdQueryPopoverChip, descendants: true, isSignal: true }, { propertyName: "buildChip", first: true, predicate: SdQueryBuildChip, descendants: true, isSignal: true }, { propertyName: "chipPopover", first: true, predicate: SdQueryChipPopover, descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n sd-query-bar \u2014 unified filter chip row (Jira/Linear/Notion style).\n Visual spec: refs/design_handoff_sd_query_bar/README.md\n TODO(next-iter): replace inline placeholders for field-picker + chip-popover\n with extracted sub-components driven by CDK overlay.\n-->\n@let _filters = filters();\n@let _resolvedFields = resolvedFields();\n@let _resolvedDensity = resolvedDensity();\n@let _showOrConnector = showOrConnector();\n@let _usedFieldKeys = usedFieldKeys();\n@let _editingIndex = editingIndex();\n@let _resolvedMode = resolvedMode();\n@let _noFieldsLabel = noFieldsLabel();\n@let _addFilterLabel = addFilterLabel();\n@let _addDisabled = addDisabled();\n@let _invalidHintId = resolvedInvalidHintId();\n\n<div\n class=\"c-query-bar\"\n [class.c-density-compact]=\"_resolvedDensity === 'compact'\"\n [class.c-density-comfortable]=\"_resolvedDensity === 'comfortable'\"\n [class.c-appearance-flush]=\"resolvedAppearance() === 'flush'\">\n\n <!-- Main region \u2014 search + filters + add-filter. Wraps internally; the right\n action toolbar stays anchored and does NOT flow with this. -->\n <div class=\"c-query-bar__main\">\n\n <!-- Free-text search (left, optional) -->\n @if (resolvedShowSearch()) {\n <div class=\"c-search\">\n <sd-icon class=\"c-search-icon\" name=\"search\"></sd-icon>\n <input\n class=\"c-search-input\"\n type=\"text\"\n [ngModel]=\"search()\"\n (ngModelChange)=\"setSearch($event)\"\n (keydown.enter)=\"applySearch()\"\n [placeholder]=\"searchPlaceholder()\" />\n </div>\n <span class=\"c-divider\" aria-hidden=\"true\"></span>\n }\n\n <!-- Chip popover \u2014 extracted into <sd-query-chip-popover>. Declared BEFORE chips\n so the popover-mode @for chips can bind their [menu] to `chipPopover.menu()`.\n why: m\u1EDF popover \u0111\u1EC3 EDIT ch\u1EC9 cho ch\u1EC9nh operator + value \u2014 KH\u00D4NG \u0111\u1ED5i field.\n B\u1ECF [switchPickerMenu] \u2192 header render nh\u00E3n field t\u0129nh (read-only). Mu\u1ED1n \u0111\u1ED5i\n field th\u00EC xo\u00E1 chip r\u1ED3i th\u00EAm l\u1EA1i. -->\n <sd-query-chip-popover\n #chipPopover\n [field]=\"editingField() ?? undefined\"\n [filter]=\"_editingIndex !== null ? $any(_filters[_editingIndex!]) : undefined\"\n [chipIndex]=\"_editingIndex\"\n [autoIdBase]=\"resolvedAutoId() ?? 'qb'\"\n (commit)=\"onChipPopoverCommit($event)\" />\n\n @if (_resolvedMode === 'inline') {\n <!-- ===== INLINE MODE (GitLab-style token builder) ===== -->\n\n <!-- Completed chips.\n why: track theo rowId(filter) ch\u1EE9 KH\u00D4NG theo $index \u2014 track $index g\u1EAFn chip v\u1EDBi v\u1ECB tr\u00ED,\n n\u00EAn xo\u00E1 filter \u0111\u1EA7u ti\u00EAn s\u1EBD bind l\u1EA1i chip c\u0169 sang filter k\u1EBF ti\u1EBFp v\u00E0 k\u00E9o theo state n\u1ED9i b\u1ED9\n (inline-chip `#editing`, inline-value-chip `draft`) sang sai filter. -->\n @for (filter of _filters; track rowId(filter); let i = $index) {\n @if (_showOrConnector && i > 0) {\n <span class=\"c-or-connector\" aria-hidden=\"true\">OR</span>\n }\n @let _field = fieldByKey()[$any(filter).field];\n @if (_field) {\n @let _op = $any(filter.operator);\n @let _data = $any(filter).data;\n @let _invalid = isInvalid(filter);\n @if (_field.disabled) {\n <!-- why: chip inline l\u00E0 ch\u00EDnh \u00F4 nh\u1EADp \u2014 field b\u1ECB kho\u00E1 d\u00F9ng chip popover b\u1ECB kho\u00E1 (ch\u1EC9 hi\u1EC3n th\u1ECB), nh\u01B0 \u1EDF mode popover. -->\n <sd-query-popover-chip\n [field]=\"_field\"\n [filter]=\"filter\"\n [active]=\"isFilterActive(filter)\"\n [showOperator]=\"showOperatorFor(_field, $any(filter.operator))\"\n [valueText]=\"chipValueText(filter)\"\n [emptyText]=\"emptyTextFor(_field)\"\n [pinned]=\"!!_field.pinned\"\n [disabled]=\"true\"\n [invalid]=\"_invalid\"\n [describedBy]=\"_invalid ? _invalidHintId : undefined\"\n [menu]=\"chipPopover.menu()!\"\n (open)=\"openChipPopover(i)\"\n (remove)=\"removeFilter(i)\" />\n } @else if (_field.type === 'string' || _field.type === 'number') {\n <!-- Seamless chip \u2014 the pill is the input (string / number). -->\n <sd-query-inline-value-chip\n [field]=\"_field\"\n [operator]=\"_op\"\n [value]=\"_data\"\n [density]=\"_resolvedDensity\"\n [showOperator]=\"showOperatorFor(_field, _op)\"\n [pinned]=\"!!_field.pinned\"\n [invalid]=\"_invalid\"\n [describedBy]=\"_invalid ? _invalidHintId : undefined\"\n [autoId]=\"inlineAutoId(i, 'value')\"\n (valueChange)=\"onInlineCommit(i, $event)\"\n (remove)=\"removeFilter(i)\" />\n } @else {\n <sd-query-inline-chip\n [field]=\"_field\"\n [filter]=\"filter\"\n [density]=\"_resolvedDensity\"\n [multiple]=\"multiple(_op)\"\n [showOperator]=\"showOperatorFor(_field, _op)\"\n [pinned]=\"!!_field.pinned\"\n [invalid]=\"_invalid\"\n [describedBy]=\"_invalid ? _invalidHintId : undefined\"\n [autoId]=\"inlineAutoId(i, 'value')\"\n [valueText]=\"chipValueText(filter)\"\n [isNoData]=\"isNoDataOperator(_op)\"\n (commit)=\"onInlineCommit(i, $event)\"\n (commitRange)=\"onInlineRange(i, $event)\"\n (liveChange)=\"onInlineCommit(i, $event)\"\n (remove)=\"removeFilter(i)\" />\n }\n }\n }\n\n <!-- Building chip (in-progress) \u2014 extracted into <sd-query-build-chip>. -->\n @if (building(); as _b) {\n <sd-query-build-chip\n [building]=\"_b\"\n [density]=\"_resolvedDensity\"\n [allowedOperators]=\"allowedOperatorsFor(_b.field)\"\n [multiple]=\"multiple($any(_b.operator))\"\n [showOperator]=\"showOperatorFor(_b.field, _b.operator)\"\n (pickOperator)=\"pickBuildOperator($any($event))\"\n (commitValue)=\"commitBuildValue($event)\"\n (cancel)=\"cancelBuild()\"\n (seamlessCommit)=\"onBuildSeamlessCommit($event)\" />\n }\n\n <!-- Add filter -->\n <button\n type=\"button\"\n class=\"c-add-filter\"\n [matMenuTriggerFor]=\"addPicker.menu()\"\n [disabled]=\"_addDisabled\"\n [matTooltip]=\"_resolvedFields.length === 0 ? _noFieldsLabel : _addFilterLabel\"\n (menuOpened)=\"addPicker.focusFind()\">\n <sd-icon name=\"add\"></sd-icon>\n </button>\n } @else {\n <!-- ===== POPOVER MODE (default) \u2014 compact chips edited via mat-menu ===== -->\n <!-- why: track theo rowId(filter) \u2014 xem ghi ch\u00FA \u1EDF nh\u00E1nh inline. -->\n @for (filter of _filters; track rowId(filter); let i = $index) {\n @if (_showOrConnector && i > 0) {\n <span class=\"c-or-connector\" aria-hidden=\"true\">OR</span>\n }\n @let _field = fieldByKey()[$any(filter).field];\n @let _active = isFilterActive(filter);\n @let _invalid = isInvalid(filter);\n <!-- why: menu close commit is handled by chipPopover's (commit) \u2192\n onChipPopoverCommit; popover-chip only signals open + remove here. -->\n <sd-query-popover-chip\n [field]=\"_field\"\n [filter]=\"filter\"\n [active]=\"_active\"\n [showOperator]=\"showOperatorFor(_field, $any(filter.operator))\"\n [valueText]=\"chipValueText(filter)\"\n [emptyText]=\"emptyTextFor(_field)\"\n [pinned]=\"!!_field?.pinned\"\n [disabled]=\"!!_field?.disabled\"\n [invalid]=\"_invalid\"\n [describedBy]=\"_invalid ? _invalidHintId : undefined\"\n [menu]=\"chipPopover.menu()!\"\n (open)=\"openChipPopover(i)\"\n (remove)=\"removeFilter(i)\" />\n }\n\n <!-- Add filter trigger -->\n <button\n type=\"button\"\n class=\"c-add-filter\"\n [matMenuTriggerFor]=\"addPicker.menu()\"\n [disabled]=\"_addDisabled\"\n [matTooltip]=\"_resolvedFields.length === 0 ? _noFieldsLabel : _addFilterLabel\"\n (menuOpened)=\"addPicker.focusFind()\">\n <sd-icon name=\"add\"></sd-icon>\n </button>\n }\n\n </div><!-- /.c-query-bar__main -->\n\n <!-- Field picker \u2014 list available fields, fade ones already in use. Pinned fields\n always have their chip, so the picker leaves them out. -->\n <sd-query-field-picker\n #addPicker\n [fields]=\"pickerFields()\"\n [usedKeys]=\"_usedFieldKeys\"\n (pick)=\"_resolvedMode === 'inline' ? beginBuild($event) : addFilter($event)\" />\n\n <sd-query-actions-bar\n [showLogicToggle]=\"resolvedShowLogicToggle()\"\n [(logic)]=\"logic\"\n [filtersCount]=\"_filters.length\"\n [clearCount]=\"activeCount()\"\n [clearDisabled]=\"resolvedClearDisabled()\"\n [showSavedFilters]=\"resolvedShowSavedFilters()\"\n [savedFiltersKey]=\"resolvedSavedFiltersKey()\"\n [query]=\"currentQuery()\"\n (applyFilter)=\"onApplyFilter($event)\"\n [showClearAll]=\"resolvedShowClearAll()\"\n [canSearch]=\"canSearch()\"\n [showSearchButton]=\"resolvedApplyOn() !== 'commit'\"\n (clear)=\"onClearClick()\"\n (search)=\"triggerApply()\" />\n\n <!-- Host content pinned after the toolbar (e.g. sd-table's quick-search right slot). -->\n <ng-content select=\"[sdQueryBarEnd]\" />\n</div>\n", styles: [":host{display:block;font-family:Roboto,system-ui,sans-serif}.c-query-bar{display:flex;align-items:flex-start;flex-wrap:nowrap;gap:8px;background:var(--sd-query-bar-bg, #ffffff);border:1px solid var(--sd-query-bar-border-soft, #e2e4e7);border-radius:var(--sd-radius-8, 8px);box-shadow:0 1px 2px #0f172a0a}.c-query-bar.c-density-compact{padding:8px}.c-query-bar.c-density-comfortable{padding:10px}.c-query-bar.c-appearance-flush{background:transparent;border:0;border-radius:0;box-shadow:none;padding:8px 12px}.c-query-bar__main{flex:1 1 auto;min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:6px}.c-search{display:flex;align-items:center;gap:6px;min-width:220px;padding:0 10px;background:var(--sd-query-bar-bg, #ffffff);border:1px solid var(--sd-control-border, var(--sd-border));border-radius:var(--sd-control-radius, 8px)}.c-search:hover{border-color:var(--sd-control-border-hover, var(--sd-border-strong))}.c-search:focus-within{border-color:var(--sd-control-border-focus, var(--sd-primary));box-shadow:var(--sd-control-ring, none);outline:none}@media(forced-colors:active){.c-search:focus-within{--sd-control-focus-ring: Highlight;outline:2px solid var(--sd-control-focus-ring);outline-offset:2px}}.c-density-compact .c-search{height:28px}.c-density-comfortable .c-search{height:32px}.c-search .c-search-icon{font-size:var(--sd-font-size-16, 16px);width:16px;height:16px;color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-search .c-search-input{flex:1;border:none;outline:none;background:transparent;font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text, #212121)}.c-search .c-search-input::placeholder{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-search .c-search-kbd{font-family:Roboto Mono,monospace;font-size:var(--sd-font-size-10, 10px);padding:1px 4px;border:1px solid var(--sd-query-bar-border-soft, #e2e4e7);border-radius:3px;color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-divider{width:1px;height:16px;background:var(--sd-query-bar-border-soft, #e2e4e7);margin:0 2px}.c-token{display:inline-flex;align-items:center;gap:4px;padding:0 0 0 12px;border:1px solid var(--sd-primary-light);border-radius:999px;background:var(--sd-primary-light);font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text-secondary, #5f6368);white-space:nowrap;overflow:hidden}.c-density-compact .c-token{height:28px}.c-density-comfortable .c-token{height:32px}.c-token-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px;line-height:14px;color:inherit}.c-token-field{font-weight:var(--sd-font-weight-medium, 500);line-height:1}.c-token-op{display:inline-flex;align-items:center;color:inherit}.c-token-value-edit sd-select,.c-token-value-edit sd-date,.c-token-value-edit sd-datetime{display:inline-flex;align-items:center;line-height:1}.c-token ::ng-deep .mat-mdc-form-field{line-height:1}.c-token ::ng-deep .mat-mdc-text-field-wrapper,.c-token ::ng-deep .mat-mdc-form-field-flex{padding:0;min-height:0;background:transparent}.c-token ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}.c-token ::ng-deep .mat-mdc-select-value,.c-token ::ng-deep .mat-mdc-input-element,.c-token ::ng-deep input{line-height:1;font-size:var(--sd-font-size-13, 13px);padding:0;height:auto;color:inherit}.c-token ::ng-deep .mat-mdc-select-value{display:inline-flex;align-items:center;min-width:0;max-width:200px;overflow:hidden;text-overflow:ellipsis;color:var(--sd-primary);font-weight:var(--sd-font-weight-medium, 500)}.c-token ::ng-deep .sd-suffix-icon{display:none}.c-token-sep{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-token-dash{color:var(--sd-query-bar-text-muted, #7a7a7a);padding:0 4px;line-height:1}.c-token-value{border:none;background:transparent;padding:0;font:inherit;font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-primary);cursor:pointer}.c-token-value:hover{text-decoration:underline}.c-token-value-edit{display:inline-flex;align-items:center;gap:4px;max-width:240px}.c-token-value-edit sd-input,.c-token-value-edit sd-input-number{display:inline-flex;max-width:140px}.c-token-value-edit sd-date-range{display:inline-flex;max-width:220px;min-width:0;flex:0 1 auto}.c-token-multi-head{display:inline-block;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}.c-token-remove{align-self:stretch;display:inline-flex;align-items:center;justify-content:center;border:none;border-left:1px solid rgba(0,0,0,.04);border-radius:0;background:transparent;cursor:pointer;color:inherit}.c-density-compact .c-token-remove{width:26px}.c-density-comfortable .c-token-remove{width:28px}.c-token-remove sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-token-remove:hover{background:#0000000d}.c-add-filter{display:inline-flex;align-items:center;justify-content:center;padding:0;border-radius:999px;border:1px dashed var(--sd-query-bar-border, #d6d8db);background:transparent;cursor:pointer;color:var(--sd-query-bar-text-secondary, #5f6368);transition:border-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease,background-color var(--sd-duration-fast, .12s) ease}.c-density-compact .c-add-filter{width:28px;height:28px}.c-density-comfortable .c-add-filter{width:32px;height:32px}.c-add-filter sd-icon{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px}.c-add-filter:hover:not([disabled]){border-color:var(--sd-primary);color:var(--sd-primary)}.c-add-filter[disabled]{opacity:.5;cursor:not-allowed}.c-or-connector{font-family:Roboto Mono,monospace;font-size:var(--sd-font-size-10, 10px);font-weight:var(--sd-font-weight-bold, 700);letter-spacing:.6px;color:var(--sd-query-bar-text-muted, #7a7a7a);padding:0 2px}::ng-deep .mat-mdc-menu-panel.c-chip-popover{min-width:280px;max-width:320px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--sd-query-bar-border-soft, #e2e4e7);font-size:var(--sd-font-size-13, 13px);font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-query-bar-text, #212121)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header>sd-icon{font-size:var(--sd-font-size-16, 16px);width:16px;height:16px;color:var(--sd-primary)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header .c-pop-header-operator{margin-left:auto}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header-field{display:inline-flex;align-items:center;gap:4px;padding:2px 4px 2px 6px;margin-left:-4px;background:transparent;border:1px solid transparent;border-radius:var(--sd-radius-4, 4px);font:inherit;font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-query-bar-text, #212121);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease,border-color var(--sd-duration-fast, .12s) ease}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header-field sd-icon{font-size:var(--sd-font-size-14, 14px)!important;width:14px!important;height:14px!important;color:var(--sd-query-bar-text-muted, #7a7a7a)!important}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header-field:hover{background:var(--sd-query-bar-bg-soft, #f5f6f7);border-color:var(--sd-query-bar-border-soft, #e2e4e7)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-body{padding:10px 12px;display:flex;flex-direction:column;gap:12px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-input{width:100%;height:32px;padding:0 10px;border:1px solid var(--sd-query-bar-border, #d6d8db);border-radius:6px;background:var(--sd-query-bar-bg, #ffffff);font-family:inherit;font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text, #212121);outline:none}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-input:focus{border-color:var(--sd-primary)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-input:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:1px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-between{display:grid;grid-template-columns:1fr 1fr;gap:8px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-boolean{display:flex;gap:8px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-boolean button{flex:1;height:32px;border:1px solid var(--sd-query-bar-border, #d6d8db);border-radius:6px;background:var(--sd-query-bar-bg, #ffffff);font:inherit;font-size:var(--sd-font-size-13, 13px);cursor:pointer}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-boolean button.c-pop-boolean-active{background:var(--sd-primary-light);border-color:var(--sd-primary);color:var(--sd-primary)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-values{max-height:220px;overflow-y:auto;margin:0;padding:0;list-style:none}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-values li{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:var(--sd-radius-4, 4px);font-size:var(--sd-font-size-13, 13px);cursor:pointer;-webkit-user-select:none;user-select:none}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-values li:hover{background:var(--sd-query-bar-bg-soft, #f5f6f7)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-values li.c-pop-value-selected{background:var(--sd-primary-light);color:var(--sd-primary)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-values li input[type=checkbox],::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-values li input[type=radio]{accent-color:var(--sd-primary)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-values-loading,::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-values-empty{padding:10px 8px;font-size:var(--sd-font-size-12, 12px);color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-bool-toggle{display:inline-flex;align-items:center;gap:4px}.c-bool-toggle ::ng-deep .mdc-button,.c-bool-toggle ::ng-deep button[mat-button],.c-bool-toggle ::ng-deep button[mat-stroked-button],.c-bool-toggle ::ng-deep button[mat-flat-button]{border-radius:var(--sd-radius-999, 999px);min-width:0;padding:0 12px}\n", ".c-query-bar ::ng-deep .mat-mdc-form-field .mat-mdc-select-arrow,.c-query-bar ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-icon-suffix sd-icon{color:var(--sd-query-bar-text-secondary, #5f6368)}.c-query-bar ::ng-deep .mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--sd-primary)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .mat-mdc-form-field .mat-mdc-select-arrow,::ng-deep .mat-mdc-menu-panel.c-chip-popover .mat-mdc-form-field .mat-mdc-form-field-icon-suffix sd-icon,::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .mat-mdc-form-field .mat-mdc-select-arrow,::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .mat-mdc-form-field .mat-mdc-form-field-icon-suffix sd-icon{color:var(--sd-query-bar-text-secondary, #5f6368)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .mat-mdc-form-field.mat-focused .mat-mdc-select-arrow,::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--sd-primary)}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "directive", type: i1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: SdQueryActionsBar, selector: "sd-query-actions-bar", inputs: ["showLogicToggle", "logic", "filtersCount", "showSavedFilters", "savedFiltersKey", "query", "showClearAll", "clearCount", "clearDisabled", "canSearch", "showSearchButton"], outputs: ["logicChange", "applyFilter", "clear", "search"] }, { kind: "component", type: SdQueryBuildChip, selector: "sd-query-build-chip", inputs: ["building", "density", "allowedOperators", "multiple", "showOperator", "autoId"], outputs: ["pickOperator", "commitValue", "cancel", "seamlessCommit", "draftChange", "draftCommit"] }, { kind: "component", type: SdQueryChipPopover, selector: "sd-query-chip-popover", inputs: ["field", "filter", "chipIndex", "autoIdBase", "switchPickerMenu"], outputs: ["commit", "swapField"] }, { kind: "component", type: SdQueryFieldPicker, selector: "sd-query-field-picker", inputs: ["fields", "currentKey", "usedKeys"], outputs: ["pick"] }, { kind: "component", type: SdQueryInlineChip, selector: "sd-query-inline-chip", inputs: ["field", "filter", "density", "multiple", "showOperator", "autoId", "valueText", "isNoData", "pinned", "invalid", "describedBy"], outputs: ["commit", "commitRange", "liveChange", "remove"] }, { kind: "component", type: SdQueryInlineValueChip, selector: "sd-query-inline-value-chip", inputs: ["field", "operator", "value", "density", "showOperator", "autoId", "autofocus", "pinned", "invalid", "describedBy"], outputs: ["valueChange", "remove"] }, { kind: "component", type: SdQueryPopoverChip, selector: "sd-query-popover-chip", inputs: ["field", "filter", "active", "showOperator", "valueText", "emptyText", "pinned", "disabled", "invalid", "describedBy", "menu"], outputs: ["open", "remove"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3053
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdQueryBar, isStandalone: true, selector: "sd-query-bar", inputs: { option: { classPropertyName: "option", publicName: "option", isSignal: true, isRequired: false, transformFunction: null }, autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null }, filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, logic: { classPropertyName: "logic", publicName: "logic", isSignal: true, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, showSearch: { classPropertyName: "showSearch", publicName: "showSearch", isSignal: true, isRequired: false, transformFunction: null }, showSavedFilters: { classPropertyName: "showSavedFilters", publicName: "showSavedFilters", isSignal: true, isRequired: false, transformFunction: null }, savedFiltersKey: { classPropertyName: "savedFiltersKey", publicName: "savedFiltersKey", isSignal: true, isRequired: false, transformFunction: null }, showLogicToggle: { classPropertyName: "showLogicToggle", publicName: "showLogicToggle", isSignal: true, isRequired: false, transformFunction: null }, showClearAll: { classPropertyName: "showClearAll", publicName: "showClearAll", isSignal: true, isRequired: false, transformFunction: null }, showOperatorOnChip: { classPropertyName: "showOperatorOnChip", publicName: "showOperatorOnChip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filters: "filtersChange", logic: "logicChange", search: "searchChange", queryChange: "queryChange", apply: "apply" }, host: { listeners: { "click": "onMainClick($event)", "keydown": "onMainKeydown($event)" } }, providers: [ɵSdQueryPanelGroup], viewQueries: [{ propertyName: "popoverChips", predicate: SdQueryPopoverChip, descendants: true, isSignal: true }, { propertyName: "buildChip", first: true, predicate: SdQueryBuildChip, descendants: true, isSignal: true }, { propertyName: "chipPopover", first: true, predicate: SdQueryChipPopover, descendants: true, isSignal: true }, { propertyName: "addInput", first: true, predicate: ["addInput"], descendants: true, isSignal: true }, { propertyName: "addPicker", first: true, predicate: SdQueryFieldPicker, descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n sd-query-bar \u2014 unified filter chip row (Jira/Linear/Notion style).\n Panels (field picker, chip popover, saved filters) share one CDK Overlay frame \u2014 handoff\n design_handoff_sd_query_bar_panels.\n-->\n@let _filters = filters();\n@let _resolvedFields = resolvedFields();\n@let _resolvedDensity = resolvedDensity();\n@let _showOrConnector = showOrConnector();\n@let _usedFieldKeys = usedFieldKeys();\n@let _editingIndex = editingIndex();\n@let _resolvedMode = resolvedMode();\n@let _noFieldsLabel = noFieldsLabel();\n@let _addFilterLabel = addFilterLabel();\n@let _addDisabled = addDisabled();\n@let _invalidHintId = resolvedInvalidHintId();\n@let _autoId = resolvedAutoId();\n\n<div\n class=\"c-query-bar\"\n [class.c-density-compact]=\"_resolvedDensity === 'compact'\"\n [class.c-density-comfortable]=\"_resolvedDensity === 'comfortable'\"\n [class.c-appearance-flush]=\"resolvedAppearance() === 'flush'\">\n\n <!-- Main region \u2014 search + filters + add-filter. Wraps internally; the right\n action toolbar stays anchored and does NOT flow with this. -->\n <div class=\"c-query-bar__main\">\n\n <!-- Free-text search (left, optional) -->\n @if (resolvedShowSearch()) {\n <!-- Handoff m\u1EE5c 7: primitive t\u00ECm ki\u1EBFm d\u00F9ng chung \u2014 c\u1EE1 xs (28px) \u1EDF density compact, sm (32px) \u1EDF comfortable. -->\n <sd-search-field\n class=\"c-search\"\n clearable\n [size]=\"_resolvedDensity === 'compact' ? 'xs' : 'sm'\"\n [clearLabel]=\"searchClearLabel()\"\n [autoId]=\"_autoId ? _autoId + '-search' : undefined\"\n (cleared)=\"clearSearch()\">\n <input\n sdSearchFieldInput\n type=\"text\"\n enterkeyhint=\"search\"\n autocomplete=\"off\"\n [attr.aria-label]=\"searchLabel()\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-search' : null\"\n [placeholder]=\"searchPlaceholder()\"\n [value]=\"search()\"\n (input)=\"setSearch($any($event.target).value)\"\n (keydown.enter)=\"applySearch()\"\n (keydown.escape)=\"onSearchEscape($event)\" />\n </sd-search-field>\n <span class=\"c-divider\" aria-hidden=\"true\"></span>\n }\n\n <!-- Chip popover \u2014 extracted into <sd-query-chip-popover>. Declared BEFORE chips\n so the popover-mode @for chips can bind their [panel] to `chipPopover.panel()`.\n why: m\u1EDF popover \u0111\u1EC3 EDIT ch\u1EC9 cho ch\u1EC9nh operator + value \u2014 KH\u00D4NG \u0111\u1ED5i field (handoff M7):\n header render nh\u00E3n field t\u0129nh (read-only). Mu\u1ED1n \u0111\u1ED5i field th\u00EC xo\u00E1 chip r\u1ED3i th\u00EAm l\u1EA1i. -->\n <sd-query-chip-popover\n #chipPopover\n [field]=\"editingField() ?? undefined\"\n [filter]=\"_editingIndex !== null ? $any(_filters[_editingIndex!]) : undefined\"\n [chipIndex]=\"_editingIndex\"\n [autoIdBase]=\"resolvedAutoId()\"\n (commit)=\"onChipPopoverCommit($event)\" />\n\n @if (_resolvedMode === 'inline') {\n <!-- ===== INLINE MODE (GitLab-style token builder) ===== -->\n\n <!-- Completed chips.\n why: track theo rowId(filter) ch\u1EE9 KH\u00D4NG theo $index \u2014 track $index g\u1EAFn chip v\u1EDBi v\u1ECB tr\u00ED,\n n\u00EAn xo\u00E1 filter \u0111\u1EA7u ti\u00EAn s\u1EBD bind l\u1EA1i chip c\u0169 sang filter k\u1EBF ti\u1EBFp v\u00E0 k\u00E9o theo state n\u1ED9i b\u1ED9\n (inline-chip `#editing`, inline-value-chip `draft`) sang sai filter. -->\n @for (filter of _filters; track rowId(filter); let i = $index) {\n @if (_showOrConnector && i > 0) {\n <span class=\"c-or-connector\" aria-hidden=\"true\">OR</span>\n }\n @let _field = fieldByKey()[$any(filter).field];\n @if (_field) {\n @let _op = $any(filter.operator);\n @let _data = $any(filter).data;\n @let _invalid = isInvalid(filter);\n @if (_field.disabled) {\n <!-- why: chip inline l\u00E0 ch\u00EDnh \u00F4 nh\u1EADp \u2014 field b\u1ECB kho\u00E1 d\u00F9ng chip popover b\u1ECB kho\u00E1 (ch\u1EC9 hi\u1EC3n th\u1ECB), nh\u01B0 \u1EDF mode popover. -->\n <sd-query-popover-chip\n [field]=\"_field\"\n [filter]=\"filter\"\n [active]=\"isFilterActive(filter)\"\n [showOperator]=\"showOperatorFor(_field, $any(filter.operator))\"\n [valueText]=\"chipValueText(filter)\"\n [emptyText]=\"emptyTextFor(_field)\"\n [pinned]=\"isLocked(_field)\"\n [required]=\"!!_field.required\"\n [disabled]=\"true\"\n [invalid]=\"_invalid\"\n [describedBy]=\"_invalid ? _invalidHintId : undefined\"\n [panel]=\"chipPopover.panel()\"\n (open)=\"openChipPopover(i)\"\n (remove)=\"removeFilter(i)\" />\n } @else if (_field.type === 'string' || _field.type === 'number') {\n <!-- Seamless chip \u2014 the pill is the input (string / number). -->\n <sd-query-inline-value-chip\n [field]=\"_field\"\n [operator]=\"_op\"\n [value]=\"_data\"\n [density]=\"_resolvedDensity\"\n [showOperator]=\"showOperatorFor(_field, _op)\"\n [pinned]=\"isLocked(_field)\"\n [required]=\"!!_field.required\"\n [invalid]=\"_invalid\"\n [describedBy]=\"_invalid ? _invalidHintId : undefined\"\n [autoId]=\"inlineAutoId(i, 'value')\"\n (valueChange)=\"onInlineCommit(i, $event)\"\n (remove)=\"removeFilter(i)\" />\n } @else {\n <sd-query-inline-chip\n [field]=\"_field\"\n [filter]=\"filter\"\n [density]=\"_resolvedDensity\"\n [multiple]=\"multiple(_op)\"\n [showOperator]=\"showOperatorFor(_field, _op)\"\n [pinned]=\"isLocked(_field)\"\n [required]=\"!!_field.required\"\n [invalid]=\"_invalid\"\n [describedBy]=\"_invalid ? _invalidHintId : undefined\"\n [autoId]=\"inlineAutoId(i, 'value')\"\n [valueText]=\"chipValueText(filter)\"\n [isNoData]=\"isNoDataOperator(_op)\"\n (commit)=\"onInlineCommit(i, $event)\"\n (commitRange)=\"onInlineRange(i, $event)\"\n (liveChange)=\"onInlineCommit(i, $event)\"\n (remove)=\"removeFilter(i)\" />\n }\n }\n }\n\n <!-- Building chip (in-progress) \u2014 extracted into <sd-query-build-chip>. -->\n @if (building(); as _b) {\n <sd-query-build-chip\n [building]=\"_b\"\n [density]=\"_resolvedDensity\"\n [allowedOperators]=\"allowedOperatorsFor(_b.field)\"\n [multiple]=\"multiple($any(_b.operator))\"\n [showOperator]=\"showOperatorFor(_b.field, _b.operator)\"\n (pickOperator)=\"pickBuildOperator($any($event))\"\n (commitValue)=\"commitBuildValue($event)\"\n (cancel)=\"cancelBuild()\"\n (seamlessCommit)=\"onBuildSeamlessCommit($event)\" />\n }\n\n <!-- Th\u00EAm \u0111i\u1EC1u ki\u1EC7n (handoff m\u1EE5c 8): \u00F4 combobox \u0111i\u1EC1u khi\u1EC3n listbox c\u1EE7a field picker, focus th\u1EADt \u1EDF l\u1EA1i trong \u00F4.\n Kh\u00F4ng t\u1EF1 m\u1EDF khi ch\u1EC9 Tab t\u1EDBi. H\u1EBFt field th\u00EC \u00F4 kho\u00E1, tooltip n\u00F3i l\u00FD do nh\u01B0 n\u00FAt + tr\u01B0\u1EDBc \u0111\u00E2y. -->\n <div\n class=\"c-add-condition\"\n [class.c-add-condition--disabled]=\"_addDisabled\"\n [matTooltip]=\"_addDisabled ? (_resolvedFields.length === 0 ? _noFieldsLabel : _addFilterLabel) : ''\">\n <sd-icon class=\"c-add-condition-icon\" name=\"add\" size=\"16px\" aria-hidden=\"true\"></sd-icon>\n <input\n #addInput\n class=\"c-add-condition-input\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-autocomplete=\"list\"\n [attr.aria-expanded]=\"addPicker.panel().isOpen()\"\n [attr.aria-controls]=\"addPicker.listId\"\n [attr.aria-activedescendant]=\"addPicker.panel().isOpen() ? addPicker.activeId() : null\"\n [attr.aria-label]=\"addConditionLabel()\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-add-condition' : null\"\n [placeholder]=\"addConditionLabel()\"\n [disabled]=\"_addDisabled\"\n [value]=\"addQuery()\"\n (input)=\"onAddInput($any($event.target).value)\"\n (click)=\"openAddList()\"\n (keydown)=\"onAddKeydown($event)\" />\n </div>\n } @else {\n <!-- ===== POPOVER MODE (default) \u2014 compact chips edited in the chip popover panel ===== -->\n <!-- why: track theo rowId(filter) \u2014 xem ghi ch\u00FA \u1EDF nh\u00E1nh inline. -->\n @for (filter of _filters; track rowId(filter); let i = $index) {\n @if (_showOrConnector && i > 0) {\n <span class=\"c-or-connector\" aria-hidden=\"true\">OR</span>\n }\n @let _field = fieldByKey()[$any(filter).field];\n @let _active = isFilterActive(filter);\n @let _invalid = isInvalid(filter);\n <!-- why: menu close commit is handled by chipPopover's (commit) \u2192\n onChipPopoverCommit; popover-chip only signals open + remove here. -->\n <sd-query-popover-chip\n [field]=\"_field\"\n [filter]=\"filter\"\n [active]=\"_active\"\n [showOperator]=\"showOperatorFor(_field, $any(filter.operator))\"\n [valueText]=\"chipValueText(filter)\"\n [emptyText]=\"emptyTextFor(_field)\"\n [pinned]=\"isLocked(_field)\"\n [required]=\"!!_field?.required\"\n [disabled]=\"!!_field?.disabled\"\n [invalid]=\"_invalid\"\n [describedBy]=\"_invalid ? _invalidHintId : undefined\"\n [panel]=\"chipPopover.panel()\"\n (open)=\"openChipPopover(i)\"\n (remove)=\"removeFilter(i)\" />\n }\n\n <!-- Add filter trigger -->\n <button\n type=\"button\"\n class=\"c-add-filter\"\n [sdQueryPanelTrigger]=\"addPicker.panel()\"\n [disabled]=\"_addDisabled\"\n [matTooltip]=\"_resolvedFields.length === 0 ? _noFieldsLabel : _addFilterLabel\"\n [attr.aria-label]=\"_resolvedFields.length === 0 ? _noFieldsLabel : _addFilterLabel\">\n <sd-icon name=\"add\"></sd-icon>\n </button>\n }\n\n </div><!-- /.c-query-bar__main -->\n\n <!-- Field picker \u2014 list available fields, fade ones already in use. Pinned fields\n always have their chip, so the picker leaves them out. -->\n <sd-query-field-picker\n #addPicker\n [fields]=\"pickerFields()\"\n [usedKeys]=\"_usedFieldKeys\"\n [autoId]=\"resolvedAutoId()\"\n [findBox]=\"_resolvedMode !== 'inline'\"\n (pick)=\"onPick($event)\"\n (closed)=\"addQuery.set('')\" />\n\n <sd-query-actions-bar\n [showLogicToggle]=\"resolvedShowLogicToggle()\"\n [(logic)]=\"logic\"\n [filtersCount]=\"_filters.length\"\n [clearCount]=\"activeCount()\"\n [clearDisabled]=\"resolvedClearDisabled()\"\n [showSavedFilters]=\"resolvedShowSavedFilters()\"\n [savedFiltersKey]=\"resolvedSavedFiltersKey()\"\n [query]=\"currentQuery()\"\n [canSaveFilter]=\"canSaveFilter()\"\n [autoId]=\"resolvedAutoId()\"\n (applyFilter)=\"onApplyFilter($event)\"\n [showClearAll]=\"resolvedShowClearAll()\"\n [canSearch]=\"canSearch()\"\n [showSearchButton]=\"resolvedApplyOn() !== 'commit'\"\n (clear)=\"onClearClick()\"\n (search)=\"triggerApply()\" />\n\n <!-- Host content pinned after the toolbar (e.g. sd-table's quick-search right slot). -->\n <ng-content select=\"[sdQueryBarEnd]\" />\n</div>\n", styles: [":host{display:block;font-family:Roboto,system-ui,sans-serif}.c-query-bar{display:flex;align-items:flex-start;flex-wrap:nowrap;gap:8px;background:var(--sd-query-bar-bg, #ffffff);border:1px solid var(--sd-query-bar-border-soft, #e2e4e7);border-radius:var(--sd-radius-8, 8px);box-shadow:0 1px 2px #0f172a0a}.c-query-bar.c-density-compact{padding:8px}.c-query-bar.c-density-comfortable{padding:10px}.c-query-bar.c-appearance-flush{background:transparent;border:0;border-radius:0;box-shadow:none;padding:8px 12px}.c-query-bar__main{flex:1 1 auto;min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:6px}.c-search{flex:0 0 auto;min-width:220px}.c-divider{width:1px;height:16px;background:var(--sd-query-bar-border-soft, #e2e4e7);margin:0 2px}.c-token{display:inline-flex;align-items:center;gap:4px;padding:0 0 0 12px;border:1px solid var(--sd-primary-light);border-radius:999px;background:var(--sd-primary-light);font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text-secondary, #5f6368);white-space:nowrap;overflow:hidden}.c-density-compact .c-token{height:28px}.c-density-comfortable .c-token{height:32px}.c-token-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px;line-height:14px;color:inherit}.c-token-field{font-weight:var(--sd-font-weight-medium, 500);line-height:1}.c-token-op{display:inline-flex;align-items:center;color:inherit}.c-token-value-edit sd-select,.c-token-value-edit sd-date,.c-token-value-edit sd-datetime{display:inline-flex;align-items:center;line-height:1}.c-token ::ng-deep .mat-mdc-form-field{line-height:1}.c-token ::ng-deep .mat-mdc-text-field-wrapper,.c-token ::ng-deep .mat-mdc-form-field-flex{padding:0;min-height:0;background:transparent}.c-token ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}.c-token ::ng-deep .mat-mdc-select-value,.c-token ::ng-deep .mat-mdc-input-element,.c-token ::ng-deep input{line-height:1;font-size:var(--sd-font-size-13, 13px);padding:0;height:auto;color:inherit}.c-token ::ng-deep .mat-mdc-select-value{display:inline-flex;align-items:center;min-width:0;max-width:200px;overflow:hidden;text-overflow:ellipsis;color:var(--sd-primary);font-weight:var(--sd-font-weight-medium, 500)}.c-token ::ng-deep .sd-suffix-icon{display:none}.c-token-sep{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-token-dash{color:var(--sd-query-bar-text-muted, #7a7a7a);padding:0 4px;line-height:1}.c-token-value{border:none;background:transparent;padding:0;font:inherit;font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-primary);cursor:pointer}.c-token-value:hover{text-decoration:underline}.c-token-value-edit{display:inline-flex;align-items:center;gap:4px;max-width:240px}.c-token-value-edit sd-input,.c-token-value-edit sd-input-number{display:inline-flex;max-width:140px}.c-token-value-edit sd-date-range{display:inline-flex;max-width:220px;min-width:0;flex:0 1 auto}.c-token-multi-head{display:inline-block;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}.c-token-remove{align-self:stretch;display:inline-flex;align-items:center;justify-content:center;border:none;border-left:1px solid rgba(0,0,0,.04);border-radius:0;background:transparent;cursor:pointer;color:inherit}.c-density-compact .c-token-remove{width:26px}.c-density-comfortable .c-token-remove{width:28px}.c-token-remove sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-token-remove:hover{background:#0000000d}.c-add-filter{display:inline-flex;align-items:center;justify-content:center;padding:0;border-radius:999px;border:1px dashed var(--sd-query-bar-border, #d6d8db);background:transparent;cursor:pointer;color:var(--sd-query-bar-text-secondary, #5f6368);transition:border-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease,background-color var(--sd-duration-fast, .12s) ease}.c-density-compact .c-add-filter{width:28px;height:28px}.c-density-comfortable .c-add-filter{width:32px;height:32px}.c-add-filter sd-icon{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px}.c-add-filter:hover:not([disabled]){border-color:var(--sd-primary);color:var(--sd-primary)}.c-add-filter[disabled]{opacity:.5;cursor:not-allowed}.c-add-condition{display:flex;flex:1 1 150px;align-items:center;gap:6px;box-sizing:border-box;min-width:150px;padding:0 8px;border-radius:var(--sd-radius-6, 6px);color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-density-compact .c-add-condition{height:28px}.c-density-comfortable .c-add-condition{height:32px}.c-add-condition:focus-within{box-shadow:inset 0 0 0 1px var(--sd-primary)}.c-add-condition.c-add-condition--disabled{opacity:.5}.c-add-condition-icon{flex:0 0 16px;width:16px;height:16px;font-size:var(--sd-font-size-16, 16px);color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-add-condition-input{flex:1 1 auto;min-width:0;height:100%;margin:0;padding:0;border:0;background:transparent;color:var(--sd-query-bar-text, #212121);font:inherit;font-size:var(--sd-font-size-13, 13px)}.c-add-condition-input:focus{outline:none}.c-add-condition-input::placeholder{color:var(--sd-query-bar-text-muted, #7a7a7a);opacity:1}.c-add-condition-input:disabled{cursor:not-allowed}@media(forced-colors:active){.c-add-condition:focus-within{--sd-control-focus-ring: Highlight;outline:2px solid var(--sd-control-focus-ring);outline-offset:-2px}}.c-or-connector{font-family:Roboto Mono,monospace;font-size:var(--sd-font-size-10, 10px);font-weight:var(--sd-font-weight-bold, 700);letter-spacing:.6px;color:var(--sd-query-bar-text-muted, #7a7a7a);padding:0 2px}.c-bool-toggle{display:inline-flex;align-items:center;gap:4px}.c-bool-toggle ::ng-deep .mdc-button,.c-bool-toggle ::ng-deep button[mat-button],.c-bool-toggle ::ng-deep button[mat-stroked-button],.c-bool-toggle ::ng-deep button[mat-flat-button]{border-radius:var(--sd-radius-999, 999px);min-width:0;padding:0 12px}\n", ".c-query-bar ::ng-deep .mat-mdc-form-field .mat-mdc-select-arrow,.c-query-bar ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-icon-suffix sd-icon{color:var(--sd-query-bar-text-secondary, #5f6368)}.c-query-bar ::ng-deep .mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--sd-primary)}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: ɵSdQueryPanelTriggerDirective, selector: "[sdQueryPanelTrigger]", inputs: ["sdQueryPanelTrigger"], outputs: ["panelOpened", "panelClosed"], exportAs: ["sdQueryPanelTrigger"] }, { kind: "component", type: _SdSearchField, selector: "sd-search-field", inputs: ["size", "clearable", "clearLabel", "autoId"], outputs: ["cleared"] }, { kind: "directive", type: _SdSearchFieldInputDirective, selector: "input[sdSearchFieldInput]" }, { kind: "component", type: SdQueryActionsBar, selector: "sd-query-actions-bar", inputs: ["showLogicToggle", "logic", "filtersCount", "showSavedFilters", "savedFiltersKey", "query", "canSaveFilter", "autoId", "showClearAll", "clearCount", "clearDisabled", "canSearch", "showSearchButton"], outputs: ["logicChange", "applyFilter", "clear", "search"] }, { kind: "component", type: SdQueryBuildChip, selector: "sd-query-build-chip", inputs: ["building", "density", "allowedOperators", "multiple", "showOperator", "autoId"], outputs: ["pickOperator", "commitValue", "cancel", "seamlessCommit", "draftChange", "draftCommit"] }, { kind: "component", type: SdQueryChipPopover, selector: "sd-query-chip-popover", inputs: ["field", "filter", "chipIndex", "autoIdBase"], outputs: ["commit"] }, { kind: "component", type: SdQueryFieldPicker, selector: "sd-query-field-picker", inputs: ["fields", "usedKeys", "autoId", "findBox"], outputs: ["pick", "closed"] }, { kind: "component", type: SdQueryInlineChip, selector: "sd-query-inline-chip", inputs: ["field", "filter", "density", "multiple", "showOperator", "autoId", "valueText", "isNoData", "pinned", "required", "invalid", "describedBy"], outputs: ["commit", "commitRange", "liveChange", "remove"] }, { kind: "component", type: SdQueryInlineValueChip, selector: "sd-query-inline-value-chip", inputs: ["field", "operator", "value", "density", "showOperator", "autoId", "autofocus", "pinned", "required", "invalid", "describedBy"], outputs: ["valueChange", "remove"] }, { kind: "component", type: SdQueryPopoverChip, selector: "sd-query-popover-chip", inputs: ["field", "filter", "active", "showOperator", "valueText", "emptyText", "pinned", "disabled", "required", "invalid", "describedBy", "panel"], outputs: ["open", "remove"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1966
3054
  }
1967
3055
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQueryBar, decorators: [{
1968
3056
  type: Component,
1969
- args: [{ selector: 'sd-query-bar', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
3057
+ args: [{ selector: 'sd-query-bar', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [ɵSdQueryPanelGroup], host: {
3058
+ '(click)': 'onMainClick($event)',
3059
+ '(keydown)': 'onMainKeydown($event)',
3060
+ }, imports: [
1970
3061
  SdIcon,
1971
3062
  CommonModule,
1972
- FormsModule,
1973
- MatMenuModule,
1974
3063
  MatTooltipModule,
3064
+ ɵSdQueryPanelTriggerDirective,
3065
+ _SdSearchField,
3066
+ _SdSearchFieldInputDirective,
1975
3067
  SdQueryActionsBar,
1976
3068
  SdQueryBuildChip,
1977
3069
  SdQueryChipPopover,
@@ -1979,8 +3071,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
1979
3071
  SdQueryInlineChip,
1980
3072
  SdQueryInlineValueChip,
1981
3073
  SdQueryPopoverChip,
1982
- ], template: "<!--\n sd-query-bar \u2014 unified filter chip row (Jira/Linear/Notion style).\n Visual spec: refs/design_handoff_sd_query_bar/README.md\n TODO(next-iter): replace inline placeholders for field-picker + chip-popover\n with extracted sub-components driven by CDK overlay.\n-->\n@let _filters = filters();\n@let _resolvedFields = resolvedFields();\n@let _resolvedDensity = resolvedDensity();\n@let _showOrConnector = showOrConnector();\n@let _usedFieldKeys = usedFieldKeys();\n@let _editingIndex = editingIndex();\n@let _resolvedMode = resolvedMode();\n@let _noFieldsLabel = noFieldsLabel();\n@let _addFilterLabel = addFilterLabel();\n@let _addDisabled = addDisabled();\n@let _invalidHintId = resolvedInvalidHintId();\n\n<div\n class=\"c-query-bar\"\n [class.c-density-compact]=\"_resolvedDensity === 'compact'\"\n [class.c-density-comfortable]=\"_resolvedDensity === 'comfortable'\"\n [class.c-appearance-flush]=\"resolvedAppearance() === 'flush'\">\n\n <!-- Main region \u2014 search + filters + add-filter. Wraps internally; the right\n action toolbar stays anchored and does NOT flow with this. -->\n <div class=\"c-query-bar__main\">\n\n <!-- Free-text search (left, optional) -->\n @if (resolvedShowSearch()) {\n <div class=\"c-search\">\n <sd-icon class=\"c-search-icon\" name=\"search\"></sd-icon>\n <input\n class=\"c-search-input\"\n type=\"text\"\n [ngModel]=\"search()\"\n (ngModelChange)=\"setSearch($event)\"\n (keydown.enter)=\"applySearch()\"\n [placeholder]=\"searchPlaceholder()\" />\n </div>\n <span class=\"c-divider\" aria-hidden=\"true\"></span>\n }\n\n <!-- Chip popover \u2014 extracted into <sd-query-chip-popover>. Declared BEFORE chips\n so the popover-mode @for chips can bind their [menu] to `chipPopover.menu()`.\n why: m\u1EDF popover \u0111\u1EC3 EDIT ch\u1EC9 cho ch\u1EC9nh operator + value \u2014 KH\u00D4NG \u0111\u1ED5i field.\n B\u1ECF [switchPickerMenu] \u2192 header render nh\u00E3n field t\u0129nh (read-only). Mu\u1ED1n \u0111\u1ED5i\n field th\u00EC xo\u00E1 chip r\u1ED3i th\u00EAm l\u1EA1i. -->\n <sd-query-chip-popover\n #chipPopover\n [field]=\"editingField() ?? undefined\"\n [filter]=\"_editingIndex !== null ? $any(_filters[_editingIndex!]) : undefined\"\n [chipIndex]=\"_editingIndex\"\n [autoIdBase]=\"resolvedAutoId() ?? 'qb'\"\n (commit)=\"onChipPopoverCommit($event)\" />\n\n @if (_resolvedMode === 'inline') {\n <!-- ===== INLINE MODE (GitLab-style token builder) ===== -->\n\n <!-- Completed chips.\n why: track theo rowId(filter) ch\u1EE9 KH\u00D4NG theo $index \u2014 track $index g\u1EAFn chip v\u1EDBi v\u1ECB tr\u00ED,\n n\u00EAn xo\u00E1 filter \u0111\u1EA7u ti\u00EAn s\u1EBD bind l\u1EA1i chip c\u0169 sang filter k\u1EBF ti\u1EBFp v\u00E0 k\u00E9o theo state n\u1ED9i b\u1ED9\n (inline-chip `#editing`, inline-value-chip `draft`) sang sai filter. -->\n @for (filter of _filters; track rowId(filter); let i = $index) {\n @if (_showOrConnector && i > 0) {\n <span class=\"c-or-connector\" aria-hidden=\"true\">OR</span>\n }\n @let _field = fieldByKey()[$any(filter).field];\n @if (_field) {\n @let _op = $any(filter.operator);\n @let _data = $any(filter).data;\n @let _invalid = isInvalid(filter);\n @if (_field.disabled) {\n <!-- why: chip inline l\u00E0 ch\u00EDnh \u00F4 nh\u1EADp \u2014 field b\u1ECB kho\u00E1 d\u00F9ng chip popover b\u1ECB kho\u00E1 (ch\u1EC9 hi\u1EC3n th\u1ECB), nh\u01B0 \u1EDF mode popover. -->\n <sd-query-popover-chip\n [field]=\"_field\"\n [filter]=\"filter\"\n [active]=\"isFilterActive(filter)\"\n [showOperator]=\"showOperatorFor(_field, $any(filter.operator))\"\n [valueText]=\"chipValueText(filter)\"\n [emptyText]=\"emptyTextFor(_field)\"\n [pinned]=\"!!_field.pinned\"\n [disabled]=\"true\"\n [invalid]=\"_invalid\"\n [describedBy]=\"_invalid ? _invalidHintId : undefined\"\n [menu]=\"chipPopover.menu()!\"\n (open)=\"openChipPopover(i)\"\n (remove)=\"removeFilter(i)\" />\n } @else if (_field.type === 'string' || _field.type === 'number') {\n <!-- Seamless chip \u2014 the pill is the input (string / number). -->\n <sd-query-inline-value-chip\n [field]=\"_field\"\n [operator]=\"_op\"\n [value]=\"_data\"\n [density]=\"_resolvedDensity\"\n [showOperator]=\"showOperatorFor(_field, _op)\"\n [pinned]=\"!!_field.pinned\"\n [invalid]=\"_invalid\"\n [describedBy]=\"_invalid ? _invalidHintId : undefined\"\n [autoId]=\"inlineAutoId(i, 'value')\"\n (valueChange)=\"onInlineCommit(i, $event)\"\n (remove)=\"removeFilter(i)\" />\n } @else {\n <sd-query-inline-chip\n [field]=\"_field\"\n [filter]=\"filter\"\n [density]=\"_resolvedDensity\"\n [multiple]=\"multiple(_op)\"\n [showOperator]=\"showOperatorFor(_field, _op)\"\n [pinned]=\"!!_field.pinned\"\n [invalid]=\"_invalid\"\n [describedBy]=\"_invalid ? _invalidHintId : undefined\"\n [autoId]=\"inlineAutoId(i, 'value')\"\n [valueText]=\"chipValueText(filter)\"\n [isNoData]=\"isNoDataOperator(_op)\"\n (commit)=\"onInlineCommit(i, $event)\"\n (commitRange)=\"onInlineRange(i, $event)\"\n (liveChange)=\"onInlineCommit(i, $event)\"\n (remove)=\"removeFilter(i)\" />\n }\n }\n }\n\n <!-- Building chip (in-progress) \u2014 extracted into <sd-query-build-chip>. -->\n @if (building(); as _b) {\n <sd-query-build-chip\n [building]=\"_b\"\n [density]=\"_resolvedDensity\"\n [allowedOperators]=\"allowedOperatorsFor(_b.field)\"\n [multiple]=\"multiple($any(_b.operator))\"\n [showOperator]=\"showOperatorFor(_b.field, _b.operator)\"\n (pickOperator)=\"pickBuildOperator($any($event))\"\n (commitValue)=\"commitBuildValue($event)\"\n (cancel)=\"cancelBuild()\"\n (seamlessCommit)=\"onBuildSeamlessCommit($event)\" />\n }\n\n <!-- Add filter -->\n <button\n type=\"button\"\n class=\"c-add-filter\"\n [matMenuTriggerFor]=\"addPicker.menu()\"\n [disabled]=\"_addDisabled\"\n [matTooltip]=\"_resolvedFields.length === 0 ? _noFieldsLabel : _addFilterLabel\"\n (menuOpened)=\"addPicker.focusFind()\">\n <sd-icon name=\"add\"></sd-icon>\n </button>\n } @else {\n <!-- ===== POPOVER MODE (default) \u2014 compact chips edited via mat-menu ===== -->\n <!-- why: track theo rowId(filter) \u2014 xem ghi ch\u00FA \u1EDF nh\u00E1nh inline. -->\n @for (filter of _filters; track rowId(filter); let i = $index) {\n @if (_showOrConnector && i > 0) {\n <span class=\"c-or-connector\" aria-hidden=\"true\">OR</span>\n }\n @let _field = fieldByKey()[$any(filter).field];\n @let _active = isFilterActive(filter);\n @let _invalid = isInvalid(filter);\n <!-- why: menu close commit is handled by chipPopover's (commit) \u2192\n onChipPopoverCommit; popover-chip only signals open + remove here. -->\n <sd-query-popover-chip\n [field]=\"_field\"\n [filter]=\"filter\"\n [active]=\"_active\"\n [showOperator]=\"showOperatorFor(_field, $any(filter.operator))\"\n [valueText]=\"chipValueText(filter)\"\n [emptyText]=\"emptyTextFor(_field)\"\n [pinned]=\"!!_field?.pinned\"\n [disabled]=\"!!_field?.disabled\"\n [invalid]=\"_invalid\"\n [describedBy]=\"_invalid ? _invalidHintId : undefined\"\n [menu]=\"chipPopover.menu()!\"\n (open)=\"openChipPopover(i)\"\n (remove)=\"removeFilter(i)\" />\n }\n\n <!-- Add filter trigger -->\n <button\n type=\"button\"\n class=\"c-add-filter\"\n [matMenuTriggerFor]=\"addPicker.menu()\"\n [disabled]=\"_addDisabled\"\n [matTooltip]=\"_resolvedFields.length === 0 ? _noFieldsLabel : _addFilterLabel\"\n (menuOpened)=\"addPicker.focusFind()\">\n <sd-icon name=\"add\"></sd-icon>\n </button>\n }\n\n </div><!-- /.c-query-bar__main -->\n\n <!-- Field picker \u2014 list available fields, fade ones already in use. Pinned fields\n always have their chip, so the picker leaves them out. -->\n <sd-query-field-picker\n #addPicker\n [fields]=\"pickerFields()\"\n [usedKeys]=\"_usedFieldKeys\"\n (pick)=\"_resolvedMode === 'inline' ? beginBuild($event) : addFilter($event)\" />\n\n <sd-query-actions-bar\n [showLogicToggle]=\"resolvedShowLogicToggle()\"\n [(logic)]=\"logic\"\n [filtersCount]=\"_filters.length\"\n [clearCount]=\"activeCount()\"\n [clearDisabled]=\"resolvedClearDisabled()\"\n [showSavedFilters]=\"resolvedShowSavedFilters()\"\n [savedFiltersKey]=\"resolvedSavedFiltersKey()\"\n [query]=\"currentQuery()\"\n (applyFilter)=\"onApplyFilter($event)\"\n [showClearAll]=\"resolvedShowClearAll()\"\n [canSearch]=\"canSearch()\"\n [showSearchButton]=\"resolvedApplyOn() !== 'commit'\"\n (clear)=\"onClearClick()\"\n (search)=\"triggerApply()\" />\n\n <!-- Host content pinned after the toolbar (e.g. sd-table's quick-search right slot). -->\n <ng-content select=\"[sdQueryBarEnd]\" />\n</div>\n", styles: [":host{display:block;font-family:Roboto,system-ui,sans-serif}.c-query-bar{display:flex;align-items:flex-start;flex-wrap:nowrap;gap:8px;background:var(--sd-query-bar-bg, #ffffff);border:1px solid var(--sd-query-bar-border-soft, #e2e4e7);border-radius:var(--sd-radius-8, 8px);box-shadow:0 1px 2px #0f172a0a}.c-query-bar.c-density-compact{padding:8px}.c-query-bar.c-density-comfortable{padding:10px}.c-query-bar.c-appearance-flush{background:transparent;border:0;border-radius:0;box-shadow:none;padding:8px 12px}.c-query-bar__main{flex:1 1 auto;min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:6px}.c-search{display:flex;align-items:center;gap:6px;min-width:220px;padding:0 10px;background:var(--sd-query-bar-bg, #ffffff);border:1px solid var(--sd-control-border, var(--sd-border));border-radius:var(--sd-control-radius, 8px)}.c-search:hover{border-color:var(--sd-control-border-hover, var(--sd-border-strong))}.c-search:focus-within{border-color:var(--sd-control-border-focus, var(--sd-primary));box-shadow:var(--sd-control-ring, none);outline:none}@media(forced-colors:active){.c-search:focus-within{--sd-control-focus-ring: Highlight;outline:2px solid var(--sd-control-focus-ring);outline-offset:2px}}.c-density-compact .c-search{height:28px}.c-density-comfortable .c-search{height:32px}.c-search .c-search-icon{font-size:var(--sd-font-size-16, 16px);width:16px;height:16px;color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-search .c-search-input{flex:1;border:none;outline:none;background:transparent;font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text, #212121)}.c-search .c-search-input::placeholder{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-search .c-search-kbd{font-family:Roboto Mono,monospace;font-size:var(--sd-font-size-10, 10px);padding:1px 4px;border:1px solid var(--sd-query-bar-border-soft, #e2e4e7);border-radius:3px;color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-divider{width:1px;height:16px;background:var(--sd-query-bar-border-soft, #e2e4e7);margin:0 2px}.c-token{display:inline-flex;align-items:center;gap:4px;padding:0 0 0 12px;border:1px solid var(--sd-primary-light);border-radius:999px;background:var(--sd-primary-light);font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text-secondary, #5f6368);white-space:nowrap;overflow:hidden}.c-density-compact .c-token{height:28px}.c-density-comfortable .c-token{height:32px}.c-token-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px;line-height:14px;color:inherit}.c-token-field{font-weight:var(--sd-font-weight-medium, 500);line-height:1}.c-token-op{display:inline-flex;align-items:center;color:inherit}.c-token-value-edit sd-select,.c-token-value-edit sd-date,.c-token-value-edit sd-datetime{display:inline-flex;align-items:center;line-height:1}.c-token ::ng-deep .mat-mdc-form-field{line-height:1}.c-token ::ng-deep .mat-mdc-text-field-wrapper,.c-token ::ng-deep .mat-mdc-form-field-flex{padding:0;min-height:0;background:transparent}.c-token ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}.c-token ::ng-deep .mat-mdc-select-value,.c-token ::ng-deep .mat-mdc-input-element,.c-token ::ng-deep input{line-height:1;font-size:var(--sd-font-size-13, 13px);padding:0;height:auto;color:inherit}.c-token ::ng-deep .mat-mdc-select-value{display:inline-flex;align-items:center;min-width:0;max-width:200px;overflow:hidden;text-overflow:ellipsis;color:var(--sd-primary);font-weight:var(--sd-font-weight-medium, 500)}.c-token ::ng-deep .sd-suffix-icon{display:none}.c-token-sep{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-token-dash{color:var(--sd-query-bar-text-muted, #7a7a7a);padding:0 4px;line-height:1}.c-token-value{border:none;background:transparent;padding:0;font:inherit;font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-primary);cursor:pointer}.c-token-value:hover{text-decoration:underline}.c-token-value-edit{display:inline-flex;align-items:center;gap:4px;max-width:240px}.c-token-value-edit sd-input,.c-token-value-edit sd-input-number{display:inline-flex;max-width:140px}.c-token-value-edit sd-date-range{display:inline-flex;max-width:220px;min-width:0;flex:0 1 auto}.c-token-multi-head{display:inline-block;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}.c-token-remove{align-self:stretch;display:inline-flex;align-items:center;justify-content:center;border:none;border-left:1px solid rgba(0,0,0,.04);border-radius:0;background:transparent;cursor:pointer;color:inherit}.c-density-compact .c-token-remove{width:26px}.c-density-comfortable .c-token-remove{width:28px}.c-token-remove sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-token-remove:hover{background:#0000000d}.c-add-filter{display:inline-flex;align-items:center;justify-content:center;padding:0;border-radius:999px;border:1px dashed var(--sd-query-bar-border, #d6d8db);background:transparent;cursor:pointer;color:var(--sd-query-bar-text-secondary, #5f6368);transition:border-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease,background-color var(--sd-duration-fast, .12s) ease}.c-density-compact .c-add-filter{width:28px;height:28px}.c-density-comfortable .c-add-filter{width:32px;height:32px}.c-add-filter sd-icon{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px}.c-add-filter:hover:not([disabled]){border-color:var(--sd-primary);color:var(--sd-primary)}.c-add-filter[disabled]{opacity:.5;cursor:not-allowed}.c-or-connector{font-family:Roboto Mono,monospace;font-size:var(--sd-font-size-10, 10px);font-weight:var(--sd-font-weight-bold, 700);letter-spacing:.6px;color:var(--sd-query-bar-text-muted, #7a7a7a);padding:0 2px}::ng-deep .mat-mdc-menu-panel.c-chip-popover{min-width:280px;max-width:320px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--sd-query-bar-border-soft, #e2e4e7);font-size:var(--sd-font-size-13, 13px);font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-query-bar-text, #212121)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header>sd-icon{font-size:var(--sd-font-size-16, 16px);width:16px;height:16px;color:var(--sd-primary)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header .c-pop-header-operator{margin-left:auto}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header-field{display:inline-flex;align-items:center;gap:4px;padding:2px 4px 2px 6px;margin-left:-4px;background:transparent;border:1px solid transparent;border-radius:var(--sd-radius-4, 4px);font:inherit;font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-query-bar-text, #212121);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease,border-color var(--sd-duration-fast, .12s) ease}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header-field sd-icon{font-size:var(--sd-font-size-14, 14px)!important;width:14px!important;height:14px!important;color:var(--sd-query-bar-text-muted, #7a7a7a)!important}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-header-field:hover{background:var(--sd-query-bar-bg-soft, #f5f6f7);border-color:var(--sd-query-bar-border-soft, #e2e4e7)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-body{padding:10px 12px;display:flex;flex-direction:column;gap:12px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-input{width:100%;height:32px;padding:0 10px;border:1px solid var(--sd-query-bar-border, #d6d8db);border-radius:6px;background:var(--sd-query-bar-bg, #ffffff);font-family:inherit;font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text, #212121);outline:none}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-input:focus{border-color:var(--sd-primary)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-input:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:1px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-between{display:grid;grid-template-columns:1fr 1fr;gap:8px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-boolean{display:flex;gap:8px}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-boolean button{flex:1;height:32px;border:1px solid var(--sd-query-bar-border, #d6d8db);border-radius:6px;background:var(--sd-query-bar-bg, #ffffff);font:inherit;font-size:var(--sd-font-size-13, 13px);cursor:pointer}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-boolean button.c-pop-boolean-active{background:var(--sd-primary-light);border-color:var(--sd-primary);color:var(--sd-primary)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-values{max-height:220px;overflow-y:auto;margin:0;padding:0;list-style:none}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-values li{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:var(--sd-radius-4, 4px);font-size:var(--sd-font-size-13, 13px);cursor:pointer;-webkit-user-select:none;user-select:none}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-values li:hover{background:var(--sd-query-bar-bg-soft, #f5f6f7)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-values li.c-pop-value-selected{background:var(--sd-primary-light);color:var(--sd-primary)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-values li input[type=checkbox],::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-values li input[type=radio]{accent-color:var(--sd-primary)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-values-loading,::ng-deep .mat-mdc-menu-panel.c-chip-popover .c-pop-values-empty{padding:10px 8px;font-size:var(--sd-font-size-12, 12px);color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-bool-toggle{display:inline-flex;align-items:center;gap:4px}.c-bool-toggle ::ng-deep .mdc-button,.c-bool-toggle ::ng-deep button[mat-button],.c-bool-toggle ::ng-deep button[mat-stroked-button],.c-bool-toggle ::ng-deep button[mat-flat-button]{border-radius:var(--sd-radius-999, 999px);min-width:0;padding:0 12px}\n", ".c-query-bar ::ng-deep .mat-mdc-form-field .mat-mdc-select-arrow,.c-query-bar ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-icon-suffix sd-icon{color:var(--sd-query-bar-text-secondary, #5f6368)}.c-query-bar ::ng-deep .mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--sd-primary)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .mat-mdc-form-field .mat-mdc-select-arrow,::ng-deep .mat-mdc-menu-panel.c-chip-popover .mat-mdc-form-field .mat-mdc-form-field-icon-suffix sd-icon,::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .mat-mdc-form-field .mat-mdc-select-arrow,::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .mat-mdc-form-field .mat-mdc-form-field-icon-suffix sd-icon{color:var(--sd-query-bar-text-secondary, #5f6368)}::ng-deep .mat-mdc-menu-panel.c-chip-popover .mat-mdc-form-field.mat-focused .mat-mdc-select-arrow,::ng-deep .mat-mdc-menu-panel.c-field-picker-menu .mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--sd-primary)}\n"] }]
1983
- }], ctorParameters: () => [], propDecorators: { popoverChips: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => SdQueryPopoverChip), { isSignal: true }] }], buildChip: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdQueryBuildChip), { isSignal: true }] }], chipPopover: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdQueryChipPopover), { isSignal: true }] }], option: [{ type: i0.Input, args: [{ isSignal: true, alias: "option", required: false }] }], autoIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], fields: [{ type: i0.Input, args: [{ isSignal: true, alias: "fields", required: false }] }], filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }, { type: i0.Output, args: ["filtersChange"] }], logic: [{ type: i0.Input, args: [{ isSignal: true, alias: "logic", required: false }] }, { type: i0.Output, args: ["logicChange"] }], search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }, { type: i0.Output, args: ["searchChange"] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], showSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSearch", required: false }] }], showSavedFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSavedFilters", required: false }] }], savedFiltersKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "savedFiltersKey", required: false }] }], showLogicToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLogicToggle", required: false }] }], showClearAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClearAll", required: false }] }], showOperatorOnChip: [{ type: i0.Input, args: [{ isSignal: true, alias: "showOperatorOnChip", required: false }] }], queryChange: [{ type: i0.Output, args: ["queryChange"] }], apply: [{ type: i0.Output, args: ["apply"] }] } });
3074
+ ], template: "<!--\n sd-query-bar \u2014 unified filter chip row (Jira/Linear/Notion style).\n Panels (field picker, chip popover, saved filters) share one CDK Overlay frame \u2014 handoff\n design_handoff_sd_query_bar_panels.\n-->\n@let _filters = filters();\n@let _resolvedFields = resolvedFields();\n@let _resolvedDensity = resolvedDensity();\n@let _showOrConnector = showOrConnector();\n@let _usedFieldKeys = usedFieldKeys();\n@let _editingIndex = editingIndex();\n@let _resolvedMode = resolvedMode();\n@let _noFieldsLabel = noFieldsLabel();\n@let _addFilterLabel = addFilterLabel();\n@let _addDisabled = addDisabled();\n@let _invalidHintId = resolvedInvalidHintId();\n@let _autoId = resolvedAutoId();\n\n<div\n class=\"c-query-bar\"\n [class.c-density-compact]=\"_resolvedDensity === 'compact'\"\n [class.c-density-comfortable]=\"_resolvedDensity === 'comfortable'\"\n [class.c-appearance-flush]=\"resolvedAppearance() === 'flush'\">\n\n <!-- Main region \u2014 search + filters + add-filter. Wraps internally; the right\n action toolbar stays anchored and does NOT flow with this. -->\n <div class=\"c-query-bar__main\">\n\n <!-- Free-text search (left, optional) -->\n @if (resolvedShowSearch()) {\n <!-- Handoff m\u1EE5c 7: primitive t\u00ECm ki\u1EBFm d\u00F9ng chung \u2014 c\u1EE1 xs (28px) \u1EDF density compact, sm (32px) \u1EDF comfortable. -->\n <sd-search-field\n class=\"c-search\"\n clearable\n [size]=\"_resolvedDensity === 'compact' ? 'xs' : 'sm'\"\n [clearLabel]=\"searchClearLabel()\"\n [autoId]=\"_autoId ? _autoId + '-search' : undefined\"\n (cleared)=\"clearSearch()\">\n <input\n sdSearchFieldInput\n type=\"text\"\n enterkeyhint=\"search\"\n autocomplete=\"off\"\n [attr.aria-label]=\"searchLabel()\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-search' : null\"\n [placeholder]=\"searchPlaceholder()\"\n [value]=\"search()\"\n (input)=\"setSearch($any($event.target).value)\"\n (keydown.enter)=\"applySearch()\"\n (keydown.escape)=\"onSearchEscape($event)\" />\n </sd-search-field>\n <span class=\"c-divider\" aria-hidden=\"true\"></span>\n }\n\n <!-- Chip popover \u2014 extracted into <sd-query-chip-popover>. Declared BEFORE chips\n so the popover-mode @for chips can bind their [panel] to `chipPopover.panel()`.\n why: m\u1EDF popover \u0111\u1EC3 EDIT ch\u1EC9 cho ch\u1EC9nh operator + value \u2014 KH\u00D4NG \u0111\u1ED5i field (handoff M7):\n header render nh\u00E3n field t\u0129nh (read-only). Mu\u1ED1n \u0111\u1ED5i field th\u00EC xo\u00E1 chip r\u1ED3i th\u00EAm l\u1EA1i. -->\n <sd-query-chip-popover\n #chipPopover\n [field]=\"editingField() ?? undefined\"\n [filter]=\"_editingIndex !== null ? $any(_filters[_editingIndex!]) : undefined\"\n [chipIndex]=\"_editingIndex\"\n [autoIdBase]=\"resolvedAutoId()\"\n (commit)=\"onChipPopoverCommit($event)\" />\n\n @if (_resolvedMode === 'inline') {\n <!-- ===== INLINE MODE (GitLab-style token builder) ===== -->\n\n <!-- Completed chips.\n why: track theo rowId(filter) ch\u1EE9 KH\u00D4NG theo $index \u2014 track $index g\u1EAFn chip v\u1EDBi v\u1ECB tr\u00ED,\n n\u00EAn xo\u00E1 filter \u0111\u1EA7u ti\u00EAn s\u1EBD bind l\u1EA1i chip c\u0169 sang filter k\u1EBF ti\u1EBFp v\u00E0 k\u00E9o theo state n\u1ED9i b\u1ED9\n (inline-chip `#editing`, inline-value-chip `draft`) sang sai filter. -->\n @for (filter of _filters; track rowId(filter); let i = $index) {\n @if (_showOrConnector && i > 0) {\n <span class=\"c-or-connector\" aria-hidden=\"true\">OR</span>\n }\n @let _field = fieldByKey()[$any(filter).field];\n @if (_field) {\n @let _op = $any(filter.operator);\n @let _data = $any(filter).data;\n @let _invalid = isInvalid(filter);\n @if (_field.disabled) {\n <!-- why: chip inline l\u00E0 ch\u00EDnh \u00F4 nh\u1EADp \u2014 field b\u1ECB kho\u00E1 d\u00F9ng chip popover b\u1ECB kho\u00E1 (ch\u1EC9 hi\u1EC3n th\u1ECB), nh\u01B0 \u1EDF mode popover. -->\n <sd-query-popover-chip\n [field]=\"_field\"\n [filter]=\"filter\"\n [active]=\"isFilterActive(filter)\"\n [showOperator]=\"showOperatorFor(_field, $any(filter.operator))\"\n [valueText]=\"chipValueText(filter)\"\n [emptyText]=\"emptyTextFor(_field)\"\n [pinned]=\"isLocked(_field)\"\n [required]=\"!!_field.required\"\n [disabled]=\"true\"\n [invalid]=\"_invalid\"\n [describedBy]=\"_invalid ? _invalidHintId : undefined\"\n [panel]=\"chipPopover.panel()\"\n (open)=\"openChipPopover(i)\"\n (remove)=\"removeFilter(i)\" />\n } @else if (_field.type === 'string' || _field.type === 'number') {\n <!-- Seamless chip \u2014 the pill is the input (string / number). -->\n <sd-query-inline-value-chip\n [field]=\"_field\"\n [operator]=\"_op\"\n [value]=\"_data\"\n [density]=\"_resolvedDensity\"\n [showOperator]=\"showOperatorFor(_field, _op)\"\n [pinned]=\"isLocked(_field)\"\n [required]=\"!!_field.required\"\n [invalid]=\"_invalid\"\n [describedBy]=\"_invalid ? _invalidHintId : undefined\"\n [autoId]=\"inlineAutoId(i, 'value')\"\n (valueChange)=\"onInlineCommit(i, $event)\"\n (remove)=\"removeFilter(i)\" />\n } @else {\n <sd-query-inline-chip\n [field]=\"_field\"\n [filter]=\"filter\"\n [density]=\"_resolvedDensity\"\n [multiple]=\"multiple(_op)\"\n [showOperator]=\"showOperatorFor(_field, _op)\"\n [pinned]=\"isLocked(_field)\"\n [required]=\"!!_field.required\"\n [invalid]=\"_invalid\"\n [describedBy]=\"_invalid ? _invalidHintId : undefined\"\n [autoId]=\"inlineAutoId(i, 'value')\"\n [valueText]=\"chipValueText(filter)\"\n [isNoData]=\"isNoDataOperator(_op)\"\n (commit)=\"onInlineCommit(i, $event)\"\n (commitRange)=\"onInlineRange(i, $event)\"\n (liveChange)=\"onInlineCommit(i, $event)\"\n (remove)=\"removeFilter(i)\" />\n }\n }\n }\n\n <!-- Building chip (in-progress) \u2014 extracted into <sd-query-build-chip>. -->\n @if (building(); as _b) {\n <sd-query-build-chip\n [building]=\"_b\"\n [density]=\"_resolvedDensity\"\n [allowedOperators]=\"allowedOperatorsFor(_b.field)\"\n [multiple]=\"multiple($any(_b.operator))\"\n [showOperator]=\"showOperatorFor(_b.field, _b.operator)\"\n (pickOperator)=\"pickBuildOperator($any($event))\"\n (commitValue)=\"commitBuildValue($event)\"\n (cancel)=\"cancelBuild()\"\n (seamlessCommit)=\"onBuildSeamlessCommit($event)\" />\n }\n\n <!-- Th\u00EAm \u0111i\u1EC1u ki\u1EC7n (handoff m\u1EE5c 8): \u00F4 combobox \u0111i\u1EC1u khi\u1EC3n listbox c\u1EE7a field picker, focus th\u1EADt \u1EDF l\u1EA1i trong \u00F4.\n Kh\u00F4ng t\u1EF1 m\u1EDF khi ch\u1EC9 Tab t\u1EDBi. H\u1EBFt field th\u00EC \u00F4 kho\u00E1, tooltip n\u00F3i l\u00FD do nh\u01B0 n\u00FAt + tr\u01B0\u1EDBc \u0111\u00E2y. -->\n <div\n class=\"c-add-condition\"\n [class.c-add-condition--disabled]=\"_addDisabled\"\n [matTooltip]=\"_addDisabled ? (_resolvedFields.length === 0 ? _noFieldsLabel : _addFilterLabel) : ''\">\n <sd-icon class=\"c-add-condition-icon\" name=\"add\" size=\"16px\" aria-hidden=\"true\"></sd-icon>\n <input\n #addInput\n class=\"c-add-condition-input\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-autocomplete=\"list\"\n [attr.aria-expanded]=\"addPicker.panel().isOpen()\"\n [attr.aria-controls]=\"addPicker.listId\"\n [attr.aria-activedescendant]=\"addPicker.panel().isOpen() ? addPicker.activeId() : null\"\n [attr.aria-label]=\"addConditionLabel()\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-add-condition' : null\"\n [placeholder]=\"addConditionLabel()\"\n [disabled]=\"_addDisabled\"\n [value]=\"addQuery()\"\n (input)=\"onAddInput($any($event.target).value)\"\n (click)=\"openAddList()\"\n (keydown)=\"onAddKeydown($event)\" />\n </div>\n } @else {\n <!-- ===== POPOVER MODE (default) \u2014 compact chips edited in the chip popover panel ===== -->\n <!-- why: track theo rowId(filter) \u2014 xem ghi ch\u00FA \u1EDF nh\u00E1nh inline. -->\n @for (filter of _filters; track rowId(filter); let i = $index) {\n @if (_showOrConnector && i > 0) {\n <span class=\"c-or-connector\" aria-hidden=\"true\">OR</span>\n }\n @let _field = fieldByKey()[$any(filter).field];\n @let _active = isFilterActive(filter);\n @let _invalid = isInvalid(filter);\n <!-- why: menu close commit is handled by chipPopover's (commit) \u2192\n onChipPopoverCommit; popover-chip only signals open + remove here. -->\n <sd-query-popover-chip\n [field]=\"_field\"\n [filter]=\"filter\"\n [active]=\"_active\"\n [showOperator]=\"showOperatorFor(_field, $any(filter.operator))\"\n [valueText]=\"chipValueText(filter)\"\n [emptyText]=\"emptyTextFor(_field)\"\n [pinned]=\"isLocked(_field)\"\n [required]=\"!!_field?.required\"\n [disabled]=\"!!_field?.disabled\"\n [invalid]=\"_invalid\"\n [describedBy]=\"_invalid ? _invalidHintId : undefined\"\n [panel]=\"chipPopover.panel()\"\n (open)=\"openChipPopover(i)\"\n (remove)=\"removeFilter(i)\" />\n }\n\n <!-- Add filter trigger -->\n <button\n type=\"button\"\n class=\"c-add-filter\"\n [sdQueryPanelTrigger]=\"addPicker.panel()\"\n [disabled]=\"_addDisabled\"\n [matTooltip]=\"_resolvedFields.length === 0 ? _noFieldsLabel : _addFilterLabel\"\n [attr.aria-label]=\"_resolvedFields.length === 0 ? _noFieldsLabel : _addFilterLabel\">\n <sd-icon name=\"add\"></sd-icon>\n </button>\n }\n\n </div><!-- /.c-query-bar__main -->\n\n <!-- Field picker \u2014 list available fields, fade ones already in use. Pinned fields\n always have their chip, so the picker leaves them out. -->\n <sd-query-field-picker\n #addPicker\n [fields]=\"pickerFields()\"\n [usedKeys]=\"_usedFieldKeys\"\n [autoId]=\"resolvedAutoId()\"\n [findBox]=\"_resolvedMode !== 'inline'\"\n (pick)=\"onPick($event)\"\n (closed)=\"addQuery.set('')\" />\n\n <sd-query-actions-bar\n [showLogicToggle]=\"resolvedShowLogicToggle()\"\n [(logic)]=\"logic\"\n [filtersCount]=\"_filters.length\"\n [clearCount]=\"activeCount()\"\n [clearDisabled]=\"resolvedClearDisabled()\"\n [showSavedFilters]=\"resolvedShowSavedFilters()\"\n [savedFiltersKey]=\"resolvedSavedFiltersKey()\"\n [query]=\"currentQuery()\"\n [canSaveFilter]=\"canSaveFilter()\"\n [autoId]=\"resolvedAutoId()\"\n (applyFilter)=\"onApplyFilter($event)\"\n [showClearAll]=\"resolvedShowClearAll()\"\n [canSearch]=\"canSearch()\"\n [showSearchButton]=\"resolvedApplyOn() !== 'commit'\"\n (clear)=\"onClearClick()\"\n (search)=\"triggerApply()\" />\n\n <!-- Host content pinned after the toolbar (e.g. sd-table's quick-search right slot). -->\n <ng-content select=\"[sdQueryBarEnd]\" />\n</div>\n", styles: [":host{display:block;font-family:Roboto,system-ui,sans-serif}.c-query-bar{display:flex;align-items:flex-start;flex-wrap:nowrap;gap:8px;background:var(--sd-query-bar-bg, #ffffff);border:1px solid var(--sd-query-bar-border-soft, #e2e4e7);border-radius:var(--sd-radius-8, 8px);box-shadow:0 1px 2px #0f172a0a}.c-query-bar.c-density-compact{padding:8px}.c-query-bar.c-density-comfortable{padding:10px}.c-query-bar.c-appearance-flush{background:transparent;border:0;border-radius:0;box-shadow:none;padding:8px 12px}.c-query-bar__main{flex:1 1 auto;min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:6px}.c-search{flex:0 0 auto;min-width:220px}.c-divider{width:1px;height:16px;background:var(--sd-query-bar-border-soft, #e2e4e7);margin:0 2px}.c-token{display:inline-flex;align-items:center;gap:4px;padding:0 0 0 12px;border:1px solid var(--sd-primary-light);border-radius:999px;background:var(--sd-primary-light);font-size:var(--sd-font-size-13, 13px);color:var(--sd-query-bar-text-secondary, #5f6368);white-space:nowrap;overflow:hidden}.c-density-compact .c-token{height:28px}.c-density-comfortable .c-token{height:32px}.c-token-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px;line-height:14px;color:inherit}.c-token-field{font-weight:var(--sd-font-weight-medium, 500);line-height:1}.c-token-op{display:inline-flex;align-items:center;color:inherit}.c-token-value-edit sd-select,.c-token-value-edit sd-date,.c-token-value-edit sd-datetime{display:inline-flex;align-items:center;line-height:1}.c-token ::ng-deep .mat-mdc-form-field{line-height:1}.c-token ::ng-deep .mat-mdc-text-field-wrapper,.c-token ::ng-deep .mat-mdc-form-field-flex{padding:0;min-height:0;background:transparent}.c-token ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}.c-token ::ng-deep .mat-mdc-select-value,.c-token ::ng-deep .mat-mdc-input-element,.c-token ::ng-deep input{line-height:1;font-size:var(--sd-font-size-13, 13px);padding:0;height:auto;color:inherit}.c-token ::ng-deep .mat-mdc-select-value{display:inline-flex;align-items:center;min-width:0;max-width:200px;overflow:hidden;text-overflow:ellipsis;color:var(--sd-primary);font-weight:var(--sd-font-weight-medium, 500)}.c-token ::ng-deep .sd-suffix-icon{display:none}.c-token-sep{color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-token-dash{color:var(--sd-query-bar-text-muted, #7a7a7a);padding:0 4px;line-height:1}.c-token-value{border:none;background:transparent;padding:0;font:inherit;font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-primary);cursor:pointer}.c-token-value:hover{text-decoration:underline}.c-token-value-edit{display:inline-flex;align-items:center;gap:4px;max-width:240px}.c-token-value-edit sd-input,.c-token-value-edit sd-input-number{display:inline-flex;max-width:140px}.c-token-value-edit sd-date-range{display:inline-flex;max-width:220px;min-width:0;flex:0 1 auto}.c-token-multi-head{display:inline-block;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}.c-token-remove{align-self:stretch;display:inline-flex;align-items:center;justify-content:center;border:none;border-left:1px solid rgba(0,0,0,.04);border-radius:0;background:transparent;cursor:pointer;color:inherit}.c-density-compact .c-token-remove{width:26px}.c-density-comfortable .c-token-remove{width:28px}.c-token-remove sd-icon{font-size:var(--sd-font-size-14, 14px);width:14px;height:14px}.c-token-remove:hover{background:#0000000d}.c-add-filter{display:inline-flex;align-items:center;justify-content:center;padding:0;border-radius:999px;border:1px dashed var(--sd-query-bar-border, #d6d8db);background:transparent;cursor:pointer;color:var(--sd-query-bar-text-secondary, #5f6368);transition:border-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease,background-color var(--sd-duration-fast, .12s) ease}.c-density-compact .c-add-filter{width:28px;height:28px}.c-density-comfortable .c-add-filter{width:32px;height:32px}.c-add-filter sd-icon{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px}.c-add-filter:hover:not([disabled]){border-color:var(--sd-primary);color:var(--sd-primary)}.c-add-filter[disabled]{opacity:.5;cursor:not-allowed}.c-add-condition{display:flex;flex:1 1 150px;align-items:center;gap:6px;box-sizing:border-box;min-width:150px;padding:0 8px;border-radius:var(--sd-radius-6, 6px);color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-density-compact .c-add-condition{height:28px}.c-density-comfortable .c-add-condition{height:32px}.c-add-condition:focus-within{box-shadow:inset 0 0 0 1px var(--sd-primary)}.c-add-condition.c-add-condition--disabled{opacity:.5}.c-add-condition-icon{flex:0 0 16px;width:16px;height:16px;font-size:var(--sd-font-size-16, 16px);color:var(--sd-query-bar-text-muted, #7a7a7a)}.c-add-condition-input{flex:1 1 auto;min-width:0;height:100%;margin:0;padding:0;border:0;background:transparent;color:var(--sd-query-bar-text, #212121);font:inherit;font-size:var(--sd-font-size-13, 13px)}.c-add-condition-input:focus{outline:none}.c-add-condition-input::placeholder{color:var(--sd-query-bar-text-muted, #7a7a7a);opacity:1}.c-add-condition-input:disabled{cursor:not-allowed}@media(forced-colors:active){.c-add-condition:focus-within{--sd-control-focus-ring: Highlight;outline:2px solid var(--sd-control-focus-ring);outline-offset:-2px}}.c-or-connector{font-family:Roboto Mono,monospace;font-size:var(--sd-font-size-10, 10px);font-weight:var(--sd-font-weight-bold, 700);letter-spacing:.6px;color:var(--sd-query-bar-text-muted, #7a7a7a);padding:0 2px}.c-bool-toggle{display:inline-flex;align-items:center;gap:4px}.c-bool-toggle ::ng-deep .mdc-button,.c-bool-toggle ::ng-deep button[mat-button],.c-bool-toggle ::ng-deep button[mat-stroked-button],.c-bool-toggle ::ng-deep button[mat-flat-button]{border-radius:var(--sd-radius-999, 999px);min-width:0;padding:0 12px}\n", ".c-query-bar ::ng-deep .mat-mdc-form-field .mat-mdc-select-arrow,.c-query-bar ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-icon-suffix sd-icon{color:var(--sd-query-bar-text-secondary, #5f6368)}.c-query-bar ::ng-deep .mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--sd-primary)}\n"] }]
3075
+ }], ctorParameters: () => [], propDecorators: { popoverChips: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => SdQueryPopoverChip), { isSignal: true }] }], buildChip: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdQueryBuildChip), { isSignal: true }] }], chipPopover: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdQueryChipPopover), { isSignal: true }] }], option: [{ type: i0.Input, args: [{ isSignal: true, alias: "option", required: false }] }], autoIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], fields: [{ type: i0.Input, args: [{ isSignal: true, alias: "fields", required: false }] }], filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }, { type: i0.Output, args: ["filtersChange"] }], logic: [{ type: i0.Input, args: [{ isSignal: true, alias: "logic", required: false }] }, { type: i0.Output, args: ["logicChange"] }], search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }, { type: i0.Output, args: ["searchChange"] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], showSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSearch", required: false }] }], showSavedFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSavedFilters", required: false }] }], savedFiltersKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "savedFiltersKey", required: false }] }], showLogicToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLogicToggle", required: false }] }], showClearAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClearAll", required: false }] }], showOperatorOnChip: [{ type: i0.Input, args: [{ isSignal: true, alias: "showOperatorOnChip", required: false }] }], queryChange: [{ type: i0.Output, args: ["queryChange"] }], apply: [{ type: i0.Output, args: ["apply"] }], addInput: [{ type: i0.ViewChild, args: ['addInput', { isSignal: true }] }], addPicker: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdQueryFieldPicker), { isSignal: true }] }] } });
1984
3076
 
1985
3077
  /**
1986
3078
  * Generated bundle index. Do not edit.