@ship-ui/core 0.16.1 → 0.16.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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { ElementRef, QueryList, ComponentRef, OutputRefSubscription, Type, OutputEmitterRef, AfterViewInit, OnDestroy, AfterContentInit, TemplateRef, WritableSignal, InjectionToken } from '@angular/core';
2
+ import { ElementRef, QueryList, InputSignal, OutputEmitterRef, ComponentRef, OutputRefSubscription, Type, AfterViewInit, OnDestroy, AfterContentInit, TemplateRef, WritableSignal, InjectionToken } from '@angular/core';
3
3
  import { NgModel } from '@angular/forms';
4
4
 
5
5
  type ShipAlertItem = {
@@ -99,12 +99,21 @@ declare class ShipDialog {
99
99
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ShipDialog, "sh-dialog", never, { "isOpen": { "alias": "isOpen"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; }, { "isOpen": "isOpenChange"; "closed": "closed"; }, never, ["*"], true, never>;
100
100
  }
101
101
 
102
- interface ShipDialogServiceOptions<T = any> extends ShipDialogOptions {
103
- data?: T;
104
- closed?: (...args: any[]) => void;
102
+ type Exact<T, U> = U extends T ? (keyof U extends keyof T ? U : never) : never;
103
+ type ComponentDataType<T> = T extends {
104
+ data: InputSignal<infer K>;
105
+ } ? K : void;
106
+ type ComponentClosedType<T> = T extends {
107
+ closed: OutputEmitterRef<infer U>;
108
+ } ? U : undefined;
109
+ interface ShipDialogServiceOptions<TData = any, TResult = undefined> extends ShipDialogOptions {
110
+ data?: TData extends void ? void : TData & Exact<TData, TData>;
111
+ closed?: (res: TResult) => void;
105
112
  }
106
- type ShipDialogReturn<T> = ReturnType<ShipDialogService['open']> & {
113
+ type ShipDialogInstance<T> = {
107
114
  component: T;
115
+ close: (res?: ComponentClosedType<T> | undefined) => void;
116
+ closed: OutputEmitterRef<ComponentClosedType<T> | undefined>;
108
117
  };
109
118
  declare class ShipDialogService {
110
119
  #private;
@@ -112,11 +121,10 @@ declare class ShipDialogService {
112
121
  insertedCompRef: ComponentRef<unknown> | null;
113
122
  closedFieldSub: OutputRefSubscription | null;
114
123
  compClosedSub: OutputRefSubscription | null;
115
- open<T, K = any>(component: Type<T>, options?: ShipDialogServiceOptions<K>): {
116
- component: T;
117
- close: <U>(arg?: U | undefined) => void;
118
- closed: OutputEmitterRef<void>;
119
- };
124
+ open<T extends {
125
+ data?: InputSignal<any>;
126
+ closed?: OutputEmitterRef<any>;
127
+ }, K = ComponentDataType<T>, U = ComponentClosedType<T>, _Options extends ShipDialogServiceOptions<K, U | undefined> = ShipDialogServiceOptions<K, U | undefined>>(component: Type<T>, options?: _Options): ShipDialogInstance<T>;
120
128
  ngOnDestroy(): void;
121
129
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ShipDialogService, never>;
122
130
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ShipDialogService>;
@@ -448,7 +456,7 @@ declare class ShipMenu {
448
456
  destroy: () => void;
449
457
  };
450
458
  optionsEl: _angular_core.Signal<HTMLButtonElement[]>;
451
- inputValue: _angular_core.WritableSignal<string | null | undefined>;
459
+ inputValue: _angular_core.WritableSignal<string | undefined>;
452
460
  abortController: AbortController | null;
453
461
  optionsEffect: _angular_core.EffectRef;
454
462
  keyDownEventListener: (e: KeyboardEvent) => void;
@@ -585,7 +593,7 @@ declare class ShipSelect {
585
593
  inputValueEffect: _angular_core.EffectRef;
586
594
  inputRefElEffect: _angular_core.EffectRef;
587
595
  selectedLabels: _angular_core.Signal<string>;
588
- inputState: _angular_core.Signal<"open" | "closed" | "selected" | "loading" | "open-searching" | "searching">;
596
+ inputState: _angular_core.Signal<"closed" | "selected" | "loading" | "open-searching" | "open" | "searching">;
589
597
  hasSearch: _angular_core.Signal<boolean>;
590
598
  ngOnInit(): void;
591
599
  setInitInput(): void;
@@ -784,6 +792,14 @@ declare class ShipVirtualScroll {
784
792
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ShipVirtualScroll, "sh-virtual-scroll", never, {}, {}, never, ["*"], true, never>;
785
793
  }
786
794
 
795
+ declare class ShipFormFieldExperimental {
796
+ firstInput: _angular_core.WritableSignal<string | undefined>;
797
+ hello: _angular_core.EffectRef;
798
+ myClick(): void;
799
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ShipFormFieldExperimental, never>;
800
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ShipFormFieldExperimental, "sh-form-field-experimental", never, {}, {}, never, ["*"], true, never>;
801
+ }
802
+
787
803
  declare class ShipFileDragDrop {
788
804
  filesOver: _angular_core.WritableSignal<boolean>;
789
805
  filesDropped: _angular_core.OutputEmitterRef<FileList>;
@@ -850,5 +866,5 @@ interface ShipConfig {
850
866
  sidenavType?: 'overlay' | 'simple';
851
867
  }
852
868
 
853
- export { GridSortable, SHIP_CONFIG, ShipAlert, ShipAlertContainer, ShipAlertModule, ShipAlertService, ShipBlueprint, ShipButton, ShipButtonGroup, ShipCard, ShipCheckbox, ShipChip, ShipColorPicker, ShipDatepicker, ShipDatepickerInput, ShipDaterangeInput, ShipDialog, ShipDialogService, ShipDivider, ShipEventCard, ShipFileDragDrop, ShipFileUpload, ShipFormField, ShipIcon, ShipInputMask, ShipList, ShipMenu, ShipPopover, ShipPreventWheel, ShipProgressBar, ShipRadio, ShipRangeSlider, ShipResize, ShipSelect, ShipSidenav, ShipSort, ShipSortable, ShipSpinner, ShipStepper, ShipStickyColumns, ShipTable, ShipTabs, ShipToggle, ShipToggleCard, ShipTooltip, ShipTooltipWrapper, ShipVirtualScroll, TEST_NODES, moveIndex, watchHostClass };
854
- export type { AfterDropResponse, BlueprintNode, Coordinates, ShipAlertItem, ShipAlertItemInternal, ShipAlertType, ShipConfig, ShipDialogOptions, ShipDialogReturn, ShipDialogServiceOptions, ShipPopoverOptions, ShipProgressBarMode, ShipSidenavType };
869
+ export { GridSortable, SHIP_CONFIG, ShipAlert, ShipAlertContainer, ShipAlertModule, ShipAlertService, ShipBlueprint, ShipButton, ShipButtonGroup, ShipCard, ShipCheckbox, ShipChip, ShipColorPicker, ShipDatepicker, ShipDatepickerInput, ShipDaterangeInput, ShipDialog, ShipDialogService, ShipDivider, ShipEventCard, ShipFileDragDrop, ShipFileUpload, ShipFormField, ShipFormFieldExperimental, ShipIcon, ShipInputMask, ShipList, ShipMenu, ShipPopover, ShipPreventWheel, ShipProgressBar, ShipRadio, ShipRangeSlider, ShipResize, ShipSelect, ShipSidenav, ShipSort, ShipSortable, ShipSpinner, ShipStepper, ShipStickyColumns, ShipTable, ShipTabs, ShipToggle, ShipToggleCard, ShipTooltip, ShipTooltipWrapper, ShipVirtualScroll, TEST_NODES, moveIndex, watchHostClass };
870
+ export type { AfterDropResponse, BlueprintNode, ComponentClosedType, ComponentDataType, Coordinates, Exact, ShipAlertItem, ShipAlertItemInternal, ShipAlertType, ShipConfig, ShipDialogInstance, ShipDialogOptions, ShipDialogServiceOptions, ShipPopoverOptions, ShipProgressBarMode, ShipSidenavType };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ship-ui/core",
3
3
  "license": "MIT",
4
- "version": "0.16.1",
4
+ "version": "0.16.3",
5
5
  "peerDependencies": {
6
6
  "@angular/common": ">=20",
7
7
  "@angular/core": ">=20"
@@ -133,7 +133,7 @@ $shipMenu: true !default;
133
133
  display: none;
134
134
  }
135
135
 
136
- *:not(button) {
136
+ > *:not(button) {
137
137
  display: none;
138
138
  }
139
139
  }
@@ -160,13 +160,13 @@ $shipMenu: true !default;
160
160
 
161
161
  button {
162
162
  display: flex;
163
- justify-content: flex-start;
164
- align-items: center;
163
+ flex-direction: column;
164
+ justify-content: center;
165
165
  text-align: left;
166
166
  min-height: p2r(32);
167
167
  margin: p2r(0 8);
168
- padding: p2r(0 8);
169
- gap: p2r(8);
168
+ padding: p2r(4 8);
169
+ gap: p2r(0 8);
170
170
  width: calc(100% - #{p2r(16)});
171
171
  border-radius: var(--shape-2);
172
172
  appearance: none;
@@ -177,6 +177,13 @@ $shipMenu: true !default;
177
177
  transition: transform 125ms linear;
178
178
  transform: scale(1);
179
179
 
180
+ &.as-row,
181
+ &:has([suffix]) {
182
+ justify-content: flex-start;
183
+ align-items: center;
184
+ flex-direction: row;
185
+ }
186
+
180
187
  &:active {
181
188
  transform: scale(0.98);
182
189
  }
@@ -36,10 +36,7 @@ $shipPopover: true !default;
36
36
 
37
37
  .trigger-anchor {
38
38
  position: absolute;
39
- top: p2r(-4);
40
- bottom: p2r(-4);
41
- left: 0;
42
- right: 0;
39
+ inset: 0;
43
40
  z-index: -1;
44
41
  }
45
42
  }
@@ -82,9 +79,12 @@ $shipPopover: true !default;
82
79
 
83
80
  @supports (anchor-name: --anchor) {
84
81
  inset: auto;
82
+ top: p2r(4);
85
83
  position: fixed;
86
84
  position-area: bottom span-right;
87
- position-try-fallbacks: flip-block, flip-inline;
85
+ position-try-fallbacks:
86
+ --top-span-right, --bottom-span-left, --top-span-left, --right-span-bottom, --left-span-bottom,
87
+ --right-center, --left-center, --right-span-top, --left-span-top;
88
88
  }
89
89
  }
90
90
  }
@@ -99,3 +99,63 @@ $shipPopover: true !default;
99
99
  }
100
100
  }
101
101
  }
102
+
103
+ @position-try --bottom-span-right {
104
+ position-area: bottom span-right;
105
+ inset: auto;
106
+ top: p2r(4);
107
+ }
108
+
109
+ @position-try --bottom-span-left {
110
+ position-area: bottom span-left;
111
+ inset: auto;
112
+ top: p2r(4);
113
+ }
114
+
115
+ @position-try --top-span-right {
116
+ position-area: top span-right;
117
+ inset: auto;
118
+ bottom: p2r(4);
119
+ }
120
+
121
+ @position-try --top-span-left {
122
+ position-area: top span-left;
123
+ inset: auto;
124
+ bottom: p2r(4);
125
+ }
126
+
127
+ @position-try --right-span-top {
128
+ position-area: right span-top;
129
+ inset: auto;
130
+ left: p2r(4);
131
+ }
132
+
133
+ @position-try --left-span-top {
134
+ position-area: left span-top;
135
+ inset: auto;
136
+ right: p2r(4);
137
+ }
138
+
139
+ @position-try --right-center {
140
+ position-area: right center;
141
+ inset: auto;
142
+ left: p2r(4);
143
+ }
144
+
145
+ @position-try --left-center {
146
+ position-area: left center;
147
+ inset: auto;
148
+ right: p2r(4);
149
+ }
150
+
151
+ @position-try --right-span-bottom {
152
+ position-area: right span-bottom;
153
+ inset: auto;
154
+ left: p2r(4);
155
+ }
156
+
157
+ @position-try --left-span-bottom {
158
+ position-area: left span-bottom;
159
+ inset: auto;
160
+ right: p2r(4);
161
+ }