@ship-ui/core 0.13.2 → 0.13.4

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
@@ -463,6 +463,7 @@ declare class ShipSelectComponent {
463
463
  selectedOptionValues: _angular_core.Signal<unknown[]>;
464
464
  filteredOptions: _angular_core.Signal<unknown[]>;
465
465
  inputRefEl: _angular_core.Signal<HTMLInputElement | null | undefined>;
466
+ focusEffect: _angular_core.EffectRef;
466
467
  openAbortController: AbortController | null;
467
468
  isOpenEffect: _angular_core.EffectRef;
468
469
  _inputValue: string;
@@ -474,8 +475,9 @@ declare class ShipSelectComponent {
474
475
  ngOnInit(): void;
475
476
  setInitInput(): void;
476
477
  setSelectedOptionsFromValue(value: string): void;
477
- setInputValueFromSelectedOptions(): void;
478
+ setInputValueFromOptions(options: unknown[]): void;
478
479
  getLabel(option: unknown): unknown;
480
+ getLabelAsSlug(option: unknown): string;
479
481
  toggleOptionByIndex(optionIndex: number, event?: MouseEvent): void;
480
482
  removeSelectedOptionByIndex($event: MouseEvent, optionRemoveIndex: number): void;
481
483
  isSelected(optionIndex: number): boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ship-ui/core",
3
3
  "license": "MIT",
4
- "version": "0.13.2",
4
+ "version": "0.13.4",
5
5
  "peerDependencies": {
6
6
  "@angular/common": ">=19",
7
7
  "@angular/core": ">=19"
@@ -1,245 +0,0 @@
1
- @use '../helpers.scss' as *;
2
-
3
- $shipCheckbox: true !default;
4
-
5
- @if $shipCheckbox == true {
6
- sh-checkbox {
7
- --box-bw: #{p2r(1)};
8
- --box-bc: var(--base-4);
9
- --box-c: var(--base-8);
10
- --box-bg: var(--base-2);
11
-
12
- display: flex;
13
- align-items: center;
14
- gap: p2r(8);
15
- cursor: pointer;
16
- user-select: none;
17
- position: relative;
18
-
19
- > input[type='checkbox'] {
20
- appearance: none;
21
- position: absolute;
22
- inset: 0;
23
- cursor: pointer;
24
-
25
- &:focus {
26
- outline: none;
27
- }
28
- }
29
-
30
- &:has(input[disabled]),
31
- &[disabled]:not([disabled='false']) {
32
- opacity: 0.5;
33
- pointer-events: none;
34
- user-select: none;
35
- cursor: initial;
36
- }
37
-
38
- .box {
39
- display: flex;
40
- align-items: center;
41
- justify-content: center;
42
- width: p2r(20);
43
- height: p2r(20);
44
- cursor: pointer;
45
- position: relative;
46
- border-radius: var(--shape-1);
47
- border: var(--box-bw) solid var(--box-bc);
48
- background: var(--box-bg);
49
- font-size: p2r(12);
50
- color: var(--box-c);
51
-
52
- sh-icon {
53
- opacity: 0;
54
- font-weight: bold;
55
- transition: opacity 75ms linear;
56
-
57
- &.indeterminate-indicator {
58
- display: none;
59
- }
60
- }
61
- }
62
-
63
- &.indeterminate {
64
- .box sh-icon {
65
- &.indeterminate-indicator {
66
- display: block;
67
- }
68
-
69
- &.default-indicator {
70
- display: none;
71
- }
72
- }
73
- }
74
-
75
- &:has(input[type='checkbox']:checked),
76
- &.indeterminate,
77
- &.active {
78
- .box sh-icon {
79
- opacity: 1;
80
- }
81
- }
82
-
83
- &:hover {
84
- .box sh-icon {
85
- opacity: 0.5;
86
- }
87
- }
88
-
89
- &.primary {
90
- --box-c: var(--primary-8);
91
- }
92
-
93
- &.accent {
94
- --box-c: var(--accent-8);
95
- }
96
-
97
- &.warn {
98
- --box-c: var(--warn-8);
99
- }
100
-
101
- &.error {
102
- --box-c: var(--error-8);
103
- }
104
-
105
- &.success {
106
- --box-c: var(--success-8);
107
- }
108
-
109
- &.simple,
110
- &.outlined {
111
- --box-bg: var(--base-3);
112
- --box-bc: var(--base-6);
113
-
114
- &.primary {
115
- --box-bg: var(--primary-3);
116
- --box-bc: var(--primary-6);
117
- }
118
-
119
- &.accent {
120
- --box-bg: var(--accent-3);
121
- --box-bc: var(--accent-6);
122
- }
123
-
124
- &.warn {
125
- --box-bg: var(--warn-3);
126
- --box-bc: var(--warn-6);
127
- }
128
-
129
- &.error {
130
- --box-bg: var(--error-3);
131
- --box-bc: var(--error-6);
132
- }
133
-
134
- &.success {
135
- --box-bg: var(--success-3);
136
- --box-bc: var(--success-6);
137
- }
138
- }
139
-
140
- &.simple {
141
- --box-bc: var(--box-bg);
142
-
143
- &.primary,
144
- &.accent,
145
- &.warn,
146
- &.error,
147
- &.success {
148
- --box-bc: var(--box-bg);
149
- }
150
- }
151
-
152
- &.flat,
153
- &.raised {
154
- &.primary,
155
- &.accent,
156
- &.warn,
157
- &.error,
158
- &.success {
159
- --box-bc: var(--base-4);
160
- --box-c: var(--base-8);
161
- --box-bg: var(--base-2);
162
- }
163
- }
164
-
165
- &.flat:has(input[type='checkbox']:checked),
166
- &.flat.indeterminate,
167
- &.flat.active {
168
- @extend %flat;
169
- }
170
-
171
- &.raised:has(input[type='checkbox']:checked),
172
- &.raised.indeterminate,
173
- &.raised.active {
174
- @extend %raised;
175
- }
176
- }
177
-
178
- .ship-popup-menu sh-option[selected] {
179
- sh-checkbox {
180
- sh-icon {
181
- opacity: 1;
182
- }
183
-
184
- &.flat {
185
- @extend %flat;
186
- }
187
-
188
- &.raised {
189
- @extend %raised;
190
- }
191
- }
192
- }
193
-
194
- %flat {
195
- --box-bw: 0;
196
- --box-bg: var(--base-8);
197
- --box-c: #fff;
198
-
199
- &.primary {
200
- --box-bg: var(--primary-8);
201
- }
202
-
203
- &.accent {
204
- --box-bg: var(--accent-8);
205
- }
206
-
207
- &.warn {
208
- --box-bg: var(--warn-8);
209
- }
210
-
211
- &.error {
212
- --box-bg: var(--error-8);
213
- }
214
-
215
- &.success {
216
- --box-bg: var(--success-8);
217
- }
218
- }
219
-
220
- %raised {
221
- --box-bw: 0;
222
- --box-bg: var(--base-g2);
223
- --box-c: #fff;
224
-
225
- &.primary {
226
- --box-bg: var(--primary-g2);
227
- }
228
-
229
- &.accent {
230
- --box-bg: var(--accent-g2);
231
- }
232
-
233
- &.warn {
234
- --box-bg: var(--warn-g2);
235
- }
236
-
237
- &.error {
238
- --box-bg: var(--error-g2);
239
- }
240
-
241
- &.success {
242
- --box-bg: var(--success-g2);
243
- }
244
- }
245
- }
@@ -1,139 +0,0 @@
1
- @use '../helpers.scss' as *;
2
-
3
- $shipSelect: false !default;
4
-
5
- @if $shipSelect == true {
6
- sh-select {
7
- --miw: #{p2r(210)};
8
-
9
- display: flex;
10
-
11
- sh-form-field {
12
- display: flex;
13
- --ff-mw: var(--miw);
14
- }
15
-
16
- sh-popover {
17
- flex: 1 0;
18
-
19
- &:has(.ship-options:empty) .popover {
20
- opacity: 0;
21
- }
22
- }
23
-
24
- .selected-value {
25
- width: 100%;
26
- display: flex;
27
- flex-wrap: wrap;
28
- align-items: center;
29
- gap: p2r(4);
30
- color: var(--base-8);
31
-
32
- input {
33
- margin: 0;
34
- }
35
-
36
- &.is-selected {
37
- color: var(--base-12);
38
- }
39
- }
40
-
41
- sh-form-field .input-wrap .input {
42
- position: relative;
43
- display: flex;
44
- flex-wrap: wrap;
45
-
46
- --ff-space: #{p2r(7 10)};
47
-
48
- textarea,
49
- input {
50
- opacity: 0;
51
- width: 0;
52
- height: 0;
53
- position: absolute;
54
- }
55
-
56
- &.show-search-text {
57
- input {
58
- opacity: 1;
59
- height: initial;
60
- min-width: min-content;
61
- field-sizing: content;
62
- font: var(--paragraph-30);
63
- position: relative;
64
- }
65
-
66
- textarea {
67
- opacity: 1;
68
- height: initial;
69
- margin: p2r(4 0 0);
70
- }
71
- }
72
- }
73
-
74
- sh-form-field.small .input-wrap .input {
75
- --ff-space: #{p2r(5 8)};
76
-
77
- sh-chip {
78
- --chip-h: #{p2r(20)};
79
- font-size: 80%;
80
- }
81
- }
82
- }
83
-
84
- .ship-options {
85
- padding: p2r(8 0);
86
- display: flex;
87
- flex-direction: column;
88
- max-height: p2r(180);
89
- overflow-y: auto;
90
- overflow-x: hidden;
91
-
92
- .option {
93
- display: flex;
94
- justify-content: flex-start;
95
- align-items: center;
96
- min-height: p2r(32);
97
- margin: p2r(0 8);
98
- padding: p2r(0 8);
99
- gap: p2r(8);
100
- width: calc(100% - #{p2r(16)});
101
- border-radius: var(--shape-2);
102
- appearance: none;
103
- background-color: transparent;
104
- border: 0;
105
- cursor: pointer;
106
- color: var(--base-12);
107
- user-select: none;
108
-
109
- &[disabled] {
110
- opacity: 0.3;
111
- cursor: initial;
112
-
113
- &:hover {
114
- background-color: transparent;
115
- }
116
- }
117
-
118
- sh-icon {
119
- font-size: p2r(16);
120
- }
121
-
122
- &.active,
123
- &:checked,
124
- &:hover {
125
- background-color: var(--base-2);
126
- color: var(--base-12);
127
- }
128
-
129
- &.focused {
130
- background-color: var(--primary-1);
131
- color: var(--base-12);
132
-
133
- &:hover {
134
- background-color: var(--primary-2);
135
- }
136
- }
137
- }
138
- }
139
- }