@elasticias/ui 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elasticias/ui",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.0.0",
6
6
  "@angular/core": "^21.0.0",
@@ -850,16 +850,22 @@
850
850
  color: var(--text-mute);
851
851
  }
852
852
 
853
- .pager .size select {
854
- font: inherit;
855
- font-size: 12.5px;
853
+ /* The lines-per-page control is an <ef-select> (`.es--sm`, 32px) so it
854
+ matches every other dropdown in the app. Only the width needs walking
855
+ back: the shared trigger is full-width with a 200px floor, which is
856
+ right in a form column and far too wide next to a page count. */
857
+ .pager .size ef-select {
858
+ flex: 0 0 auto;
859
+ }
860
+
861
+ .pager .size .es.p-select {
862
+ width: auto;
863
+ min-width: 0;
856
864
  font-weight: 600;
857
- background: var(--paper);
858
- border: 1px solid var(--rule);
859
- border-radius: var(--r-md);
860
- padding: 5px 8px;
861
- color: var(--text);
862
- min-height: 30px;
865
+ }
866
+
867
+ .pager .size .es .p-select-label {
868
+ padding-right: 2px;
863
869
  }
864
870
 
865
871
  /* ──────────── BULK ACTIONS BAR ─────────────────────────────────── */
@@ -1419,6 +1425,25 @@
1419
1425
  inset-inline-start: 0;
1420
1426
  }
1421
1427
 
