@ngrdt/gov 0.0.59 → 0.0.60
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/fesm2022/ngrdt-gov.mjs +163 -12
- package/fesm2022/ngrdt-gov.mjs.map +1 -1
- package/index.d.ts +69 -6
- package/lib/gov/ui/button/rdt-gov-button.component.scss +0 -0
- package/lib/gov/ui/checkbox/rdt-gov-checkbox.component.scss +11 -0
- package/lib/gov/ui/gov-shared-styles.scss +23 -0
- package/lib/gov/ui/icon/rdt-gov-icon.component.scss +13 -0
- package/lib/gov/ui/select/rdt-gov-select.component.scss +261 -0
- package/lib/gov/ui/table/rdt-gov-table.component.scss +0 -0
- package/package.json +5 -5
- package/styles.scss +6 -0
- /package/{rdt-gov-menu.scss → lib/gov/ui/menu/rdt-gov-menu.scss} +0 -0
package/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import * as _ngrdt_button from '@ngrdt/button';
|
|
2
|
+
import { RdtButtonBase } from '@ngrdt/button';
|
|
3
|
+
import * as _ngrdt_icon from '@ngrdt/icon';
|
|
4
|
+
import { RdtIcon, RdtIconComponent } from '@ngrdt/icon';
|
|
1
5
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { ElementRef, OnDestroy } from '@angular/core';
|
|
3
|
-
import { GovFormInput } from '@gov-design-system-ce/angular';
|
|
6
|
+
import { Injector, ElementRef, OnDestroy } from '@angular/core';
|
|
4
7
|
import { RdtBooleanResult } from '@ngrdt/core';
|
|
5
|
-
import { RdtNumericInputComponent, RdtSelectOfflineDatasourceProviderDirective, RdtBaseSelectCommonComponent, RdtTextInputComponent } from '@ngrdt/forms';
|
|
6
|
-
import { RdtIcon } from '@ngrdt/icon';
|
|
7
8
|
import { Nullable } from '@ngrdt/utils';
|
|
9
|
+
import { RdtCheckboxComponent, RdtNumericInputComponent, RdtSelectOfflineDatasourceProviderDirective, RdtBaseSelectCommonComponent, RdtTextInputComponent } from '@ngrdt/forms';
|
|
10
|
+
import { GovFormInput } from '@gov-design-system-ce/angular';
|
|
8
11
|
|
|
9
12
|
type GovSize = 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
10
13
|
type GovColor = 'primary' | 'secondary' | 'neutral' | 'success' | 'warning' | 'error';
|
|
@@ -16,6 +19,66 @@ declare const DEFAULT_GOV_BUTTON_COLOR: GovColor;
|
|
|
16
19
|
declare const DEFAULT_GOV_BUTTON_TYPE: GovButtonType;
|
|
17
20
|
declare const DEFAULT_GOV_BUTTON_SIZE: GovSize;
|
|
18
21
|
|
|
22
|
+
declare class RdtGovButtonComponent extends RdtButtonBase<RdtIcon> {
|
|
23
|
+
protected readonly injector: Injector;
|
|
24
|
+
readonly focusElement: _angular_core.WritableSignal<HTMLElement | null>;
|
|
25
|
+
readonly ariaElement: _angular_core.WritableSignal<HTMLElement | null>;
|
|
26
|
+
readonly anchorElement: _angular_core.WritableSignal<HTMLElement | null>;
|
|
27
|
+
readonly appearanceInput: _angular_core.InputSignal<GovButtonType>;
|
|
28
|
+
readonly appearance: _angular_core.WritableSignal<GovButtonType>;
|
|
29
|
+
readonly colorInput: _angular_core.InputSignal<GovColor>;
|
|
30
|
+
readonly color: _angular_core.WritableSignal<GovColor>;
|
|
31
|
+
readonly size: _angular_core.InputSignal<GovSize>;
|
|
32
|
+
readonly iconStartInput: _angular_core.InputSignal<Nullable<RdtIcon>>;
|
|
33
|
+
readonly expandedInput: _angular_core.InputSignal<boolean>;
|
|
34
|
+
readonly expanded: _angular_core.WritableSignal<boolean>;
|
|
35
|
+
readonly iconStart: _angular_core.WritableSignal<Nullable<RdtIcon>>;
|
|
36
|
+
private readonly govButton;
|
|
37
|
+
private readonly buttonEffect;
|
|
38
|
+
constructor();
|
|
39
|
+
focus(): void;
|
|
40
|
+
canFocus(): RdtBooleanResult;
|
|
41
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdtGovButtonComponent, never>;
|
|
42
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<RdtGovButtonComponent, "rdt-gov-button", never, { "appearanceInput": { "alias": "appearance"; "required": false; "isSignal": true; }; "colorInput": { "alias": "color"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "iconStartInput": { "alias": "iconStart"; "required": false; "isSignal": true; }; "expandedInput": { "alias": "expanded"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare class RdtGovIconComponent extends RdtIconComponent<string> {
|
|
46
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdtGovIconComponent, never>;
|
|
47
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<RdtGovIconComponent, "rdt-gov-icon", never, {}, {}, never, never, true, never>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare function provideNgrdtGov(options?: {}): (_angular_core.EnvironmentProviders | {
|
|
51
|
+
provide: _angular_core.InjectionToken<_angular_core.Type<_ngrdt_icon.RdtIconBaseInt>>;
|
|
52
|
+
useValue: typeof RdtGovIconComponent;
|
|
53
|
+
} | {
|
|
54
|
+
provide: _angular_core.InjectionToken<_angular_core.Type<_ngrdt_button.RdtButtonBaseInt<string>>>;
|
|
55
|
+
useValue: typeof RdtGovButtonComponent;
|
|
56
|
+
} | {
|
|
57
|
+
provide: _angular_core.InjectionToken<Record<RdtIcon, string>>;
|
|
58
|
+
useValue: {
|
|
59
|
+
"chevron-right": string;
|
|
60
|
+
"chevron-down": string;
|
|
61
|
+
};
|
|
62
|
+
})[];
|
|
63
|
+
|
|
64
|
+
interface RdtGovConfig {
|
|
65
|
+
iconsPath?: string;
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
}
|
|
68
|
+
declare function initRdtGov(config?: RdtGovConfig): void;
|
|
69
|
+
|
|
70
|
+
declare class RdtGovCheckboxComponent extends RdtCheckboxComponent {
|
|
71
|
+
readonly labelPosition: _angular_core.WritableSignal<GovLabelPosition>;
|
|
72
|
+
readonly labelPositionInput: _angular_core.InputSignal<GovLabelPosition>;
|
|
73
|
+
readonly size: _angular_core.WritableSignal<"xs" | "s" | "m" | "l" | "xl">;
|
|
74
|
+
readonly sizeInput: _angular_core.InputSignal<"xs" | "s" | "m" | "l" | "xl">;
|
|
75
|
+
onInput(event: Event): void;
|
|
76
|
+
focus(): void;
|
|
77
|
+
canFocus(): RdtBooleanResult;
|
|
78
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdtGovCheckboxComponent, never>;
|
|
79
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<RdtGovCheckboxComponent, "rdt-gov-checkbox", never, { "labelPositionInput": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "sizeInput": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
80
|
+
}
|
|
81
|
+
|
|
19
82
|
declare class RdtGovNumberInputComponent extends RdtNumericInputComponent {
|
|
20
83
|
private readonly renderer;
|
|
21
84
|
protected readonly govInput: _angular_core.Signal<ElementRef<GovFormInput> | undefined>;
|
|
@@ -104,5 +167,5 @@ declare class RdtGovTextInputComponent extends RdtTextInputComponent {
|
|
|
104
167
|
|
|
105
168
|
declare function forceFocus(input: HTMLInputElement): void;
|
|
106
169
|
|
|
107
|
-
export { DEFAULT_GOV_BUTTON_COLOR, DEFAULT_GOV_BUTTON_SIZE, DEFAULT_GOV_BUTTON_TYPE, RdtGovNumberInputComponent, RdtGovSelectComponent, RdtGovSelectOfflineProviderDirective, RdtGovTextInputComponent, forceFocus };
|
|
108
|
-
export type { GovButtonType, GovColor, GovLabelPosition, GovMessageVariant, GovSize };
|
|
170
|
+
export { DEFAULT_GOV_BUTTON_COLOR, DEFAULT_GOV_BUTTON_SIZE, DEFAULT_GOV_BUTTON_TYPE, RdtGovButtonComponent, RdtGovCheckboxComponent, RdtGovIconComponent, RdtGovNumberInputComponent, RdtGovSelectComponent, RdtGovSelectOfflineProviderDirective, RdtGovTextInputComponent, forceFocus, initRdtGov, provideNgrdtGov };
|
|
171
|
+
export type { GovButtonType, GovColor, GovLabelPosition, GovMessageVariant, GovSize, RdtGovConfig };
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.warning-color {
|
|
2
|
+
&-icon {
|
|
3
|
+
color: var(--icon-error) !important;
|
|
4
|
+
}
|
|
5
|
+
&-text {
|
|
6
|
+
color: var(--text-status-error) !important;
|
|
7
|
+
}
|
|
8
|
+
&-gov-label {
|
|
9
|
+
.gov-form-label__label {
|
|
10
|
+
color: var(--form-state-label-error, var(--text-status-error)) !important;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.s_label {
|
|
16
|
+
font-size: var(--font-size-body-s);
|
|
17
|
+
line-height: 150%;
|
|
18
|
+
font-weight: 400;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
gov-form-message {
|
|
22
|
+
font-size: var(--font-size-body-s);
|
|
23
|
+
}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
rdt-gov-select {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
max-width: 100%;
|
|
5
|
+
.gov-form-select {
|
|
6
|
+
width: 100%;
|
|
7
|
+
&.has-clear .select {
|
|
8
|
+
padding-right: calc(1.5rem + var(--spacing-s)) !important;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.gov-form-input {
|
|
13
|
+
border: none !important;
|
|
14
|
+
background-color: transparent !important
|
|
15
|
+
;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.select {
|
|
19
|
+
display: flex;
|
|
20
|
+
|
|
21
|
+
rdt-spinner {
|
|
22
|
+
position: absolute;
|
|
23
|
+
right: 0.5rem;
|
|
24
|
+
width: 1rem;
|
|
25
|
+
height: 1rem;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
$select-sizes: (
|
|
30
|
+
xs: xs,
|
|
31
|
+
s: s,
|
|
32
|
+
m: m,
|
|
33
|
+
l: l,
|
|
34
|
+
xl: xl,
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
@each $key, $token in $select-sizes {
|
|
38
|
+
[size='#{$key}'].gov-form-select .select {
|
|
39
|
+
min-height: var(--height-component-#{$token});
|
|
40
|
+
font-size: var(--font-size-body-#{$token});
|
|
41
|
+
&:hover {
|
|
42
|
+
background-color: var(--button-outlined-primary-hover);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
[size='xs'].gov-form-select .select {
|
|
48
|
+
padding: var(--spacing-multiline-vertical-padding-xs)
|
|
49
|
+
var(--spacing-xs-nudge);
|
|
50
|
+
}
|
|
51
|
+
[size='s'].gov-form-select .select {
|
|
52
|
+
padding: var(--spacing-multiline-vertical-padding-s) var(--spacing-s);
|
|
53
|
+
}
|
|
54
|
+
[size='m'].gov-form-select .select {
|
|
55
|
+
padding: var(--spacing-multiline-vertical-padding-m) var(--spacing-s-nudge);
|
|
56
|
+
}
|
|
57
|
+
[size='l'].gov-form-select .select {
|
|
58
|
+
padding: var(--spacing-multiline-vertical-padding-l) var(--spacing-m);
|
|
59
|
+
}
|
|
60
|
+
[size='xl'].gov-form-select .select {
|
|
61
|
+
padding: var(--spacing-multiline-vertical-padding-xl) var(--spacing-m-nudge);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.gov-form-select .select {
|
|
65
|
+
position: relative;
|
|
66
|
+
border: none;
|
|
67
|
+
width: 100%;
|
|
68
|
+
border-radius: var(--corner-radius-s);
|
|
69
|
+
background-color: var(--background-block-primary);
|
|
70
|
+
font-family: var(--font-family);
|
|
71
|
+
text-align: left;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
[invalid='true'].gov-form-input {
|
|
75
|
+
.select {
|
|
76
|
+
border-color: var(--background-status-error);
|
|
77
|
+
color: var(--background-status-error);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.icon-arrow {
|
|
82
|
+
color: var(--text-primary);
|
|
83
|
+
position: absolute;
|
|
84
|
+
top: 50%;
|
|
85
|
+
display: flex;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
transform: translateY(-50%);
|
|
88
|
+
pointer-events: none;
|
|
89
|
+
right: 0.75rem;
|
|
90
|
+
width: 0.75rem;
|
|
91
|
+
height: 0.75rem;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.icon-warning {
|
|
95
|
+
color: var(--icon-error);
|
|
96
|
+
position: absolute;
|
|
97
|
+
top: 50%;
|
|
98
|
+
display: flex;
|
|
99
|
+
justify-content: center;
|
|
100
|
+
transform: translateY(-50%);
|
|
101
|
+
pointer-events: none;
|
|
102
|
+
right: 1.85rem;
|
|
103
|
+
width: 0.75rem;
|
|
104
|
+
height: 0.75rem;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.scroll-content {
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
color: var(--text-primary);
|
|
111
|
+
width: 100%;
|
|
112
|
+
white-space: nowrap;
|
|
113
|
+
overflow: hidden;
|
|
114
|
+
text-overflow: ellipsis;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.clear-button {
|
|
118
|
+
display: flex;
|
|
119
|
+
position: absolute;
|
|
120
|
+
right: 2rem;
|
|
121
|
+
top: 50%;
|
|
122
|
+
transform: translateY(-50%);
|
|
123
|
+
|
|
124
|
+
button {
|
|
125
|
+
padding: 0 !important;
|
|
126
|
+
min-height: auto !important;
|
|
127
|
+
|
|
128
|
+
--icon-size-xs: 1rem;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
gov-icon[slot='left-icon'] {
|
|
132
|
+
left: 0 !important;
|
|
133
|
+
position: inherit !important;
|
|
134
|
+
top: 0 !important;
|
|
135
|
+
display: inline !important;
|
|
136
|
+
transform: none !important;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.element {
|
|
141
|
+
max-width: 100%;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.rdt-gov-select-container {
|
|
146
|
+
width: 100%;
|
|
147
|
+
margin-top: 0.5rem;
|
|
148
|
+
margin-bottom: 0.5rem;
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
border: 1px solid var(--color-neutral-600);
|
|
151
|
+
border-radius: 0px;
|
|
152
|
+
background-color: var(--background-block-primary);
|
|
153
|
+
|
|
154
|
+
ul {
|
|
155
|
+
padding-left: 0;
|
|
156
|
+
margin-top: 0;
|
|
157
|
+
margin-bottom: 0;
|
|
158
|
+
list-style: none;
|
|
159
|
+
max-height: 14.0625rem;
|
|
160
|
+
overflow-x: hidden;
|
|
161
|
+
overflow-y: auto;
|
|
162
|
+
overscroll-behavior: none;
|
|
163
|
+
|
|
164
|
+
.option {
|
|
165
|
+
font-family: var(--font-family);
|
|
166
|
+
color: var(--text-primary);
|
|
167
|
+
border: none;
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
padding: 0.75rem 0.5rem;
|
|
171
|
+
width: 100%;
|
|
172
|
+
margin: 0;
|
|
173
|
+
background: none;
|
|
174
|
+
text-align: left;
|
|
175
|
+
gov-icon {
|
|
176
|
+
padding-right: var(--spacing-s);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
gov-icon.invisible {
|
|
180
|
+
display: none;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&:hover {
|
|
184
|
+
color: var(--color-primary-50);
|
|
185
|
+
background: var(--color-neutral-600);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
li {
|
|
191
|
+
margin-bottom: 0px;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.picked {
|
|
195
|
+
color: var(--icon-success);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.search-spinner {
|
|
199
|
+
--spinner-size: 1.2rem;
|
|
200
|
+
position: absolute;
|
|
201
|
+
right: 1rem;
|
|
202
|
+
top: 100%;
|
|
203
|
+
transform: translateY(calc(var(--spinner-size) / -2));
|
|
204
|
+
|
|
205
|
+
.sis-icon-32-fix {
|
|
206
|
+
height: var(--spinner-size);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.search-container {
|
|
211
|
+
width: 100%;
|
|
212
|
+
position: relative;
|
|
213
|
+
|
|
214
|
+
input {
|
|
215
|
+
font-family: var(--font-family);
|
|
216
|
+
border-radius: 0px;
|
|
217
|
+
border-top: 1px;
|
|
218
|
+
border-left: 1px;
|
|
219
|
+
border-right: 1px;
|
|
220
|
+
padding: 0.75rem 0.5rem;
|
|
221
|
+
width: 100%;
|
|
222
|
+
background-color: var(--background-block-primary);
|
|
223
|
+
color: var(--text-primary);
|
|
224
|
+
|
|
225
|
+
&:focus-visible {
|
|
226
|
+
outline: var(0.125rem) solid var(--status-focus);
|
|
227
|
+
outline-offset: 0;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
&.loading input::-webkit-search-cancel-button {
|
|
232
|
+
position: relative;
|
|
233
|
+
right: 1rem;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
$select-sizes: (
|
|
239
|
+
xs: xs,
|
|
240
|
+
s: s,
|
|
241
|
+
m: m,
|
|
242
|
+
l: l,
|
|
243
|
+
xl: xl,
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
@each $key, $token in $select-sizes {
|
|
247
|
+
[data-size='#{$key}'].rdt-gov-select-container ul li button {
|
|
248
|
+
font-size: var(--font-size-body-#{$token}) !important;
|
|
249
|
+
line-height: var(--height-line-#{$token});
|
|
250
|
+
padding: var(--spacing-multiline-vertical-padding-#{$token});
|
|
251
|
+
}
|
|
252
|
+
[data-size='#{$key}'].rdt-gov-select-container input {
|
|
253
|
+
font-size: var(--font-size-body-#{$token}) !important;
|
|
254
|
+
padding: var(--spacing-multiline-vertical-padding-#{$token});
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.rdt-gov-select-overlay-panel-top .rdt-gov-select-container {
|
|
259
|
+
display: flex;
|
|
260
|
+
flex-direction: column-reverse;
|
|
261
|
+
}
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngrdt/gov",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.60",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/core": "^20.0.0",
|
|
6
6
|
"@angular/forms": "^20.0.0",
|
|
7
7
|
"@gov-design-system-ce/angular": "^1.3.1",
|
|
8
8
|
"rxjs": "~7.8.0",
|
|
9
|
-
"@ngrdt/core": "^0.0.
|
|
10
|
-
"@ngrdt/forms": "^0.0.
|
|
11
|
-
"@ngrdt/icon": "^0.0.
|
|
12
|
-
"@ngrdt/utils": "^0.0.
|
|
9
|
+
"@ngrdt/core": "^0.0.60",
|
|
10
|
+
"@ngrdt/forms": "^0.0.60",
|
|
11
|
+
"@ngrdt/icon": "^0.0.60",
|
|
12
|
+
"@ngrdt/utils": "^0.0.60",
|
|
13
13
|
"@angular/cdk": "^20.2.0"
|
|
14
14
|
},
|
|
15
15
|
"sideEffects": false,
|
package/styles.scss
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
@use '@gov-design-system-ce/styles/lib/tokens' as *;
|
|
2
|
+
@use '@gov-design-system-ce/styles/lib/styles' as *;
|
|
3
|
+
@use '@gov-design-system-ce/styles/lib/layout' as *;
|
|
4
|
+
@use '@gov-design-system-ce/styles/lib/components' as *;
|
|
5
|
+
// OUR CUSTOMIZATION
|
|
6
|
+
@use '../src/lib/gov/ui/menu/rdt-gov-menu' as *;
|
|
File without changes
|