@neural-ui/core 1.7.1 → 1.7.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/bottom-sheet/package.json +4 -0
- package/confirm-popup/package.json +4 -0
- package/data-view/package.json +4 -0
- package/fesm2022/neural-ui-core-alert.mjs +48 -21
- package/fesm2022/neural-ui-core-alert.mjs.map +1 -1
- package/fesm2022/neural-ui-core-autocomplete.mjs +153 -71
- package/fesm2022/neural-ui-core-autocomplete.mjs.map +1 -1
- package/fesm2022/neural-ui-core-block-ui.mjs +2 -2
- package/fesm2022/neural-ui-core-block-ui.mjs.map +1 -1
- package/fesm2022/neural-ui-core-bottom-sheet.mjs +121 -0
- package/fesm2022/neural-ui-core-bottom-sheet.mjs.map +1 -0
- package/fesm2022/neural-ui-core-breadcrumb.mjs +2 -2
- package/fesm2022/neural-ui-core-breadcrumb.mjs.map +1 -1
- package/fesm2022/neural-ui-core-button.mjs +2 -2
- package/fesm2022/neural-ui-core-button.mjs.map +1 -1
- package/fesm2022/neural-ui-core-calendar.mjs +2 -2
- package/fesm2022/neural-ui-core-calendar.mjs.map +1 -1
- package/fesm2022/neural-ui-core-checkbox.mjs +69 -39
- package/fesm2022/neural-ui-core-checkbox.mjs.map +1 -1
- package/fesm2022/neural-ui-core-chip.mjs +2 -2
- package/fesm2022/neural-ui-core-chip.mjs.map +1 -1
- package/fesm2022/neural-ui-core-code-block.mjs +2 -2
- package/fesm2022/neural-ui-core-code-block.mjs.map +1 -1
- package/fesm2022/neural-ui-core-confirm-popup.mjs +105 -0
- package/fesm2022/neural-ui-core-confirm-popup.mjs.map +1 -0
- package/fesm2022/neural-ui-core-dashboard-grid.mjs +9 -3
- package/fesm2022/neural-ui-core-dashboard-grid.mjs.map +1 -1
- package/fesm2022/neural-ui-core-data-view.mjs +386 -0
- package/fesm2022/neural-ui-core-data-view.mjs.map +1 -0
- package/fesm2022/neural-ui-core-date-input.mjs +185 -10
- package/fesm2022/neural-ui-core-date-input.mjs.map +1 -1
- package/fesm2022/neural-ui-core-empty-state.mjs +19 -5
- package/fesm2022/neural-ui-core-empty-state.mjs.map +1 -1
- package/fesm2022/neural-ui-core-form-field.mjs +81 -0
- package/fesm2022/neural-ui-core-form-field.mjs.map +1 -0
- package/fesm2022/neural-ui-core-inline-editor.mjs +428 -0
- package/fesm2022/neural-ui-core-inline-editor.mjs.map +1 -0
- package/fesm2022/neural-ui-core-input-mask.mjs +110 -0
- package/fesm2022/neural-ui-core-input-mask.mjs.map +1 -0
- package/fesm2022/neural-ui-core-input.mjs +2 -2
- package/fesm2022/neural-ui-core-input.mjs.map +1 -1
- package/fesm2022/neural-ui-core-listbox.mjs +219 -0
- package/fesm2022/neural-ui-core-listbox.mjs.map +1 -0
- package/fesm2022/neural-ui-core-menu.mjs +229 -0
- package/fesm2022/neural-ui-core-menu.mjs.map +1 -0
- package/fesm2022/neural-ui-core-modal.mjs +34 -10
- package/fesm2022/neural-ui-core-modal.mjs.map +1 -1
- package/fesm2022/neural-ui-core-multiselect.mjs +170 -179
- package/fesm2022/neural-ui-core-multiselect.mjs.map +1 -1
- package/fesm2022/neural-ui-core-number-input.mjs +2 -2
- package/fesm2022/neural-ui-core-number-input.mjs.map +1 -1
- package/fesm2022/neural-ui-core-panel.mjs +92 -0
- package/fesm2022/neural-ui-core-panel.mjs.map +1 -0
- package/fesm2022/neural-ui-core-password.mjs +106 -0
- package/fesm2022/neural-ui-core-password.mjs.map +1 -0
- package/fesm2022/neural-ui-core-pick-list.mjs +133 -0
- package/fesm2022/neural-ui-core-pick-list.mjs.map +1 -0
- package/fesm2022/neural-ui-core-select.mjs +128 -166
- package/fesm2022/neural-ui-core-select.mjs.map +1 -1
- package/fesm2022/neural-ui-core-sidebar.mjs +14 -3
- package/fesm2022/neural-ui-core-sidebar.mjs.map +1 -1
- package/fesm2022/neural-ui-core-slider.mjs +2 -2
- package/fesm2022/neural-ui-core-slider.mjs.map +1 -1
- package/fesm2022/neural-ui-core-spinner.mjs +19 -9
- package/fesm2022/neural-ui-core-spinner.mjs.map +1 -1
- package/fesm2022/neural-ui-core-split-button.mjs +2 -2
- package/fesm2022/neural-ui-core-split-button.mjs.map +1 -1
- package/fesm2022/neural-ui-core-table.mjs +503 -62
- package/fesm2022/neural-ui-core-table.mjs.map +1 -1
- package/fesm2022/neural-ui-core-tabs.mjs +11 -4
- package/fesm2022/neural-ui-core-tabs.mjs.map +1 -1
- package/fesm2022/neural-ui-core-tags.mjs +134 -0
- package/fesm2022/neural-ui-core-tags.mjs.map +1 -0
- package/fesm2022/neural-ui-core-textarea.mjs +2 -2
- package/fesm2022/neural-ui-core-textarea.mjs.map +1 -1
- package/fesm2022/neural-ui-core-toggle-button-group.mjs +2 -2
- package/fesm2022/neural-ui-core-toggle-button-group.mjs.map +1 -1
- package/fesm2022/neural-ui-core-toolbar.mjs +16 -4
- package/fesm2022/neural-ui-core-toolbar.mjs.map +1 -1
- package/fesm2022/neural-ui-core-tree-select.mjs +259 -0
- package/fesm2022/neural-ui-core-tree-select.mjs.map +1 -0
- package/fesm2022/neural-ui-core-tree-table.mjs +267 -8
- package/fesm2022/neural-ui-core-tree-table.mjs.map +1 -1
- package/fesm2022/neural-ui-core-tree.mjs +15 -14
- package/fesm2022/neural-ui-core-tree.mjs.map +1 -1
- package/fesm2022/neural-ui-core-uploader.mjs +103 -12
- package/fesm2022/neural-ui-core-uploader.mjs.map +1 -1
- package/form-field/package.json +4 -0
- package/inline-editor/package.json +4 -0
- package/input-mask/package.json +4 -0
- package/listbox/package.json +4 -0
- package/menu/package.json +4 -0
- package/package.json +53 -1
- package/panel/package.json +4 -0
- package/password/package.json +4 -0
- package/pick-list/package.json +4 -0
- package/styles/_tokens.scss +33 -17
- package/tags/package.json +4 -0
- package/tree-select/package.json +4 -0
- package/types/neural-ui-core-alert.d.ts +2 -1
- package/types/neural-ui-core-autocomplete.d.ts +22 -2
- package/types/neural-ui-core-bottom-sheet.d.ts +20 -0
- package/types/neural-ui-core-checkbox.d.ts +6 -1
- package/types/neural-ui-core-confirm-popup.d.ts +38 -0
- package/types/neural-ui-core-dashboard-grid.d.ts +1 -0
- package/types/neural-ui-core-data-view.d.ts +95 -0
- package/types/neural-ui-core-date-input.d.ts +35 -5
- package/types/neural-ui-core-empty-state.d.ts +11 -1
- package/types/neural-ui-core-form-field.d.ts +33 -0
- package/types/neural-ui-core-inline-editor.d.ts +66 -0
- package/types/neural-ui-core-input-mask.d.ts +26 -0
- package/types/neural-ui-core-listbox.d.ts +54 -0
- package/types/neural-ui-core-menu.d.ts +49 -0
- package/types/neural-ui-core-modal.d.ts +10 -2
- package/types/neural-ui-core-multiselect.d.ts +10 -1
- package/types/neural-ui-core-panel.d.ts +25 -0
- package/types/neural-ui-core-password.d.ts +29 -0
- package/types/neural-ui-core-pick-list.d.ts +40 -0
- package/types/neural-ui-core-select.d.ts +7 -1
- package/types/neural-ui-core-sidebar.d.ts +5 -1
- package/types/neural-ui-core-spinner.d.ts +4 -2
- package/types/neural-ui-core-table.d.ts +89 -5
- package/types/neural-ui-core-tabs.d.ts +2 -0
- package/types/neural-ui-core-tags.d.ts +32 -0
- package/types/neural-ui-core-toolbar.d.ts +8 -2
- package/types/neural-ui-core-tree-select.d.ts +57 -0
- package/types/neural-ui-core-tree-table.d.ts +111 -4
- package/types/neural-ui-core-tree.d.ts +1 -1
- package/types/neural-ui-core-uploader.d.ts +26 -3
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, signal, computed, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
|
|
5
|
+
class NeuPasswordComponent {
|
|
6
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
7
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
8
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
9
|
+
toggleable = input(true, ...(ngDevMode ? [{ debugName: "toggleable" }] : /* istanbul ignore next */ []));
|
|
10
|
+
showStrength = input(false, ...(ngDevMode ? [{ debugName: "showStrength" }] : /* istanbul ignore next */ []));
|
|
11
|
+
showLabel = input('Show', ...(ngDevMode ? [{ debugName: "showLabel" }] : /* istanbul ignore next */ []));
|
|
12
|
+
hideLabel = input('Hide', ...(ngDevMode ? [{ debugName: "hideLabel" }] : /* istanbul ignore next */ []));
|
|
13
|
+
valueChange = output();
|
|
14
|
+
inputId = `neu-password-${Math.random().toString(36).slice(2)}`;
|
|
15
|
+
value = signal('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
16
|
+
visible = signal(false, ...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
17
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
18
|
+
strength = computed(() => {
|
|
19
|
+
const value = this.value();
|
|
20
|
+
return [value.length >= 8, /[A-Z]/.test(value), /\d/.test(value), /\W/.test(value)].filter(Boolean).length;
|
|
21
|
+
}, ...(ngDevMode ? [{ debugName: "strength" }] : /* istanbul ignore next */ []));
|
|
22
|
+
onChange = () => { };
|
|
23
|
+
onTouched = () => { };
|
|
24
|
+
writeValue(value) {
|
|
25
|
+
this.value.set(value ?? '');
|
|
26
|
+
}
|
|
27
|
+
registerOnChange(fn) {
|
|
28
|
+
this.onChange = fn;
|
|
29
|
+
}
|
|
30
|
+
registerOnTouched(fn) {
|
|
31
|
+
this.onTouched = fn;
|
|
32
|
+
}
|
|
33
|
+
setDisabledState(isDisabled) {
|
|
34
|
+
this.cvaDisabled.set(isDisabled);
|
|
35
|
+
}
|
|
36
|
+
setValue(value) {
|
|
37
|
+
this.value.set(value);
|
|
38
|
+
this.onChange(value);
|
|
39
|
+
this.valueChange.emit(value);
|
|
40
|
+
}
|
|
41
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuPasswordComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
42
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: NeuPasswordComponent, isStandalone: true, selector: "neu-password", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, toggleable: { classPropertyName: "toggleable", publicName: "toggleable", isSignal: true, isRequired: false, transformFunction: null }, showStrength: { classPropertyName: "showStrength", publicName: "showStrength", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, hideLabel: { classPropertyName: "hideLabel", publicName: "hideLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { classAttribute: "neu-password" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NeuPasswordComponent), multi: true }], ngImport: i0, template: `
|
|
43
|
+
@if (label()) {
|
|
44
|
+
<label class="neu-password__label" [for]="inputId">{{ label() }}</label>
|
|
45
|
+
}
|
|
46
|
+
<div class="neu-password__wrap">
|
|
47
|
+
<input
|
|
48
|
+
class="neu-password__control"
|
|
49
|
+
[id]="inputId"
|
|
50
|
+
[type]="visible() ? 'text' : 'password'"
|
|
51
|
+
[placeholder]="placeholder()"
|
|
52
|
+
[value]="value()"
|
|
53
|
+
[disabled]="disabled() || cvaDisabled()"
|
|
54
|
+
(input)="setValue($any($event.target).value)"
|
|
55
|
+
(blur)="onTouched()"
|
|
56
|
+
/>
|
|
57
|
+
@if (toggleable()) {
|
|
58
|
+
<button type="button" class="neu-password__toggle" (click)="visible.set(!visible())">
|
|
59
|
+
{{ visible() ? hideLabel() : showLabel() }}
|
|
60
|
+
</button>
|
|
61
|
+
}
|
|
62
|
+
</div>
|
|
63
|
+
@if (showStrength()) {
|
|
64
|
+
<div class="neu-password__strength" [attr.data-score]="strength()">
|
|
65
|
+
<span></span><span></span><span></span><span></span>
|
|
66
|
+
</div>
|
|
67
|
+
}
|
|
68
|
+
`, isInline: true, styles: [".neu-password{display:grid;gap:.375rem}.neu-password__label{font-size:.875rem;font-weight:600;color:var(--neu-text, #111827)}.neu-password__wrap{display:flex;border:1px solid var(--neu-border, #d1d5db);border-radius:.625rem;background:var(--neu-surface, #fff);overflow:hidden}.neu-password__control{flex:1;min-width:0;min-height:2.5rem;border:0;background:var(--neu-surface, #fff);color:var(--neu-text, #111827);padding:0 .75rem}.neu-password__toggle{border:0;border-left:1px solid var(--neu-border, #d1d5db);background:var(--neu-surface-2, #f3f4f6);color:var(--neu-text, #111827);padding:0 .75rem}.neu-password__strength{display:grid;grid-template-columns:repeat(4,1fr);gap:.25rem}.neu-password__strength span{height:.25rem;border-radius:999px;background:var(--neu-border, #e5e7eb)}.neu-password__strength[data-score=\"1\"] span:nth-child(-n+1),.neu-password__strength[data-score=\"2\"] span:nth-child(-n+2),.neu-password__strength[data-score=\"3\"] span:nth-child(-n+3),.neu-password__strength[data-score=\"4\"] span:nth-child(-n+4){background:var(--neu-primary, #2563eb)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
69
|
+
}
|
|
70
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuPasswordComponent, decorators: [{
|
|
71
|
+
type: Component,
|
|
72
|
+
args: [{ selector: 'neu-password', imports: [], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NeuPasswordComponent), multi: true }], host: { class: 'neu-password' }, template: `
|
|
73
|
+
@if (label()) {
|
|
74
|
+
<label class="neu-password__label" [for]="inputId">{{ label() }}</label>
|
|
75
|
+
}
|
|
76
|
+
<div class="neu-password__wrap">
|
|
77
|
+
<input
|
|
78
|
+
class="neu-password__control"
|
|
79
|
+
[id]="inputId"
|
|
80
|
+
[type]="visible() ? 'text' : 'password'"
|
|
81
|
+
[placeholder]="placeholder()"
|
|
82
|
+
[value]="value()"
|
|
83
|
+
[disabled]="disabled() || cvaDisabled()"
|
|
84
|
+
(input)="setValue($any($event.target).value)"
|
|
85
|
+
(blur)="onTouched()"
|
|
86
|
+
/>
|
|
87
|
+
@if (toggleable()) {
|
|
88
|
+
<button type="button" class="neu-password__toggle" (click)="visible.set(!visible())">
|
|
89
|
+
{{ visible() ? hideLabel() : showLabel() }}
|
|
90
|
+
</button>
|
|
91
|
+
}
|
|
92
|
+
</div>
|
|
93
|
+
@if (showStrength()) {
|
|
94
|
+
<div class="neu-password__strength" [attr.data-score]="strength()">
|
|
95
|
+
<span></span><span></span><span></span><span></span>
|
|
96
|
+
</div>
|
|
97
|
+
}
|
|
98
|
+
`, styles: [".neu-password{display:grid;gap:.375rem}.neu-password__label{font-size:.875rem;font-weight:600;color:var(--neu-text, #111827)}.neu-password__wrap{display:flex;border:1px solid var(--neu-border, #d1d5db);border-radius:.625rem;background:var(--neu-surface, #fff);overflow:hidden}.neu-password__control{flex:1;min-width:0;min-height:2.5rem;border:0;background:var(--neu-surface, #fff);color:var(--neu-text, #111827);padding:0 .75rem}.neu-password__toggle{border:0;border-left:1px solid var(--neu-border, #d1d5db);background:var(--neu-surface-2, #f3f4f6);color:var(--neu-text, #111827);padding:0 .75rem}.neu-password__strength{display:grid;grid-template-columns:repeat(4,1fr);gap:.25rem}.neu-password__strength span{height:.25rem;border-radius:999px;background:var(--neu-border, #e5e7eb)}.neu-password__strength[data-score=\"1\"] span:nth-child(-n+1),.neu-password__strength[data-score=\"2\"] span:nth-child(-n+2),.neu-password__strength[data-score=\"3\"] span:nth-child(-n+3),.neu-password__strength[data-score=\"4\"] span:nth-child(-n+4){background:var(--neu-primary, #2563eb)}\n"] }]
|
|
99
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], toggleable: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggleable", required: false }] }], showStrength: [{ type: i0.Input, args: [{ isSignal: true, alias: "showStrength", required: false }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], hideLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideLabel", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Generated bundle index. Do not edit.
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
export { NeuPasswordComponent };
|
|
106
|
+
//# sourceMappingURL=neural-ui-core-password.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"neural-ui-core-password.mjs","sources":["../../../../projects/ui-core/password/neu-password.component.ts","../../../../projects/ui-core/password/neural-ui-core-password.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, forwardRef, input, output, signal } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Component({\n selector: 'neu-password',\n imports: [],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NeuPasswordComponent), multi: true }],\n host: { class: 'neu-password' },\n template: `\n @if (label()) {\n <label class=\"neu-password__label\" [for]=\"inputId\">{{ label() }}</label>\n }\n <div class=\"neu-password__wrap\">\n <input\n class=\"neu-password__control\"\n [id]=\"inputId\"\n [type]=\"visible() ? 'text' : 'password'\"\n [placeholder]=\"placeholder()\"\n [value]=\"value()\"\n [disabled]=\"disabled() || cvaDisabled()\"\n (input)=\"setValue($any($event.target).value)\"\n (blur)=\"onTouched()\"\n />\n @if (toggleable()) {\n <button type=\"button\" class=\"neu-password__toggle\" (click)=\"visible.set(!visible())\">\n {{ visible() ? hideLabel() : showLabel() }}\n </button>\n }\n </div>\n @if (showStrength()) {\n <div class=\"neu-password__strength\" [attr.data-score]=\"strength()\">\n <span></span><span></span><span></span><span></span>\n </div>\n }\n `,\n styleUrl: './neu-password.component.scss',\n})\nexport class NeuPasswordComponent implements ControlValueAccessor {\n readonly label = input('');\n readonly placeholder = input('');\n readonly disabled = input(false);\n readonly toggleable = input(true);\n readonly showStrength = input(false);\n readonly showLabel = input('Show');\n readonly hideLabel = input('Hide');\n readonly valueChange = output<string>();\n readonly inputId = `neu-password-${Math.random().toString(36).slice(2)}`;\n readonly value = signal('');\n readonly visible = signal(false);\n readonly cvaDisabled = signal(false);\n readonly strength = computed(() => {\n const value = this.value();\n return [value.length >= 8, /[A-Z]/.test(value), /\\d/.test(value), /\\W/.test(value)].filter(Boolean).length;\n });\n private onChange: (value: string) => void = () => {};\n onTouched: () => void = () => {};\n\n writeValue(value: string | null): void {\n this.value.set(value ?? '');\n }\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.cvaDisabled.set(isDisabled);\n }\n setValue(value: string): void {\n this.value.set(value);\n this.onChange(value);\n this.valueChange.emit(value);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;MAuCa,oBAAoB,CAAA;AACtB,IAAA,KAAK,GAAG,KAAK,CAAC,EAAE,4EAAC;AACjB,IAAA,WAAW,GAAG,KAAK,CAAC,EAAE,kFAAC;AACvB,IAAA,QAAQ,GAA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;;;;;;;;;;;;;;;;;;;;;AA0BT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,sjCAAA,CAAA,EAAA;;;ACpCH;;AAEG;;;;"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, signal, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
class NeuPickListComponent {
|
|
5
|
+
source = input([], ...(ngDevMode ? [{ debugName: "source" }] : /* istanbul ignore next */ []));
|
|
6
|
+
target = input([], ...(ngDevMode ? [{ debugName: "target" }] : /* istanbul ignore next */ []));
|
|
7
|
+
sourceHeader = input('Available', ...(ngDevMode ? [{ debugName: "sourceHeader" }] : /* istanbul ignore next */ []));
|
|
8
|
+
targetHeader = input('Selected', ...(ngDevMode ? [{ debugName: "targetHeader" }] : /* istanbul ignore next */ []));
|
|
9
|
+
sourceChange = output();
|
|
10
|
+
targetChange = output();
|
|
11
|
+
itemsChange = output();
|
|
12
|
+
sourceSelection = signal(new Set(), ...(ngDevMode ? [{ debugName: "sourceSelection" }] : /* istanbul ignore next */ []));
|
|
13
|
+
targetSelection = signal(new Set(), ...(ngDevMode ? [{ debugName: "targetSelection" }] : /* istanbul ignore next */ []));
|
|
14
|
+
toggleSource(value) {
|
|
15
|
+
this.sourceSelection.set(this.toggleSet(this.sourceSelection(), value));
|
|
16
|
+
}
|
|
17
|
+
toggleTarget(value) {
|
|
18
|
+
this.targetSelection.set(this.toggleSet(this.targetSelection(), value));
|
|
19
|
+
}
|
|
20
|
+
moveToTarget() {
|
|
21
|
+
const selected = this.sourceSelection();
|
|
22
|
+
const moved = this.source().filter((item) => selected.has(item.value));
|
|
23
|
+
this.commit(this.source().filter((item) => !selected.has(item.value)), [...this.target(), ...moved]);
|
|
24
|
+
this.sourceSelection.set(new Set());
|
|
25
|
+
}
|
|
26
|
+
moveToSource() {
|
|
27
|
+
const selected = this.targetSelection();
|
|
28
|
+
const moved = this.target().filter((item) => selected.has(item.value));
|
|
29
|
+
this.commit([...this.source(), ...moved], this.target().filter((item) => !selected.has(item.value)));
|
|
30
|
+
this.targetSelection.set(new Set());
|
|
31
|
+
}
|
|
32
|
+
commit(source, target) {
|
|
33
|
+
this.sourceChange.emit(source);
|
|
34
|
+
this.targetChange.emit(target);
|
|
35
|
+
this.itemsChange.emit({ source, target });
|
|
36
|
+
}
|
|
37
|
+
toggleSet(source, value) {
|
|
38
|
+
const next = new Set(source);
|
|
39
|
+
next.has(value) ? next.delete(value) : next.add(value);
|
|
40
|
+
return next;
|
|
41
|
+
}
|
|
42
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuPickListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
43
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: NeuPickListComponent, isStandalone: true, selector: "neu-pick-list", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null }, sourceHeader: { classPropertyName: "sourceHeader", publicName: "sourceHeader", isSignal: true, isRequired: false, transformFunction: null }, targetHeader: { classPropertyName: "targetHeader", publicName: "targetHeader", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sourceChange: "sourceChange", targetChange: "targetChange", itemsChange: "itemsChange" }, host: { classAttribute: "neu-pick-list" }, ngImport: i0, template: `
|
|
44
|
+
<section class="neu-pick-list__column">
|
|
45
|
+
<h3>{{ sourceHeader() }}</h3>
|
|
46
|
+
@for (item of source(); track item.value) {
|
|
47
|
+
<button type="button" [class.is-selected]="sourceSelection().has(item.value)" [disabled]="item.disabled" (click)="toggleSource(item.value)">
|
|
48
|
+
{{ item.label }}
|
|
49
|
+
</button>
|
|
50
|
+
}
|
|
51
|
+
</section>
|
|
52
|
+
<div class="neu-pick-list__actions">
|
|
53
|
+
<button type="button" (click)="moveToTarget()" [disabled]="!sourceSelection().size">›</button>
|
|
54
|
+
<button type="button" (click)="moveToSource()" [disabled]="!targetSelection().size">‹</button>
|
|
55
|
+
</div>
|
|
56
|
+
<section class="neu-pick-list__column">
|
|
57
|
+
<h3>{{ targetHeader() }}</h3>
|
|
58
|
+
@for (item of target(); track item.value) {
|
|
59
|
+
<button type="button" [class.is-selected]="targetSelection().has(item.value)" [disabled]="item.disabled" (click)="toggleTarget(item.value)">
|
|
60
|
+
{{ item.label }}
|
|
61
|
+
</button>
|
|
62
|
+
}
|
|
63
|
+
</section>
|
|
64
|
+
`, isInline: true, styles: [".neu-pick-list{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:.75rem;align-items:center}.neu-pick-list__column,.neu-order-list__items{display:grid;gap:.375rem;min-height:12rem;border:1px solid var(--neu-border, #d1d5db);border-radius:.75rem;background:var(--neu-surface, #fff);color:var(--neu-text, #111827);padding:.75rem}.neu-pick-list__column h3{margin:0 0 .5rem;font-size:.875rem;color:var(--neu-text, #111827)}.neu-pick-list__column button,.neu-pick-list__actions button,.neu-order-list__item button{border:1px solid var(--neu-border, #d1d5db);border-radius:.5rem;background:var(--neu-surface, #fff);color:var(--neu-text, #111827);padding:.5rem .625rem}.neu-pick-list__column button{text-align:left}.neu-pick-list__column button.is-selected{background:color-mix(in srgb,var(--neu-primary, #2563eb) 14%,transparent)}.neu-pick-list__actions{display:grid;gap:.5rem}.neu-order-list__item{display:grid;grid-template-columns:1fr auto auto;gap:.375rem;align-items:center}@media(max-width:640px){.neu-pick-list{grid-template-columns:minmax(0,1fr)}.neu-pick-list__actions{grid-template-columns:repeat(2,auto);justify-content:center}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
65
|
+
}
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuPickListComponent, decorators: [{
|
|
67
|
+
type: Component,
|
|
68
|
+
args: [{ selector: 'neu-pick-list', imports: [], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'neu-pick-list' }, template: `
|
|
69
|
+
<section class="neu-pick-list__column">
|
|
70
|
+
<h3>{{ sourceHeader() }}</h3>
|
|
71
|
+
@for (item of source(); track item.value) {
|
|
72
|
+
<button type="button" [class.is-selected]="sourceSelection().has(item.value)" [disabled]="item.disabled" (click)="toggleSource(item.value)">
|
|
73
|
+
{{ item.label }}
|
|
74
|
+
</button>
|
|
75
|
+
}
|
|
76
|
+
</section>
|
|
77
|
+
<div class="neu-pick-list__actions">
|
|
78
|
+
<button type="button" (click)="moveToTarget()" [disabled]="!sourceSelection().size">›</button>
|
|
79
|
+
<button type="button" (click)="moveToSource()" [disabled]="!targetSelection().size">‹</button>
|
|
80
|
+
</div>
|
|
81
|
+
<section class="neu-pick-list__column">
|
|
82
|
+
<h3>{{ targetHeader() }}</h3>
|
|
83
|
+
@for (item of target(); track item.value) {
|
|
84
|
+
<button type="button" [class.is-selected]="targetSelection().has(item.value)" [disabled]="item.disabled" (click)="toggleTarget(item.value)">
|
|
85
|
+
{{ item.label }}
|
|
86
|
+
</button>
|
|
87
|
+
}
|
|
88
|
+
</section>
|
|
89
|
+
`, styles: [".neu-pick-list{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:.75rem;align-items:center}.neu-pick-list__column,.neu-order-list__items{display:grid;gap:.375rem;min-height:12rem;border:1px solid var(--neu-border, #d1d5db);border-radius:.75rem;background:var(--neu-surface, #fff);color:var(--neu-text, #111827);padding:.75rem}.neu-pick-list__column h3{margin:0 0 .5rem;font-size:.875rem;color:var(--neu-text, #111827)}.neu-pick-list__column button,.neu-pick-list__actions button,.neu-order-list__item button{border:1px solid var(--neu-border, #d1d5db);border-radius:.5rem;background:var(--neu-surface, #fff);color:var(--neu-text, #111827);padding:.5rem .625rem}.neu-pick-list__column button{text-align:left}.neu-pick-list__column button.is-selected{background:color-mix(in srgb,var(--neu-primary, #2563eb) 14%,transparent)}.neu-pick-list__actions{display:grid;gap:.5rem}.neu-order-list__item{display:grid;grid-template-columns:1fr auto auto;gap:.375rem;align-items:center}@media(max-width:640px){.neu-pick-list{grid-template-columns:minmax(0,1fr)}.neu-pick-list__actions{grid-template-columns:repeat(2,auto);justify-content:center}}\n"] }]
|
|
90
|
+
}], propDecorators: { source: [{ type: i0.Input, args: [{ isSignal: true, alias: "source", required: false }] }], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: false }] }], sourceHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "sourceHeader", required: false }] }], targetHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "targetHeader", required: false }] }], sourceChange: [{ type: i0.Output, args: ["sourceChange"] }], targetChange: [{ type: i0.Output, args: ["targetChange"] }], itemsChange: [{ type: i0.Output, args: ["itemsChange"] }] } });
|
|
91
|
+
class NeuOrderListComponent {
|
|
92
|
+
items = input([], ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
93
|
+
orderChange = output();
|
|
94
|
+
move(index, direction) {
|
|
95
|
+
const next = [...this.items()];
|
|
96
|
+
const target = index + direction;
|
|
97
|
+
[next[index], next[target]] = [next[target], next[index]];
|
|
98
|
+
this.orderChange.emit(next);
|
|
99
|
+
}
|
|
100
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuOrderListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
101
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: NeuOrderListComponent, isStandalone: true, selector: "neu-order-list", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { orderChange: "orderChange" }, host: { classAttribute: "neu-order-list" }, ngImport: i0, template: `
|
|
102
|
+
<div class="neu-order-list__items">
|
|
103
|
+
@for (item of items(); track item.value; let i = $index) {
|
|
104
|
+
<div class="neu-order-list__item">
|
|
105
|
+
<span>{{ item.label }}</span>
|
|
106
|
+
<button type="button" [disabled]="i === 0" (click)="move(i, -1)">↑</button>
|
|
107
|
+
<button type="button" [disabled]="i === items().length - 1" (click)="move(i, 1)">↓</button>
|
|
108
|
+
</div>
|
|
109
|
+
}
|
|
110
|
+
</div>
|
|
111
|
+
`, isInline: true, styles: [".neu-pick-list{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:.75rem;align-items:center}.neu-pick-list__column,.neu-order-list__items{display:grid;gap:.375rem;min-height:12rem;border:1px solid var(--neu-border, #d1d5db);border-radius:.75rem;background:var(--neu-surface, #fff);color:var(--neu-text, #111827);padding:.75rem}.neu-pick-list__column h3{margin:0 0 .5rem;font-size:.875rem;color:var(--neu-text, #111827)}.neu-pick-list__column button,.neu-pick-list__actions button,.neu-order-list__item button{border:1px solid var(--neu-border, #d1d5db);border-radius:.5rem;background:var(--neu-surface, #fff);color:var(--neu-text, #111827);padding:.5rem .625rem}.neu-pick-list__column button{text-align:left}.neu-pick-list__column button.is-selected{background:color-mix(in srgb,var(--neu-primary, #2563eb) 14%,transparent)}.neu-pick-list__actions{display:grid;gap:.5rem}.neu-order-list__item{display:grid;grid-template-columns:1fr auto auto;gap:.375rem;align-items:center}@media(max-width:640px){.neu-pick-list{grid-template-columns:minmax(0,1fr)}.neu-pick-list__actions{grid-template-columns:repeat(2,auto);justify-content:center}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
112
|
+
}
|
|
113
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuOrderListComponent, decorators: [{
|
|
114
|
+
type: Component,
|
|
115
|
+
args: [{ selector: 'neu-order-list', imports: [], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'neu-order-list' }, template: `
|
|
116
|
+
<div class="neu-order-list__items">
|
|
117
|
+
@for (item of items(); track item.value; let i = $index) {
|
|
118
|
+
<div class="neu-order-list__item">
|
|
119
|
+
<span>{{ item.label }}</span>
|
|
120
|
+
<button type="button" [disabled]="i === 0" (click)="move(i, -1)">↑</button>
|
|
121
|
+
<button type="button" [disabled]="i === items().length - 1" (click)="move(i, 1)">↓</button>
|
|
122
|
+
</div>
|
|
123
|
+
}
|
|
124
|
+
</div>
|
|
125
|
+
`, styles: [".neu-pick-list{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:.75rem;align-items:center}.neu-pick-list__column,.neu-order-list__items{display:grid;gap:.375rem;min-height:12rem;border:1px solid var(--neu-border, #d1d5db);border-radius:.75rem;background:var(--neu-surface, #fff);color:var(--neu-text, #111827);padding:.75rem}.neu-pick-list__column h3{margin:0 0 .5rem;font-size:.875rem;color:var(--neu-text, #111827)}.neu-pick-list__column button,.neu-pick-list__actions button,.neu-order-list__item button{border:1px solid var(--neu-border, #d1d5db);border-radius:.5rem;background:var(--neu-surface, #fff);color:var(--neu-text, #111827);padding:.5rem .625rem}.neu-pick-list__column button{text-align:left}.neu-pick-list__column button.is-selected{background:color-mix(in srgb,var(--neu-primary, #2563eb) 14%,transparent)}.neu-pick-list__actions{display:grid;gap:.5rem}.neu-order-list__item{display:grid;grid-template-columns:1fr auto auto;gap:.375rem;align-items:center}@media(max-width:640px){.neu-pick-list{grid-template-columns:minmax(0,1fr)}.neu-pick-list__actions{grid-template-columns:repeat(2,auto);justify-content:center}}\n"] }]
|
|
126
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], orderChange: [{ type: i0.Output, args: ["orderChange"] }] } });
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Generated bundle index. Do not edit.
|
|
130
|
+
*/
|
|
131
|
+
|
|
132
|
+
export { NeuOrderListComponent, NeuPickListComponent };
|
|
133
|
+
//# sourceMappingURL=neural-ui-core-pick-list.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"neural-ui-core-pick-list.mjs","sources":["../../../../projects/ui-core/pick-list/neu-pick-list.component.ts","../../../../projects/ui-core/pick-list/neural-ui-core-pick-list.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ViewEncapsulation, input, output, signal } from '@angular/core';\n\nexport interface NeuTransferItem {\n value: string;\n label: string;\n disabled?: boolean;\n data?: unknown;\n}\n\n@Component({\n selector: 'neu-pick-list',\n imports: [],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'neu-pick-list' },\n template: `\n <section class=\"neu-pick-list__column\">\n <h3>{{ sourceHeader() }}</h3>\n @for (item of source(); track item.value) {\n <button type=\"button\" [class.is-selected]=\"sourceSelection().has(item.value)\" [disabled]=\"item.disabled\" (click)=\"toggleSource(item.value)\">\n {{ item.label }}\n </button>\n }\n </section>\n <div class=\"neu-pick-list__actions\">\n <button type=\"button\" (click)=\"moveToTarget()\" [disabled]=\"!sourceSelection().size\">›</button>\n <button type=\"button\" (click)=\"moveToSource()\" [disabled]=\"!targetSelection().size\">‹</button>\n </div>\n <section class=\"neu-pick-list__column\">\n <h3>{{ targetHeader() }}</h3>\n @for (item of target(); track item.value) {\n <button type=\"button\" [class.is-selected]=\"targetSelection().has(item.value)\" [disabled]=\"item.disabled\" (click)=\"toggleTarget(item.value)\">\n {{ item.label }}\n </button>\n }\n </section>\n `,\n styleUrl: './neu-pick-list.component.scss',\n})\nexport class NeuPickListComponent {\n readonly source = input<NeuTransferItem[]>([]);\n readonly target = input<NeuTransferItem[]>([]);\n readonly sourceHeader = input('Available');\n readonly targetHeader = input('Selected');\n readonly sourceChange = output<NeuTransferItem[]>();\n readonly targetChange = output<NeuTransferItem[]>();\n readonly itemsChange = output<{ source: NeuTransferItem[]; target: NeuTransferItem[] }>();\n readonly sourceSelection = signal(new Set<string>());\n readonly targetSelection = signal(new Set<string>());\n\n toggleSource(value: string): void {\n this.sourceSelection.set(this.toggleSet(this.sourceSelection(), value));\n }\n\n toggleTarget(value: string): void {\n this.targetSelection.set(this.toggleSet(this.targetSelection(), value));\n }\n\n moveToTarget(): void {\n const selected = this.sourceSelection();\n const moved = this.source().filter((item) => selected.has(item.value));\n this.commit(\n this.source().filter((item) => !selected.has(item.value)),\n [...this.target(), ...moved],\n );\n this.sourceSelection.set(new Set());\n }\n\n moveToSource(): void {\n const selected = this.targetSelection();\n const moved = this.target().filter((item) => selected.has(item.value));\n this.commit(\n [...this.source(), ...moved],\n this.target().filter((item) => !selected.has(item.value)),\n );\n this.targetSelection.set(new Set());\n }\n\n private commit(source: NeuTransferItem[], target: NeuTransferItem[]): void {\n this.sourceChange.emit(source);\n this.targetChange.emit(target);\n this.itemsChange.emit({ source, target });\n }\n\n private toggleSet(source: Set<string>, value: string): Set<string> {\n const next = new Set(source);\n next.has(value) ? next.delete(value) : next.add(value);\n return next;\n }\n}\n\n@Component({\n selector: 'neu-order-list',\n imports: [],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'neu-order-list' },\n template: `\n <div class=\"neu-order-list__items\">\n @for (item of items(); track item.value; let i = $index) {\n <div class=\"neu-order-list__item\">\n <span>{{ item.label }}</span>\n <button type=\"button\" [disabled]=\"i === 0\" (click)=\"move(i, -1)\">↑</button>\n <button type=\"button\" [disabled]=\"i === items().length - 1\" (click)=\"move(i, 1)\">↓</button>\n </div>\n }\n </div>\n `,\n styleUrl: './neu-pick-list.component.scss',\n})\nexport class NeuOrderListComponent {\n readonly items = input<NeuTransferItem[]>([]);\n readonly orderChange = output<NeuTransferItem[]>();\n\n move(index: number, direction: -1 | 1): void {\n const next = [...this.items()];\n const target = index + direction;\n [next[index], next[target]] = [next[target]!, next[index]!];\n this.orderChange.emit(next);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;MAuCa,oBAAoB,CA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