@ship-ui/core 0.16.0 → 0.16.2

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 (38) hide show
  1. package/fesm2022/ship-ui-core.mjs +8 -5
  2. package/fesm2022/ship-ui-core.mjs.map +1 -1
  3. package/index.d.ts +21 -13
  4. package/package.json +1 -1
  5. package/styles/index.scss +33 -33
  6. /package/styles/components/{ship-alert-container.component.scss → ship-alert-container.scss} +0 -0
  7. /package/styles/components/{ship-alert.component.scss → ship-alert.scss} +0 -0
  8. /package/styles/components/{ship-blueprint.component.scss → ship-blueprint.scss} +0 -0
  9. /package/styles/components/{ship-button-group.component.scss → ship-button-group.scss} +0 -0
  10. /package/styles/components/{ship-button.component.scss → ship-button.scss} +0 -0
  11. /package/styles/components/{ship-card.component.scss → ship-card.scss} +0 -0
  12. /package/styles/components/{ship-checkbox.component.scss → ship-checkbox.scss} +0 -0
  13. /package/styles/components/{ship-chip.component.scss → ship-chip.scss} +0 -0
  14. /package/styles/components/{ship-color-picker.component.scss → ship-color-picker.scss} +0 -0
  15. /package/styles/components/{ship-datepicker.component.scss → ship-datepicker.scss} +0 -0
  16. /package/styles/components/{ship-dialog.component.scss → ship-dialog.scss} +0 -0
  17. /package/styles/components/{ship-divider.component.scss → ship-divider.scss} +0 -0
  18. /package/styles/components/{ship-event-card.component.scss → ship-event-card.scss} +0 -0
  19. /package/styles/components/{ship-file-upload.component.scss → ship-file-upload.scss} +0 -0
  20. /package/styles/components/{ship-form-field.component.scss → ship-form-field.scss} +0 -0
  21. /package/styles/components/{ship-icon.component.scss → ship-icon.scss} +0 -0
  22. /package/styles/components/{ship-list.component.scss → ship-list.scss} +0 -0
  23. /package/styles/components/{ship-menu.component.scss → ship-menu.scss} +0 -0
  24. /package/styles/components/{ship-popover.component.scss → ship-popover.scss} +0 -0
  25. /package/styles/components/{ship-progress-bar.component.scss → ship-progress-bar.scss} +0 -0
  26. /package/styles/components/{ship-radio.component.scss → ship-radio.scss} +0 -0
  27. /package/styles/components/{ship-range-slider.component.scss → ship-range-slider.scss} +0 -0
  28. /package/styles/components/{ship-select.component.scss → ship-select.scss} +0 -0
  29. /package/styles/components/{ship-sidenav.component.scss → ship-sidenav.scss} +0 -0
  30. /package/styles/components/{ship-sortable.component.scss → ship-sortable.scss} +0 -0
  31. /package/styles/components/{ship-spinner.component.scss → ship-spinner.scss} +0 -0
  32. /package/styles/components/{ship-stepper.component.scss → ship-stepper.scss} +0 -0
  33. /package/styles/components/{ship-table.component.scss → ship-table.scss} +0 -0
  34. /package/styles/components/{ship-tabs.component.scss → ship-tabs.scss} +0 -0
  35. /package/styles/components/{ship-toggle-card.component.scss → ship-toggle-card.scss} +0 -0
  36. /package/styles/components/{ship-toggle.component.scss → ship-toggle.scss} +0 -0
  37. /package/styles/components/{ship-tooltip.component.scss → ship-tooltip.scss} +0 -0
  38. /package/styles/components/{ship-virtual-scroll.component.scss → ship-virtual-scroll.scss} +0 -0
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>;
@@ -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;
@@ -844,11 +852,11 @@ declare class ShipTooltip implements OnDestroy {
844
852
  declare const SHIP_CONFIG: InjectionToken<ShipConfig>;
845
853
  interface ShipConfig {
846
854
  alertVariant?: '' | 'simple' | 'outlined' | 'flat' | 'raised';
847
- cardType?: 'type-b';
855
+ cardType?: '' | 'type-b' | 'type-c';
848
856
  dialogType?: 'type-b';
849
857
  tableType?: 'type-b';
850
858
  sidenavType?: 'overlay' | 'simple';
851
859
  }
852
860
 
853
861
  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, ShipDialogOptions, ShipDialogReturn, ShipDialogServiceOptions, ShipPopoverOptions, ShipProgressBarMode, ShipSidenavType };
