@ng-cn/core 1.0.20 → 1.0.21
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 +17 -17
- package/schematics/tsconfig.json +1 -0
- package/src/app/lib/components/ui/chart/chart-context.ts +8 -6
- package/src/app/lib/components/ui/collapsible/collapsible.component.ts +0 -5
- package/src/app/lib/components/ui/input/input.component.ts +3 -4
- package/src/app/lib/components/ui/radio-group/radio-group.component.ts +0 -5
- package/src/app/lib/components/ui/select/select.component.ts +0 -8
- package/src/app/lib/components/ui/sidebar/sidebar-provider.component.ts +0 -5
- package/src/app/lib/components/ui/slider/slider.component.ts +0 -4
- package/src/app/lib/components/ui/switch/switch.component.ts +0 -5
- package/src/app/lib/components/ui/textarea/textarea.component.ts +1 -1
- package/src/app/lib/components/ui/toggle/toggle.component.ts +0 -5
- package/src/app/lib/components/ui/toggle-group/toggle-group.component.ts +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-cn/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"description": "Beautifully designed Angular components built with Tailwind CSS v4 - The official Angular port of shadcn/ui",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "https://
|
|
18
|
+
"url": "https://github.com/Tigayon-Innovations/angular-shadcn.git"
|
|
19
19
|
},
|
|
20
20
|
"homepage": "https://shadcn-angular.tigayon.com/",
|
|
21
21
|
"bugs": {
|
|
@@ -58,17 +58,17 @@
|
|
|
58
58
|
]
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@angular-devkit/core": "^
|
|
62
|
-
"@angular-devkit/schematics": "^
|
|
63
|
-
"@angular/cdk": "^
|
|
64
|
-
"@angular/common": "^
|
|
65
|
-
"@angular/compiler": "^
|
|
66
|
-
"@angular/core": "^
|
|
67
|
-
"@angular/forms": "^
|
|
68
|
-
"@angular/platform-browser": "^
|
|
69
|
-
"@angular/platform-server": "^
|
|
70
|
-
"@angular/router": "^
|
|
71
|
-
"@angular/ssr": "^
|
|
61
|
+
"@angular-devkit/core": "^22.0.1",
|
|
62
|
+
"@angular-devkit/schematics": "^22.0.1",
|
|
63
|
+
"@angular/cdk": "^22.0.1",
|
|
64
|
+
"@angular/common": "^22.0.1",
|
|
65
|
+
"@angular/compiler": "^22.0.1",
|
|
66
|
+
"@angular/core": "^22.0.1",
|
|
67
|
+
"@angular/forms": "^22.0.1",
|
|
68
|
+
"@angular/platform-browser": "^22.0.1",
|
|
69
|
+
"@angular/platform-server": "^22.0.1",
|
|
70
|
+
"@angular/router": "^22.0.1",
|
|
71
|
+
"@angular/ssr": "^22.0.1",
|
|
72
72
|
"@tailwindcss/postcss": "^4.2.2",
|
|
73
73
|
"apexcharts": "^5.10.4",
|
|
74
74
|
"class-variance-authority": "^0.7.1",
|
|
@@ -87,9 +87,9 @@
|
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@analogjs/vite-plugin-angular": "^2.2.0",
|
|
89
89
|
"@analogjs/vitest-angular": "^2.3.1",
|
|
90
|
-
"@angular/build": "^
|
|
91
|
-
"@angular/cli": "^
|
|
92
|
-
"@angular/compiler-cli": "^
|
|
90
|
+
"@angular/build": "^22.0.1",
|
|
91
|
+
"@angular/cli": "^22.0.1",
|
|
92
|
+
"@angular/compiler-cli": "^22.0.1",
|
|
93
93
|
"@modelcontextprotocol/sdk": "^1.28.0",
|
|
94
94
|
"@testing-library/angular": "^19.2.1",
|
|
95
95
|
"@testing-library/dom": "^10.4.1",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"karma-coverage": "~2.2.0",
|
|
104
104
|
"karma-jasmine": "~5.1.0",
|
|
105
105
|
"karma-jasmine-html-reporter": "~2.2.0",
|
|
106
|
-
"typescript": "~
|
|
106
|
+
"typescript": "~6.0.3",
|
|
107
107
|
"vitest": "^4.1.2"
|
|
108
108
|
}
|
|
109
109
|
}
|
package/schematics/tsconfig.json
CHANGED
|
@@ -28,11 +28,13 @@ export interface ChartContext {
|
|
|
28
28
|
|
|
29
29
|
export const CHART_CONTEXT = new InjectionToken<ChartContext>('ChartContext');
|
|
30
30
|
|
|
31
|
-
// CSS variable name mapping for chart colors
|
|
31
|
+
// CSS variable name mapping for chart colors.
|
|
32
|
+
// The --chart-* tokens are full oklch() colors, so reference them directly
|
|
33
|
+
// (wrapping in hsl() produced invalid hsl(oklch(...)) and rendered monochrome).
|
|
32
34
|
export const CHART_COLORS = {
|
|
33
|
-
chart1: '
|
|
34
|
-
chart2: '
|
|
35
|
-
chart3: '
|
|
36
|
-
chart4: '
|
|
37
|
-
chart5: '
|
|
35
|
+
chart1: 'var(--chart-1)',
|
|
36
|
+
chart2: 'var(--chart-2)',
|
|
37
|
+
chart3: 'var(--chart-3)',
|
|
38
|
+
chart4: 'var(--chart-4)',
|
|
39
|
+
chart5: 'var(--chart-5)',
|
|
38
40
|
} as const;
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
forwardRef,
|
|
9
9
|
input,
|
|
10
10
|
model,
|
|
11
|
-
output,
|
|
12
11
|
signal,
|
|
13
12
|
} from '@angular/core';
|
|
14
13
|
import { COLLAPSIBLE_CONTEXT, CollapsibleContext } from './collapsible-context';
|
|
@@ -62,9 +61,6 @@ export class Collapsible implements CollapsibleContext {
|
|
|
62
61
|
});
|
|
63
62
|
}
|
|
64
63
|
|
|
65
|
-
/** Event emitted when open state changes */
|
|
66
|
-
readonly openChange = output<boolean>();
|
|
67
|
-
|
|
68
64
|
/** Controlled open state - two-way binding supported */
|
|
69
65
|
readonly open = model<boolean | undefined>(undefined);
|
|
70
66
|
|
|
@@ -96,6 +92,5 @@ export class Collapsible implements CollapsibleContext {
|
|
|
96
92
|
}
|
|
97
93
|
|
|
98
94
|
this.open.set(newState);
|
|
99
|
-
this.openChange.emit(newState);
|
|
100
95
|
};
|
|
101
96
|
}
|
|
@@ -30,7 +30,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
|
30
30
|
* <Input type="email" formControlName="email" placeholder="Enter email" />
|
|
31
31
|
*/
|
|
32
32
|
@Component({
|
|
33
|
-
selector: 'input[Input]',
|
|
33
|
+
selector: 'input[Input], Input',
|
|
34
34
|
template: '',
|
|
35
35
|
host: {
|
|
36
36
|
'[type]': 'type()',
|
|
@@ -98,9 +98,8 @@ export class Input implements ControlValueAccessor, AfterViewInit {
|
|
|
98
98
|
/** Classes applied to the input element */
|
|
99
99
|
protected readonly inputClass = computed(() =>
|
|
100
100
|
cn(
|
|
101
|
-
'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground border-input w-full min-w-0 rounded-
|
|
102
|
-
'
|
|
103
|
-
'focus-visible:border-primary/30 dark:focus-visible:border-white/30 focus-visible:ring-primary/20 dark:focus-visible:ring-white/20 focus-visible:ring-2',
|
|
101
|
+
'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
|
|
102
|
+
'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
|
|
104
103
|
'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
|
105
104
|
this.class(),
|
|
106
105
|
),
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
inject,
|
|
9
9
|
input,
|
|
10
10
|
model,
|
|
11
|
-
output,
|
|
12
11
|
signal,
|
|
13
12
|
} from '@angular/core';
|
|
14
13
|
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
@@ -121,9 +120,6 @@ export type RadioGroupProps = {
|
|
|
121
120
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
122
121
|
})
|
|
123
122
|
export class RadioGroup implements ControlValueAccessor {
|
|
124
|
-
/** Emitted when value changes */
|
|
125
|
-
readonly valueChange = output<string>();
|
|
126
|
-
|
|
127
123
|
/** The current selected value */
|
|
128
124
|
readonly value = model<string>('');
|
|
129
125
|
|
|
@@ -169,7 +165,6 @@ export class RadioGroup implements ControlValueAccessor {
|
|
|
169
165
|
this.context.value.set(value);
|
|
170
166
|
this.onChange(value);
|
|
171
167
|
this.onTouched();
|
|
172
|
-
this.valueChange.emit(value);
|
|
173
168
|
}
|
|
174
169
|
},
|
|
175
170
|
focusNext: (currentValue: string) => this.focusItem(currentValue, 1),
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
inject,
|
|
11
11
|
input,
|
|
12
12
|
model,
|
|
13
|
-
output,
|
|
14
13
|
signal,
|
|
15
14
|
} from '@angular/core';
|
|
16
15
|
import { SELECT_CONTEXT, type SelectContext } from './select-context';
|
|
@@ -168,11 +167,6 @@ export class Select {
|
|
|
168
167
|
});
|
|
169
168
|
}
|
|
170
169
|
|
|
171
|
-
/** Event handler called when the value changes */
|
|
172
|
-
readonly valueChange = output<string>();
|
|
173
|
-
/** Event handler called when the open state changes */
|
|
174
|
-
readonly openChange = output<boolean>();
|
|
175
|
-
|
|
176
170
|
/** The controlled value of the select */
|
|
177
171
|
readonly value = model<string>('');
|
|
178
172
|
/** The controlled open state of the select */
|
|
@@ -211,7 +205,6 @@ export class Select {
|
|
|
211
205
|
setOpen: (open: boolean) => {
|
|
212
206
|
this._isOpen.set(open);
|
|
213
207
|
this.open.set(open);
|
|
214
|
-
this.openChange.emit(open);
|
|
215
208
|
},
|
|
216
209
|
disabled: this._isDisabled,
|
|
217
210
|
placeholder: signal(''),
|
|
@@ -225,7 +218,6 @@ export class Select {
|
|
|
225
218
|
setValue: (value: string, label?: string) => {
|
|
226
219
|
this._value.set(value);
|
|
227
220
|
this.value.set(value);
|
|
228
|
-
this.valueChange.emit(value);
|
|
229
221
|
if (label) {
|
|
230
222
|
this.context.selectedLabel.set(label);
|
|
231
223
|
}
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
HostListener,
|
|
11
11
|
input,
|
|
12
12
|
model,
|
|
13
|
-
output,
|
|
14
13
|
signal,
|
|
15
14
|
} from '@angular/core';
|
|
16
15
|
import {
|
|
@@ -71,9 +70,6 @@ export class SidebarProvider {
|
|
|
71
70
|
});
|
|
72
71
|
}
|
|
73
72
|
|
|
74
|
-
/** Open state change event */
|
|
75
|
-
readonly openChange = output<boolean>();
|
|
76
|
-
|
|
77
73
|
/** Controlled open state */
|
|
78
74
|
readonly open = model<boolean>(true);
|
|
79
75
|
|
|
@@ -101,7 +97,6 @@ export class SidebarProvider {
|
|
|
101
97
|
this.context.open.set(value);
|
|
102
98
|
this.context.state.set(value ? 'expanded' : 'collapsed');
|
|
103
99
|
this.open.set(value);
|
|
104
|
-
this.openChange.emit(value);
|
|
105
100
|
},
|
|
106
101
|
openMobile: signal(false),
|
|
107
102
|
setOpenMobile: (value: boolean) => {
|
|
@@ -168,8 +168,6 @@ export class Slider implements ControlValueAccessor {
|
|
|
168
168
|
private readonly thumb = viewChild<ElementRef<HTMLElement>>('thumb');
|
|
169
169
|
private readonly elementRef = viewChild<ElementRef<HTMLElement>>('slider');
|
|
170
170
|
|
|
171
|
-
/** Emitted when value changes */
|
|
172
|
-
readonly valueChange = output<number>();
|
|
173
171
|
/** Emitted when value change is committed (on release) */
|
|
174
172
|
readonly valueCommit = output<number>();
|
|
175
173
|
|
|
@@ -373,7 +371,6 @@ export class Slider implements ControlValueAccessor {
|
|
|
373
371
|
if (newValue !== this.value()) {
|
|
374
372
|
this.value.set(newValue);
|
|
375
373
|
this.onChange(newValue);
|
|
376
|
-
this.valueChange.emit(newValue);
|
|
377
374
|
}
|
|
378
375
|
}
|
|
379
376
|
|
|
@@ -406,7 +403,6 @@ export class Slider implements ControlValueAccessor {
|
|
|
406
403
|
if (newValue !== this.value()) {
|
|
407
404
|
this.value.set(newValue);
|
|
408
405
|
this.onChange(newValue);
|
|
409
|
-
this.valueChange.emit(newValue);
|
|
410
406
|
}
|
|
411
407
|
}
|
|
412
408
|
}
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
forwardRef,
|
|
8
8
|
input,
|
|
9
9
|
model,
|
|
10
|
-
output,
|
|
11
10
|
signal,
|
|
12
11
|
viewChild,
|
|
13
12
|
} from '@angular/core';
|
|
@@ -144,9 +143,6 @@ export class Switch implements ControlValueAccessor {
|
|
|
144
143
|
|
|
145
144
|
private readonly buttonElement = viewChild<ElementRef<HTMLButtonElement>>('buttonElement');
|
|
146
145
|
|
|
147
|
-
/** Emitted when checked state changes */
|
|
148
|
-
readonly checkedChange = output<boolean>();
|
|
149
|
-
|
|
150
146
|
/** Whether the switch is checked/on */
|
|
151
147
|
readonly checked = model<boolean>(false);
|
|
152
148
|
|
|
@@ -237,7 +233,6 @@ export class Switch implements ControlValueAccessor {
|
|
|
237
233
|
this.checked.set(newValue);
|
|
238
234
|
this.onChange(newValue);
|
|
239
235
|
this.onTouched();
|
|
240
|
-
this.checkedChange.emit(newValue);
|
|
241
236
|
}
|
|
242
237
|
}
|
|
243
238
|
|
|
@@ -31,7 +31,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
|
31
31
|
* <textarea Textarea formControlName="message" placeholder="Enter message"></textarea>
|
|
32
32
|
*/
|
|
33
33
|
@Component({
|
|
34
|
-
selector: 'textarea[Textarea]',
|
|
34
|
+
selector: 'textarea[Textarea], Textarea',
|
|
35
35
|
template: '',
|
|
36
36
|
host: {
|
|
37
37
|
'[class]': 'computedClass()',
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
forwardRef,
|
|
7
7
|
input,
|
|
8
8
|
model,
|
|
9
|
-
output,
|
|
10
9
|
signal,
|
|
11
10
|
} from '@angular/core';
|
|
12
11
|
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
@@ -120,9 +119,6 @@ export class Toggle implements ControlValueAccessor {
|
|
|
120
119
|
}
|
|
121
120
|
}
|
|
122
121
|
|
|
123
|
-
/** Emitted when pressed state changes */
|
|
124
|
-
readonly pressedChange = output<boolean>();
|
|
125
|
-
|
|
126
122
|
/** Whether the toggle is pressed/on */
|
|
127
123
|
readonly pressed = model<boolean>(false);
|
|
128
124
|
|
|
@@ -170,7 +166,6 @@ export class Toggle implements ControlValueAccessor {
|
|
|
170
166
|
this.pressed.set(newValue);
|
|
171
167
|
this.onChange(newValue);
|
|
172
168
|
this.onTouched();
|
|
173
|
-
this.pressedChange.emit(newValue);
|
|
174
169
|
}
|
|
175
170
|
}
|
|
176
171
|
// ControlValueAccessor implementation
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
inject,
|
|
9
9
|
input,
|
|
10
10
|
model,
|
|
11
|
-
output,
|
|
12
11
|
signal,
|
|
13
12
|
} from '@angular/core';
|
|
14
13
|
import type { ToggleVariants } from '../toggle/toggle-variants';
|
|
@@ -138,9 +137,6 @@ export type ToggleGroupProps = {
|
|
|
138
137
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
139
138
|
})
|
|
140
139
|
export class ToggleGroup {
|
|
141
|
-
/** Emitted when value changes */
|
|
142
|
-
readonly valueChange = output<string | string[]>();
|
|
143
|
-
|
|
144
140
|
/** The current selected value(s) */
|
|
145
141
|
readonly value = model<string | string[]>('');
|
|
146
142
|
|
|
@@ -205,7 +201,6 @@ export class ToggleGroup {
|
|
|
205
201
|
|
|
206
202
|
this.value.set(newValue);
|
|
207
203
|
this.context.value.set(newValue);
|
|
208
|
-
this.valueChange.emit(newValue);
|
|
209
204
|
},
|
|
210
205
|
isPressed: (itemValue: string) => {
|
|
211
206
|
const currentValue = this.context.value();
|