1428
+ /* Not enough room below the trigger — flip above it, and reverse the
1429
+ entry slide so the menu still moves away from its trigger. */
1430
+ .row-actions__menu.up {
1431
+ top: auto;
1432
+ bottom: calc(100% + 8px);
1433
+ animation-name: row-actions-menu-in-up;
1434
+ }
1435
+
1436
+ @keyframes row-actions-menu-in-up {
1437
+ from {
1438
+ opacity: 0;
1439
+ transform: translateY(4px) scale(0.98);
1440
+ }
1441
+ to {
1442
+ opacity: 1;
1443
+ transform: none;
1444
+ }
1445
+ }
1446
+
1422
1447
  @keyframes row-actions-menu-in {
1423
1448
  from {
1424
1449
  opacity: 0;
@@ -3927,6 +3952,101 @@ input.ef-input[type='number'] {
3927
3952
  color: var(--tenant-700);
3928
3953
  }
3929
3954
 
3955
+ /* ── Confirm dialog ───────────────────────────────────────────
3956
+ `ef-confirm-dialog` hands PrimeNG's confirm modal the `es-dialog`
3957
+ classes, so the panel, header, footer and close button above already
3958
+ apply. What is left is what only the confirm modal renders: an icon
3959
+ and a message in the body, and the accept / reject pair in the
3960
+ footer, which are `p-button`s rather than our own `.btn`. */
3961
+
3962
+ .es-confirm .p-dialog-content {
3963
+ display: flex;
3964
+ align-items: center;
3965
+ gap: var(--s-3);
3966
+ }
3967
+
3968
+ /* Same 36px tile as the dialog header icon, tinted like a warning
3969
+ since that is what a confirmation is. */
3970
+ .es-confirm .p-confirmdialog-icon {
3971
+ width: 36px;
3972
+ height: 36px;
3973
+ border-radius: var(--r-pill);
3974
+ display: inline-grid;
3975
+ place-items: center;
3976
+ background: var(--st-pending-bg);
3977
+ color: var(--st-pending-fg);
3978
+ font-size: 15px;
3979
+ flex-shrink: 0;
3980
+ }
3981
+
3982
+ .es-confirm .p-confirmdialog-message {
3983
+ font-size: 14px;
3984
+ line-height: 1.5;
3985
+ color: var(--text);
3986
+ margin: 0;
3987
+ }
3988
+
3989
+ /* Action pair — `.btn` shape and tokens, applied to the p-buttons
3990
+ PrimeNG renders. Written out rather than shared with `.btn` because
3991
+ these carry PrimeNG's own base rules at equal specificity, and the
3992
+ two-class selector is what wins. */
3993
+ .es-confirm .p-confirmdialog-accept-button,
3994
+ .es-confirm .p-confirmdialog-reject-button {
3995
+ appearance: none;
3996
+ font: inherit;
3997
+ font-size: 13.5px;
3998
+ font-weight: 600;
3999
+ line-height: 1;
4000
+ letter-spacing: -0.005em;
4001
+ padding: 10px 18px;
4002
+ min-height: var(--hit-base);
4003
+ border-radius: var(--r-pill);
4004
+ border: 1px solid transparent;
4005
+ display: inline-flex;
4006
+ align-items: center;
4007
+ gap: 8px;
4008
+ cursor: pointer;
4009
+ transition: all var(--t-base) var(--ease-spring);
4010
+ }
4011
+
4012
+ .es-confirm .p-confirmdialog-accept-button:active,
4013
+ .es-confirm .p-confirmdialog-reject-button:active {
4014
+ transform: scale(0.97);
4015
+ }
4016
+
4017
+ .es-confirm .p-confirmdialog-accept-button {
4018
+ background: var(--ink-active);
4019
+ color: var(--paper);
4020
+ border-color: var(--ink-active);
4021
+ }
4022
+
4023
+ .es-confirm .p-confirmdialog-accept-button:hover {
4024
+ background: var(--ink-active);
4025
+ transform: translateY(-1px);
4026
+ box-shadow: var(--shadow-2, 0 4px 14px -4px rgba(15, 17, 21, 0.1));
4027
+ }
4028
+
4029
+ /* The reject button is a secondary + outlined p-button, whose own colour
4030
+ rule matches this one's specificity — the footer in the selector is
4031
+ what makes ours win, so "Annuler" reads at --text like every other
4032
+ ghost button rather than PrimeNG's muted grey. */
4033
+ .es-confirm .p-dialog-footer .p-confirmdialog-reject-button {
4034
+ background: var(--paper-alt);
4035
+ color: var(--text);
4036
+ border-color: var(--rule);
4037
+ }
4038
+
4039
+ .es-confirm .p-dialog-footer .p-confirmdialog-reject-button:hover {
4040
+ background: var(--paper-alt);
4041
+ border-color: var(--text);
4042
+ }
4043
+
4044
+ .es-confirm .p-confirmdialog-accept-button:focus-visible,
4045
+ .es-confirm .p-confirmdialog-reject-button:focus-visible {
4046
+ outline: 2px solid var(--tenant-400);
4047
+ outline-offset: 2px;
4048
+ }
4049
+
3930
4050
  .es-dialog .es-dialog__title-block {
3931
4051
  display: grid;
3932
4052
  gap: 2px;
@@ -889,6 +889,34 @@ declare class EfDialogComponent {
889
889
  static ngAcceptInputType_saveDisabled: unknown;
890
890
  }
891
891
 
892
+ /**
893
+ * The app-wide confirmation modal, wearing the same skin as `ef-dialog`.
894
+ *
895
+ * PrimeNG's `<p-confirmdialog>` renders an ordinary `<p-dialog>` inside
896
+ * itself and forwards `styleClass` to its root, so handing it the
897
+ * `es-dialog` classes makes every rule that dresses `ef-dialog` — the
898
+ * paper-alt panel, the rule-separated header and footer, the Bricolage
899
+ * title, the ghost close — apply here too. Only the confirm-specific
900
+ * internals (the icon tile, the message, the two action buttons) need
901
+ * their own rules, and those live beside the rest in `_patterns.scss`.
902
+ *
903
+ * Drop one instance at the application root; the content is driven by
904
+ * `ConfirmDialogService.confirm()`, not by inputs.
905
+ *
906
+ * ```html
907
+ * <ef-confirm-dialog />
908
+ * ```
909
+ */
910
+ declare class EfConfirmDialogComponent {
911
+ /** Panel width preset, mirroring `ef-dialog`'s `size`. */
912
+ readonly size: _angular_core.InputSignal<"sm" | "md" | "lg">;
913
+ /** Extra classes appended to the panel. */
914
+ readonly styleClass: _angular_core.InputSignal<string>;
915
+ protected readonly effectiveStyleClass: () => string;
916
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<EfConfirmDialogComponent, never>;
917
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EfConfirmDialogComponent, "ef-confirm-dialog", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
918
+ }
919
+
892
920
  declare class EfFieldsetComponent {
893
921
  /** Direct legend text (not translated) */
894
922
  legend?: string;
@@ -4053,6 +4081,8 @@ declare class EfColumnHeaderTemplateDirective {
4053
4081
  *
4054
4082
  * Behaviour:
4055
4083
  * - Click the trigger to toggle. Trigger gets `.open` (ink-active) while the menu is open.
4084
+ * - Only one row menu is open at a time — opening one closes the last.
4085
+ * - The menu flips above the trigger when there isn't room below it.
4056
4086
  * - Click outside or press `Escape` to close.
4057
4087
  * - Clicking an item runs its `command` then closes the menu.
4058
4088
  * - dblclick on the trigger or menu does NOT propagate, so the data-card's
@@ -4088,9 +4118,35 @@ declare class EfRowActionsComponent {
4088
4118
  readonly visibleItems: _angular_core.Signal<readonly EfRowAction[]>;
4089
4119
  /** Open state. */
4090
4120
  readonly open: _angular_core.WritableSignal<boolean>;
4121
+ /** Menu renders above the trigger instead of below it. */
4122
+ readonly dropUp: _angular_core.WritableSignal<boolean>;
4123
+ /**
4124
+ * The one menu currently open, app-wide.
4125
+ *
4126
+ * The trigger click is stopped from reaching `document` so it can't
4127
+ * select or open the row, which also means no other instance's
4128
+ * outside-click listener ever sees it. Without an explicit hand-off
4129
+ * every menu clicked stays open and they stack up on screen.
4130
+ */
4131
+ private static openInstance;
4091
4132
  toggle(event: MouseEvent): void;
4092
4133
  runCommand(action: EfRowAction, event: MouseEvent): void;
4093
4134
  close(): void;
4135
+ /** Gap between the trigger and the menu, plus a little breathing room
4136
+ * against the viewport edge. Matches `top: calc(100% + 8px)`. */
4137
+ private static readonly EDGE_GAP;
4138
+ /**
4139
+ * Drop upward when the menu would not fit below the trigger and there
4140
+ * is more room above. On a short viewport where it fits neither way,
4141
+ * below wins, which is where it has always been.
4142
+ */
4143
+ private shouldDropUp;
4144
+ /** Rough height before the menu exists: item padding + line box, with
4145
+ * dividers and the menu's own padding and border. */
4146
+ private estimateMenuHeight;
4147
+ /** Re-decide against the rendered height — item labels wrap, and the
4148
+ * estimate can't know that. */
4149
+ private correctPlacementAfterRender;
4094
4150
  /** Bubbling DOM event so ancestors (e.g. ef-data-card) can react —
4095
4151
  * see `.tbl-wrap.has-open-menu { overflow: visible }`. */
4096
4152
  private dispatchToggle;
@@ -4142,6 +4198,14 @@ declare class EfPagerComponent {
4142
4198
  readonly hideSize: _angular_core.InputSignal<boolean>;
4143
4199
  readonly pageChange: _angular_core.OutputEmitterRef<number>;
4144
4200
  readonly pageSizeChange: _angular_core.OutputEmitterRef<number>;
4201
+ /** Falls back to the first configured option if the value ever goes empty. */
4202
+ private get defaultSize();
4203
+ /** `pageSizeOptions` shaped for `ef-select`, which reads a label and a
4204
+ * value off each option rather than taking bare primitives. */
4205
+ readonly sizeOptions: _angular_core.Signal<{
4206
+ label: string;
4207
+ value: number;
4208
+ }[]>;
4145
4209
  readonly totalPages: _angular_core.Signal<number>;
4146
4210
  readonly range: _angular_core.Signal<{
4147
4211
  start: number;
@@ -4150,7 +4214,7 @@ declare class EfPagerComponent {
4150
4214
  /** First page · current ±1 · last page, with ellipsis fillers. */
4151
4215
  readonly pageButtons: _angular_core.Signal<readonly PageBtn[]>;
4152
4216
  goToPage(page: number): void;
4153
- onSizeChange(value: string): void;
4217
+ onSizeChange(value: number | string | null): void;
4154
4218
  trackBtn(index: number, btn: PageBtn): string;
4155
4219
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EfPagerComponent, never>;
4156
4220
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<EfPagerComponent, "ef-pager", never, { "pageNumber": { "alias": "pageNumber"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "totalCount": { "alias": "totalCount"; "required": false; "isSignal": true; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; "isSignal": true; }; "linesPerPageLabelKey": { "alias": "linesPerPageLabelKey"; "required": false; "isSignal": true; }; "ofLabelKey": { "alias": "ofLabelKey"; "required": false; "isSignal": true; }; "prevLabelKey": { "alias": "prevLabelKey"; "required": false; "isSignal": true; }; "nextLabelKey": { "alias": "nextLabelKey"; "required": false; "isSignal": true; }; "hideSize": { "alias": "hideSize"; "required": false; "isSignal": true; }; }, { "pageChange": "pageChange"; "pageSizeChange": "pageSizeChange"; }, never, never, true, never>;
@@ -4960,5 +5024,5 @@ declare class EfEmailMetricsCardComponent {
4960
5024
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<EfEmailMetricsCardComponent, "ef-email-metrics-card", never, { "metrics": { "alias": "metrics"; "required": false; "isSignal": true; }; "recentEvents": { "alias": "recentEvents"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; }, { "rangeChange": "rangeChange"; }, never, never, true, never>;
4961
5025
  }
4962
5026
 
4963
- export { EF_BADGE_BG_COLORS, EF_BADGE_BG_LIGHT_COLORS, EF_BADGE_BORDER_COLORS, EF_BADGE_DEFAULTS, EF_BADGE_TEXT_COLORS, EF_CHART_PALETTE, EF_DATATABLE_ACTIONS_DEFAULTS, EF_DATATABLE_COLUMN_DEFAULTS, EF_DATATABLE_DEFAULTS, EF_STATUS_COLORS, EF_STATUS_COLOR_ALIASES, EfActivationFilterComponent, EfAppMainComponent, EfAppShellComponent, EfAppShellMobileComponent, EfAppTopComponent, EfBadgeComponent, EfBlockUiComponent, EfBlockableDivComponent, EfBottomSheetComponent, EfBulkBarComponent, EfButtonComponent, EfButtonGroupComponent, EfCardComponent, EfChangeHistoryComponent, EfChartComponent, EfCheckboxComponent, EfClearButtonComponent, EfColumnHeaderTemplateDirective, EfColumnTemplateDirective, EfCompactPipe, EfCurrencyPipe, EfDataCardComponent, EfDatatableActionBarComponent, EfDatatableComponent, EfDatepickerAdvancedComponent, EfDatepickerComponent, EfDetailToolbarComponent, EfDialogComponent, EfEmailMetricsCardComponent, EfEmptyStateComponent, EfFabComponent, EfFieldsetComponent, EfFilterDrawerComponent, EfFilterPillComponent, EfFormGridComponent, EfInputNumberComponent, EfInputTextComponent, EfKpiCardComponent, EfLabelComponent, EfModuleRailComponent, EfModuleSideComponent, EfMultiSelectComponent, EfOrderBuilderComponent, EfOrderSummaryComponent, EfPagerComponent, EfPasswordComponent, EfPdfPreviewComponent, EfPillGroupComponent, EfPresetPillComponent, EfPriceDisplayComponent, EfProductCatalogueComponent, EfProductCatalogueFilterComponent, EfProductTypeaheadComponent, EfProfileChipComponent, EfPulseComponent, EfQuantitySelectorComponent, EfQuantityStepperComponent, EfRankListComponent, EfRowActionsComponent, EfSearchToolbarComponent, EfSelectButtonComponent, EfSelectComponent, EfServerErrorsDirective, EfSkeletonComponent, EfSmartBarComponent, EfStatsComponent, EfStatusChipComponent, EfTabPanelDirective, EfTabsComponent, EfTextareaComponent, EfThemeConfiguratorComponent, EfTimelineComponent, EfToastRegionComponent, EfToggleSwitchComponent, EfToolbarComponent, EfTotalsComponent, OrderEntityHelper, OrderLineItemHelper, TruncatePipe, buildChartConfig, getColumnAlignment, mergeColumnDefaults, resolveEfStatusColor };
5027
+ export { EF_BADGE_BG_COLORS, EF_BADGE_BG_LIGHT_COLORS, EF_BADGE_BORDER_COLORS, EF_BADGE_DEFAULTS, EF_BADGE_TEXT_COLORS, EF_CHART_PALETTE, EF_DATATABLE_ACTIONS_DEFAULTS, EF_DATATABLE_COLUMN_DEFAULTS, EF_DATATABLE_DEFAULTS, EF_STATUS_COLORS, EF_STATUS_COLOR_ALIASES, EfActivationFilterComponent, EfAppMainComponent, EfAppShellComponent, EfAppShellMobileComponent, EfAppTopComponent, EfBadgeComponent, EfBlockUiComponent, EfBlockableDivComponent, EfBottomSheetComponent, EfBulkBarComponent, EfButtonComponent, EfButtonGroupComponent, EfCardComponent, EfChangeHistoryComponent, EfChartComponent, EfCheckboxComponent, EfClearButtonComponent, EfColumnHeaderTemplateDirective, EfColumnTemplateDirective, EfCompactPipe, EfConfirmDialogComponent, EfCurrencyPipe, EfDataCardComponent, EfDatatableActionBarComponent, EfDatatableComponent, EfDatepickerAdvancedComponent, EfDatepickerComponent, EfDetailToolbarComponent, EfDialogComponent, EfEmailMetricsCardComponent, EfEmptyStateComponent, EfFabComponent, EfFieldsetComponent, EfFilterDrawerComponent, EfFilterPillComponent, EfFormGridComponent, EfInputNumberComponent, EfInputTextComponent, EfKpiCardComponent, EfLabelComponent, EfModuleRailComponent, EfModuleSideComponent, EfMultiSelectComponent, EfOrderBuilderComponent, EfOrderSummaryComponent, EfPagerComponent, EfPasswordComponent, EfPdfPreviewComponent, EfPillGroupComponent, EfPresetPillComponent, EfPriceDisplayComponent, EfProductCatalogueComponent, EfProductCatalogueFilterComponent, EfProductTypeaheadComponent, EfProfileChipComponent, EfPulseComponent, EfQuantitySelectorComponent, EfQuantityStepperComponent, EfRankListComponent, EfRowActionsComponent, EfSearchToolbarComponent, EfSelectButtonComponent, EfSelectComponent, EfServerErrorsDirective, EfSkeletonComponent, EfSmartBarComponent, EfStatsComponent, EfStatusChipComponent, EfTabPanelDirective, EfTabsComponent, EfTextareaComponent, EfThemeConfiguratorComponent, EfTimelineComponent, EfToastRegionComponent, EfToggleSwitchComponent, EfToolbarComponent, EfTotalsComponent, OrderEntityHelper, OrderLineItemHelper, TruncatePipe, buildChartConfig, getColumnAlignment, mergeColumnDefaults, resolveEfStatusColor };
4964
5028
  export type { CatalogueProduct, CatalogueProductVariant, CategoryAssignment, CategoryGroup, CategoryItem, DatatableSearchEntity, DocumentConfig, EfBadgeColor, EfBadgeConfig, EfBadgeSize, EfBadgeVariant, EfButtonComptoirSeverity, EfButtonPrimeNGSeverity, EfButtonSeverity, EfChangeHistoryEntry, EfChangeHistoryFieldChange, EfChartSeries, EfChartType, EfDataCardRowAction, EfDatatableActions, EfDatatableColumn, EfDatatableColumnAlign, EfDatatableColumnType, EfDatatableConfig, EfDateFieldValue, EfDatePreset, EfDialogAction, EfDialogSeverity, EfDialogSize, EfFabPosition, EfKpiDeltaTone, EfKpiSparkline, EfPillItem, EfPresetItem, EfRankRow, EfRowAction, EfSkeletonVariant, EfStatsRow, EfStatusColor, EfStatusReferenceItem, EfTabItem, EfTabsModule, EfTabsVariant, EfTimelineItem, EfTimelineState, EfToastRegionPosition, EfTotalsGrand, EfTotalsRow, HighlightSegment, OrderChangeInfo, OrderEntity, OrderLineItem, OrderProductsSummary, OrderSummaryItem, ProductCountGroup, ProductCountGroupLabel, ProductTypeaheadRow, ProductTypeaheadSelection, ProductWithCountGroup, SelectedFilter, ValidationResult };