862
+ 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.0",
4
+ "version": "0.16.2",
5
5
  "peerDependencies": {
6
6
  "@angular/common": ">=20",
7
7
  "@angular/core": ">=20"
package/styles/index.scss CHANGED
@@ -50,109 +50,109 @@ $shipTable: true !default;
50
50
  $shipTabs: true !default;
51
51
  $shipFileUpload: true !default;
52
52
 
53
- @use './components/ship-alert-container.component.scss' with (
53
+ @use './components/ship-alert-container.scss' with (
54
54
  $shipAlert: $shipAlert
55
55
  );
56
- @use './components/ship-alert.component.scss' with (
56
+ @use './components/ship-alert.scss' with (
57
57
  $shipAlert: $shipAlert
58
58
  );
59
- @use './components/ship-blueprint.component.scss' with (
59
+ @use './components/ship-blueprint.scss' with (
60
60
  $shipBlueprint: $shipBlueprint
61
61
  );
62
- @use './components/ship-toggle.component.scss' with (
62
+ @use './components/ship-toggle.scss' with (
63
63
  $shipToggle: $shipToggle
64
64
  );
65
- @use './components/ship-button.component.scss' with (
65
+ @use './components/ship-button.scss' with (
66
66
  $shipButton: $shipButton,
67
67
  $shipButtonShadow: $shipButtonShadow
68
68
  );
69
- @use './components/ship-progress-bar.component.scss' with (
69
+ @use './components/ship-progress-bar.scss' with (
70
70
  $shipProgressBar: $shipProgressBar
71
71
  );
72
- @use './components/ship-checkbox.component.scss' with (
72
+ @use './components/ship-checkbox.scss' with (
73
73
  $shipCheckbox: $shipCheckbox
74
74
  );
75
- @use './components/ship-datepicker.component.scss' with (
75
+ @use './components/ship-datepicker.scss' with (
76
76
  $shipDatepicker: $shipDatepicker
77
77
  );
78
- @use './components/ship-event-card.component.scss' with (
78
+ @use './components/ship-event-card.scss' with (
79
79
  $shipEventCard: $shipEventCard
80
80
  );
81
- @use './components/ship-icon.component.scss' with (
81
+ @use './components/ship-icon.scss' with (
82
82
  $shipIcon: $shipIcon
83
83
  );
84
- @use './components/ship-menu.component.scss' with (
84
+ @use './components/ship-menu.scss' with (
85
85
  $shipMenu: $shipMenu
86
86
  );
87
- @use './components/ship-divider.component.scss' with (
87
+ @use './components/ship-divider.scss' with (
88
88
  $shipDivider: $shipDivider
89
89
  );
90
- @use './components/ship-dialog.component.scss' with (
90
+ @use './components/ship-dialog.scss' with (
91
91
  $shipDialog: $shipDialog
92
92
  );
93
- @use './components/ship-popover.component.scss' with (
93
+ @use './components/ship-popover.scss' with (
94
94
  $shipPopover: $shipPopover
95
95
  );
96
- @use './components/ship-chip.component.scss' with (
96
+ @use './components/ship-chip.scss' with (
97
97
  $shipChip: $shipChip,
98
98
  $shipChipShadow: $shipChipShadow
99
99
  );
100
- @use './components/ship-form-field.component.scss' with (
100
+ @use './components/ship-form-field.scss' with (
101
101
  $shipFormField: $shipFormField,
102
102
  $shipDatepicker: $shipDatepicker,
103
103
  $shipFormFieldShadow: $shipFormFieldShadow
104
104
  );
105
- @use './components/ship-color-picker.component.scss' with (
105
+ @use './components/ship-color-picker.scss' with (
106
106
  $shipColorPicker: $shipColorPicker
107
107
  );
108
- @use './components/ship-sidenav.component.scss' with (
108
+ @use './components/ship-sidenav.scss' with (
109
109
  $shipSidenav: $shipSidenav
110
110
  );
111
- @use './components/ship-list.component.scss' with (
111
+ @use './components/ship-list.scss' with (
112
112
  $shipList: $shipList
113
113
  );
114
- @use './components/ship-radio.component.scss' with (
114
+ @use './components/ship-radio.scss' with (
115
115
  $shipRadio: $shipRadio
116
116
  );
117
- @use './components/ship-button-group.component.scss' with (
117
+ @use './components/ship-button-group.scss' with (
118
118
  $shipButtonGroup: $shipButtonGroup
119
119
  );
120
- @use './components/ship-range-slider.component.scss' with (
120
+ @use './components/ship-range-slider.scss' with (
121
121
  $shipRangeSlider: $shipRangeSlider
122
122
  );
123
- @use './components/ship-tooltip.component.scss' with (
123
+ @use './components/ship-tooltip.scss' with (
124
124
  $shipTooltip: $shipTooltip
125
125
  );
126
- @use './components/ship-virtual-scroll.component.scss' with (
126
+ @use './components/ship-virtual-scroll.scss' with (
127
127
  $shipVirtualScroll: $shipVirtualScroll
128
128
  );
129
- @use './components/ship-select.component.scss' with (
129
+ @use './components/ship-select.scss' with (
130
130
  $shipSelect: $shipSelect
131
131
  );
132
- @use './components/ship-card.component.scss' with (
132
+ @use './components/ship-card.scss' with (
133
133
  $shipCard: $shipCard
134
134
  );
135
135
  @use './components/ship-sheet.utility.scss' with (
136
136
  $shipSheet: $shipSheet
137
137
  );
138
- @use './components/ship-stepper.component.scss' with (
138
+ @use './components/ship-stepper.scss' with (
139
139
  $shipStepper: $shipStepper
140
140
  );
141
- @use './components/ship-spinner.component.scss' with (
141
+ @use './components/ship-spinner.scss' with (
142
142
  $shipSpinner: $shipSpinner
143
143
  );
144
- @use './components/ship-sortable.component.scss' with (
144
+ @use './components/ship-sortable.scss' with (
145
145
  $shipSortable: $shipSortable
146
146
  );
147
- @use './components/ship-toggle-card.component.scss' with (
147
+ @use './components/ship-toggle-card.scss' with (
148
148
  $shipToggleCard: $shipToggleCard
149
149
  );
150
- @use './components/ship-table.component.scss' with (
150
+ @use './components/ship-table.scss' with (
151
151
  $shipTable: $shipTable
152
152
  );
153
- @use './components/ship-tabs.component.scss' with (
153
+ @use './components/ship-tabs.scss' with (
154
154
  $shipTabs: $shipTabs
155
155
  );
156
- @use './components/ship-file-upload.component.scss' with (
156
+ @use './components/ship-file-upload.scss' with (
157
157
  $shipFileUpload: $shipFileUpload
158
158
  );