cloud-ide-element 1.1.1 → 1.1.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.
- package/fesm2022/cloud-ide-element.mjs +608 -1
- package/fesm2022/cloud-ide-element.mjs.map +1 -1
- package/index.d.ts +213 -5
- package/package.json +1 -1
|
@@ -10932,6 +10932,613 @@ var floatingContainerDynamic_directive = /*#__PURE__*/Object.freeze({
|
|
|
10932
10932
|
CideEleFloatingContainerDynamicDirective: CideEleFloatingContainerDynamicDirective
|
|
10933
10933
|
});
|
|
10934
10934
|
|
|
10935
|
+
class CideFormFieldErrorComponent {
|
|
10936
|
+
control;
|
|
10937
|
+
formGroup;
|
|
10938
|
+
fieldName = '';
|
|
10939
|
+
customMessages = {};
|
|
10940
|
+
// Map to store field labels for efficient lookup
|
|
10941
|
+
fieldLabelsMap = new Map();
|
|
10942
|
+
// Inject the element service
|
|
10943
|
+
elementService = inject(CideElementsService);
|
|
10944
|
+
// Signal to hold form errors
|
|
10945
|
+
formErrors = signal([], ...(ngDevMode ? [{ debugName: "formErrors" }] : []));
|
|
10946
|
+
ngOnInit() {
|
|
10947
|
+
if (this.isFormGroupMode()) {
|
|
10948
|
+
this.loadFormErrors();
|
|
10949
|
+
this.setupFormChangeListener();
|
|
10950
|
+
}
|
|
10951
|
+
}
|
|
10952
|
+
ngOnChanges(changes) {
|
|
10953
|
+
if (changes['formGroup'] && this.isFormGroupMode()) {
|
|
10954
|
+
this.loadFormErrors();
|
|
10955
|
+
this.setupFormChangeListener();
|
|
10956
|
+
}
|
|
10957
|
+
}
|
|
10958
|
+
setupFormChangeListener() {
|
|
10959
|
+
if (this.formGroup) {
|
|
10960
|
+
// Listen to form value changes to update errors
|
|
10961
|
+
this.formGroup.valueChanges.subscribe(() => {
|
|
10962
|
+
this.updateFormErrors();
|
|
10963
|
+
});
|
|
10964
|
+
// Listen to form status changes
|
|
10965
|
+
this.formGroup.statusChanges.subscribe(() => {
|
|
10966
|
+
this.updateFormErrors();
|
|
10967
|
+
});
|
|
10968
|
+
}
|
|
10969
|
+
}
|
|
10970
|
+
updateFormErrors() {
|
|
10971
|
+
if (this.isFormGroupMode()) {
|
|
10972
|
+
this.loadFormErrors();
|
|
10973
|
+
}
|
|
10974
|
+
}
|
|
10975
|
+
loadFormErrors() {
|
|
10976
|
+
this.getFormGroupErrors().then(errors => {
|
|
10977
|
+
this.formErrors.set(errors);
|
|
10978
|
+
});
|
|
10979
|
+
}
|
|
10980
|
+
isFormGroupMode() {
|
|
10981
|
+
return !!this.formGroup && !this.control;
|
|
10982
|
+
}
|
|
10983
|
+
getFormGroupErrors() {
|
|
10984
|
+
if (!this.formGroup)
|
|
10985
|
+
return Promise.resolve([]);
|
|
10986
|
+
return this.buildFieldLabelsMap().then(() => {
|
|
10987
|
+
const errors = [];
|
|
10988
|
+
console.log('🔍 Form Controls:', this.formGroup.controls);
|
|
10989
|
+
console.log('🏷️ Field Labels Map:', this.fieldLabelsMap);
|
|
10990
|
+
Object.keys(this.formGroup.controls).forEach(key => {
|
|
10991
|
+
const control = this.formGroup.get(key);
|
|
10992
|
+
console.log(`📝 Control ${key}:`, {
|
|
10993
|
+
invalid: control?.invalid,
|
|
10994
|
+
dirty: control?.dirty,
|
|
10995
|
+
touched: control?.touched,
|
|
10996
|
+
errors: control?.errors,
|
|
10997
|
+
value: control?.value
|
|
10998
|
+
});
|
|
10999
|
+
if (control && control.invalid) {
|
|
11000
|
+
const errorMessage = this.getControlErrorMessage(control, key);
|
|
11001
|
+
if (errorMessage) {
|
|
11002
|
+
errors.push(errorMessage);
|
|
11003
|
+
}
|
|
11004
|
+
}
|
|
11005
|
+
});
|
|
11006
|
+
console.log('❌ Final Errors:', errors);
|
|
11007
|
+
return errors;
|
|
11008
|
+
});
|
|
11009
|
+
}
|
|
11010
|
+
buildFieldLabelsMap() {
|
|
11011
|
+
if (this.fieldLabelsMap.size > 0)
|
|
11012
|
+
return Promise.resolve(); // Already built
|
|
11013
|
+
const promises = Object.keys(this.formGroup.controls).map(key => {
|
|
11014
|
+
console.log('🔍 Element Data:', key);
|
|
11015
|
+
return this.elementService?.getElementData({ sype_key: key }).then(elementData => {
|
|
11016
|
+
if (elementData?.sype_label) {
|
|
11017
|
+
this.fieldLabelsMap.set(key, elementData.sype_label);
|
|
11018
|
+
}
|
|
11019
|
+
}).catch(error => {
|
|
11020
|
+
console.log(`Could not get element data for field: ${key}`, error);
|
|
11021
|
+
});
|
|
11022
|
+
});
|
|
11023
|
+
return Promise.all(promises).then(() => {
|
|
11024
|
+
// All promises completed
|
|
11025
|
+
});
|
|
11026
|
+
}
|
|
11027
|
+
getFormGroupErrorMessage() {
|
|
11028
|
+
const errors = this.formErrors();
|
|
11029
|
+
if (errors.length === 0)
|
|
11030
|
+
return '';
|
|
11031
|
+
if (errors.length === 1) {
|
|
11032
|
+
return errors[0];
|
|
11033
|
+
}
|
|
11034
|
+
return `Please fix the following errors: ${errors.join(', ')}`;
|
|
11035
|
+
}
|
|
11036
|
+
getControlErrorMessage(control, fieldName) {
|
|
11037
|
+
if (!control || !control.errors) {
|
|
11038
|
+
return '';
|
|
11039
|
+
}
|
|
11040
|
+
const errors = control.errors;
|
|
11041
|
+
// Get display name from map first, fallback to conversion
|
|
11042
|
+
const displayName = this.fieldLabelsMap.get(fieldName) || this.convertToDisplayName(fieldName);
|
|
11043
|
+
// Check for custom messages first
|
|
11044
|
+
for (const errorType in errors) {
|
|
11045
|
+
if (this.customMessages[errorType]) {
|
|
11046
|
+
return this.customMessages[errorType];
|
|
11047
|
+
}
|
|
11048
|
+
}
|
|
11049
|
+
// Default error messages
|
|
11050
|
+
if (errors['required']) {
|
|
11051
|
+
return `${displayName} is required`;
|
|
11052
|
+
}
|
|
11053
|
+
if (errors['email']) {
|
|
11054
|
+
return `${displayName} must be a valid email address`;
|
|
11055
|
+
}
|
|
11056
|
+
if (errors['minlength']) {
|
|
11057
|
+
return `${displayName} must be at least ${errors['minlength'].requiredLength} characters`;
|
|
11058
|
+
}
|
|
11059
|
+
if (errors['maxlength']) {
|
|
11060
|
+
return `${displayName} must not exceed ${errors['maxlength'].requiredLength} characters`;
|
|
11061
|
+
}
|
|
11062
|
+
if (errors['pattern']) {
|
|
11063
|
+
return `${displayName} format is invalid`;
|
|
11064
|
+
}
|
|
11065
|
+
// Fallback to first error
|
|
11066
|
+
const firstError = Object.keys(errors)[0];
|
|
11067
|
+
return `${displayName} is invalid`;
|
|
11068
|
+
}
|
|
11069
|
+
getErrorMessage() {
|
|
11070
|
+
if (!this.control || !this.control.errors) {
|
|
11071
|
+
return '';
|
|
11072
|
+
}
|
|
11073
|
+
const errors = this.control.errors;
|
|
11074
|
+
// Check for custom messages first
|
|
11075
|
+
for (const errorType in errors) {
|
|
11076
|
+
if (this.customMessages[errorType]) {
|
|
11077
|
+
return this.customMessages[errorType];
|
|
11078
|
+
}
|
|
11079
|
+
}
|
|
11080
|
+
// Default error messages
|
|
11081
|
+
if (errors['required']) {
|
|
11082
|
+
return `${this.getFieldDisplayName()} is required`;
|
|
11083
|
+
}
|
|
11084
|
+
if (errors['email']) {
|
|
11085
|
+
return `${this.getFieldDisplayName()} must be a valid email address`;
|
|
11086
|
+
}
|
|
11087
|
+
if (errors['minlength']) {
|
|
11088
|
+
return `${this.getFieldDisplayName()} must be at least ${errors['minlength'].requiredLength} characters`;
|
|
11089
|
+
}
|
|
11090
|
+
if (errors['maxlength']) {
|
|
11091
|
+
return `${this.getFieldDisplayName()} must not exceed ${errors['maxlength'].requiredLength} characters`;
|
|
11092
|
+
}
|
|
11093
|
+
if (errors['pattern']) {
|
|
11094
|
+
return `${this.getFieldDisplayName()} format is invalid`;
|
|
11095
|
+
}
|
|
11096
|
+
// Fallback to first error
|
|
11097
|
+
const firstError = Object.keys(errors)[0];
|
|
11098
|
+
return `${this.getFieldDisplayName()} is invalid`;
|
|
11099
|
+
}
|
|
11100
|
+
getFieldDisplayName() {
|
|
11101
|
+
if (this.fieldName) {
|
|
11102
|
+
return this.fieldName;
|
|
11103
|
+
}
|
|
11104
|
+
// Convert field name to display name
|
|
11105
|
+
if (this.control && this.control.parent) {
|
|
11106
|
+
const fieldName = Object.keys(this.control.parent.controls).find(key => this.control.parent.get(key) === this.control);
|
|
11107
|
+
if (fieldName) {
|
|
11108
|
+
return this.convertToDisplayName(fieldName);
|
|
11109
|
+
}
|
|
11110
|
+
}
|
|
11111
|
+
return 'This field';
|
|
11112
|
+
}
|
|
11113
|
+
convertToDisplayName(fieldName) {
|
|
11114
|
+
// Convert snake_case to Title Case
|
|
11115
|
+
return fieldName
|
|
11116
|
+
.split('_')
|
|
11117
|
+
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
|
|
11118
|
+
.join(' ');
|
|
11119
|
+
}
|
|
11120
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideFormFieldErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11121
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: CideFormFieldErrorComponent, isStandalone: true, selector: "cide-form-field-error", inputs: { control: "control", formGroup: "formGroup", fieldName: "fieldName", customMessages: "customMessages" }, usesOnChanges: true, ngImport: i0, template: `
|
|
11122
|
+
@if (isFormGroupMode()) {
|
|
11123
|
+
<!-- Form Group Error Display -->
|
|
11124
|
+
@if (formErrors().length > 0) {
|
|
11125
|
+
<div class="tw-flex tw-items-center tw-gap-2 tw-text-red-600 tw-text-sm">
|
|
11126
|
+
<cide-ele-icon class="tw-text-red-500">error</cide-ele-icon>
|
|
11127
|
+
<span>{{ getFormGroupErrorMessage() }}</span>
|
|
11128
|
+
</div>
|
|
11129
|
+
}
|
|
11130
|
+
} @else {
|
|
11131
|
+
<!-- Individual Field Error Display -->
|
|
11132
|
+
@if (control && control.invalid && (control.dirty || control.touched)) {
|
|
11133
|
+
<div class="tw-text-red-500 tw-text-xs tw-mt-1 tw-flex tw-items-center tw-gap-1">
|
|
11134
|
+
<cide-ele-icon class="tw-text-xs">error</cide-ele-icon>
|
|
11135
|
+
<span>{{ getErrorMessage() }}</span>
|
|
11136
|
+
</div>
|
|
11137
|
+
}
|
|
11138
|
+
}
|
|
11139
|
+
`, isInline: true, dependencies: [{ kind: "component", type: CideIconComponent, selector: "cide-ele-icon", inputs: ["size", "type", "toolTip"] }] });
|
|
11140
|
+
}
|
|
11141
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideFormFieldErrorComponent, decorators: [{
|
|
11142
|
+
type: Component,
|
|
11143
|
+
args: [{
|
|
11144
|
+
selector: 'cide-form-field-error',
|
|
11145
|
+
standalone: true,
|
|
11146
|
+
template: `
|
|
11147
|
+
@if (isFormGroupMode()) {
|
|
11148
|
+
<!-- Form Group Error Display -->
|
|
11149
|
+
@if (formErrors().length > 0) {
|
|
11150
|
+
<div class="tw-flex tw-items-center tw-gap-2 tw-text-red-600 tw-text-sm">
|
|
11151
|
+
<cide-ele-icon class="tw-text-red-500">error</cide-ele-icon>
|
|
11152
|
+
<span>{{ getFormGroupErrorMessage() }}</span>
|
|
11153
|
+
</div>
|
|
11154
|
+
}
|
|
11155
|
+
} @else {
|
|
11156
|
+
<!-- Individual Field Error Display -->
|
|
11157
|
+
@if (control && control.invalid && (control.dirty || control.touched)) {
|
|
11158
|
+
<div class="tw-text-red-500 tw-text-xs tw-mt-1 tw-flex tw-items-center tw-gap-1">
|
|
11159
|
+
<cide-ele-icon class="tw-text-xs">error</cide-ele-icon>
|
|
11160
|
+
<span>{{ getErrorMessage() }}</span>
|
|
11161
|
+
</div>
|
|
11162
|
+
}
|
|
11163
|
+
}
|
|
11164
|
+
`,
|
|
11165
|
+
imports: [CideIconComponent]
|
|
11166
|
+
}]
|
|
11167
|
+
}], propDecorators: { control: [{
|
|
11168
|
+
type: Input
|
|
11169
|
+
}], formGroup: [{
|
|
11170
|
+
type: Input
|
|
11171
|
+
}], fieldName: [{
|
|
11172
|
+
type: Input
|
|
11173
|
+
}], customMessages: [{
|
|
11174
|
+
type: Input
|
|
11175
|
+
}] } });
|
|
11176
|
+
|
|
11177
|
+
class CideEleBreadcrumbComponent {
|
|
11178
|
+
// Input properties
|
|
11179
|
+
items = [];
|
|
11180
|
+
style = 'modern';
|
|
11181
|
+
separator = { type: 'chevron' };
|
|
11182
|
+
showHomeIcon = true;
|
|
11183
|
+
homeIcon = 'home';
|
|
11184
|
+
maxItems = 5;
|
|
11185
|
+
showDropdownOnOverflow = true;
|
|
11186
|
+
dropdownOptions = [];
|
|
11187
|
+
clickableItems = true;
|
|
11188
|
+
showTooltips = true;
|
|
11189
|
+
responsive = true;
|
|
11190
|
+
compact = false;
|
|
11191
|
+
animated = true;
|
|
11192
|
+
loading = false;
|
|
11193
|
+
disabled = false;
|
|
11194
|
+
// Output events
|
|
11195
|
+
itemClick = new EventEmitter();
|
|
11196
|
+
dropdownOptionClick = new EventEmitter();
|
|
11197
|
+
homeClick = new EventEmitter();
|
|
11198
|
+
// Internal state
|
|
11199
|
+
showDropdown = signal(false, ...(ngDevMode ? [{ debugName: "showDropdown" }] : []));
|
|
11200
|
+
isOverflowing = signal(false, ...(ngDevMode ? [{ debugName: "isOverflowing" }] : []));
|
|
11201
|
+
visibleItems = signal([], ...(ngDevMode ? [{ debugName: "visibleItems" }] : []));
|
|
11202
|
+
hiddenItems = signal([], ...(ngDevMode ? [{ debugName: "hiddenItems" }] : []));
|
|
11203
|
+
// Computed properties
|
|
11204
|
+
showDropdownSignal = computed(() => this.showDropdown(), ...(ngDevMode ? [{ debugName: "showDropdownSignal" }] : []));
|
|
11205
|
+
isOverflowingSignal = computed(() => this.isOverflowing(), ...(ngDevMode ? [{ debugName: "isOverflowingSignal" }] : []));
|
|
11206
|
+
visibleItemsSignal = computed(() => this.visibleItems(), ...(ngDevMode ? [{ debugName: "visibleItemsSignal" }] : []));
|
|
11207
|
+
hiddenItemsSignal = computed(() => this.hiddenItems(), ...(ngDevMode ? [{ debugName: "hiddenItemsSignal" }] : []));
|
|
11208
|
+
// Configuration based on style
|
|
11209
|
+
config = computed(() => this.getConfigForStyle(this.style), ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
11210
|
+
ngOnInit() {
|
|
11211
|
+
this.processItems();
|
|
11212
|
+
}
|
|
11213
|
+
ngOnDestroy() {
|
|
11214
|
+
// Cleanup if needed
|
|
11215
|
+
}
|
|
11216
|
+
onDocumentClick(event) {
|
|
11217
|
+
const target = event.target;
|
|
11218
|
+
if (!target.closest('.breadcrumb-dropdown-container')) {
|
|
11219
|
+
this.showDropdown.set(false);
|
|
11220
|
+
}
|
|
11221
|
+
}
|
|
11222
|
+
// Process items based on maxItems and overflow
|
|
11223
|
+
processItems() {
|
|
11224
|
+
if (this.items.length <= this.maxItems) {
|
|
11225
|
+
this.visibleItems.set([...this.items]);
|
|
11226
|
+
this.hiddenItems.set([]);
|
|
11227
|
+
this.isOverflowing.set(false);
|
|
11228
|
+
}
|
|
11229
|
+
else {
|
|
11230
|
+
const visibleCount = this.showDropdownOnOverflow ? this.maxItems - 1 : this.maxItems;
|
|
11231
|
+
this.visibleItems.set(this.items.slice(0, visibleCount));
|
|
11232
|
+
this.hiddenItems.set(this.items.slice(visibleCount));
|
|
11233
|
+
this.isOverflowing.set(true);
|
|
11234
|
+
}
|
|
11235
|
+
}
|
|
11236
|
+
// Get configuration based on style
|
|
11237
|
+
getConfigForStyle(style) {
|
|
11238
|
+
const configs = {
|
|
11239
|
+
modern: {
|
|
11240
|
+
style: 'modern',
|
|
11241
|
+
separator: { type: 'chevron' },
|
|
11242
|
+
showHomeIcon: true,
|
|
11243
|
+
homeIcon: 'home',
|
|
11244
|
+
maxItems: 5,
|
|
11245
|
+
showDropdownOnOverflow: true,
|
|
11246
|
+
dropdownOptions: [],
|
|
11247
|
+
clickableItems: true,
|
|
11248
|
+
showTooltips: true,
|
|
11249
|
+
responsive: true,
|
|
11250
|
+
compact: false,
|
|
11251
|
+
animated: true
|
|
11252
|
+
},
|
|
11253
|
+
classic: {
|
|
11254
|
+
style: 'classic',
|
|
11255
|
+
separator: { type: 'slash' },
|
|
11256
|
+
showHomeIcon: false,
|
|
11257
|
+
homeIcon: 'home',
|
|
11258
|
+
maxItems: 8,
|
|
11259
|
+
showDropdownOnOverflow: false,
|
|
11260
|
+
dropdownOptions: [],
|
|
11261
|
+
clickableItems: true,
|
|
11262
|
+
showTooltips: false,
|
|
11263
|
+
responsive: false,
|
|
11264
|
+
compact: true,
|
|
11265
|
+
animated: false
|
|
11266
|
+
},
|
|
11267
|
+
minimal: {
|
|
11268
|
+
style: 'minimal',
|
|
11269
|
+
separator: { type: 'dot' },
|
|
11270
|
+
showHomeIcon: false,
|
|
11271
|
+
homeIcon: 'home',
|
|
11272
|
+
maxItems: 3,
|
|
11273
|
+
showDropdownOnOverflow: true,
|
|
11274
|
+
dropdownOptions: [],
|
|
11275
|
+
clickableItems: false,
|
|
11276
|
+
showTooltips: true,
|
|
11277
|
+
responsive: true,
|
|
11278
|
+
compact: true,
|
|
11279
|
+
animated: false
|
|
11280
|
+
},
|
|
11281
|
+
hierarchical: {
|
|
11282
|
+
style: 'hierarchical',
|
|
11283
|
+
separator: { type: 'chevron' },
|
|
11284
|
+
showHomeIcon: true,
|
|
11285
|
+
homeIcon: 'home',
|
|
11286
|
+
maxItems: 4,
|
|
11287
|
+
showDropdownOnOverflow: true,
|
|
11288
|
+
dropdownOptions: [],
|
|
11289
|
+
clickableItems: true,
|
|
11290
|
+
showTooltips: false,
|
|
11291
|
+
responsive: true,
|
|
11292
|
+
compact: true,
|
|
11293
|
+
animated: false
|
|
11294
|
+
}
|
|
11295
|
+
};
|
|
11296
|
+
return configs[style];
|
|
11297
|
+
}
|
|
11298
|
+
// Event handlers
|
|
11299
|
+
onItemClick(item) {
|
|
11300
|
+
if (!item.disabled && this.clickableItems && !this.disabled) {
|
|
11301
|
+
this.itemClick.emit(item);
|
|
11302
|
+
}
|
|
11303
|
+
}
|
|
11304
|
+
onHomeClick() {
|
|
11305
|
+
if (!this.disabled) {
|
|
11306
|
+
this.homeClick.emit();
|
|
11307
|
+
}
|
|
11308
|
+
}
|
|
11309
|
+
onDropdownToggle() {
|
|
11310
|
+
if (!this.disabled) {
|
|
11311
|
+
this.showDropdown.set(!this.showDropdown());
|
|
11312
|
+
}
|
|
11313
|
+
}
|
|
11314
|
+
onDropdownOptionClick(option) {
|
|
11315
|
+
if (!option.disabled && !this.disabled) {
|
|
11316
|
+
this.dropdownOptionClick.emit(option);
|
|
11317
|
+
this.showDropdown.set(false);
|
|
11318
|
+
}
|
|
11319
|
+
}
|
|
11320
|
+
// Utility methods
|
|
11321
|
+
getItemClasses(item, isLast = false) {
|
|
11322
|
+
const classes = ['breadcrumb-item'];
|
|
11323
|
+
if (this.config().compact)
|
|
11324
|
+
classes.push('compact');
|
|
11325
|
+
if (this.config().animated)
|
|
11326
|
+
classes.push('animated');
|
|
11327
|
+
if (item.disabled)
|
|
11328
|
+
classes.push('disabled');
|
|
11329
|
+
if (isLast)
|
|
11330
|
+
classes.push('last');
|
|
11331
|
+
if (this.clickableItems && !item.disabled)
|
|
11332
|
+
classes.push('clickable');
|
|
11333
|
+
return classes.join(' ');
|
|
11334
|
+
}
|
|
11335
|
+
getContainerClasses() {
|
|
11336
|
+
const classes = ['breadcrumb-container'];
|
|
11337
|
+
classes.push(`style-${this.style}`);
|
|
11338
|
+
if (this.config().compact)
|
|
11339
|
+
classes.push('compact');
|
|
11340
|
+
if (this.config().responsive)
|
|
11341
|
+
classes.push('responsive');
|
|
11342
|
+
if (this.config().animated)
|
|
11343
|
+
classes.push('animated');
|
|
11344
|
+
if (this.loading)
|
|
11345
|
+
classes.push('loading');
|
|
11346
|
+
if (this.disabled)
|
|
11347
|
+
classes.push('disabled');
|
|
11348
|
+
return classes.join(' ');
|
|
11349
|
+
}
|
|
11350
|
+
getSeparatorIcon() {
|
|
11351
|
+
const separatorMap = {
|
|
11352
|
+
'chevron': 'chevron_right',
|
|
11353
|
+
'slash': 'keyboard_arrow_right',
|
|
11354
|
+
'arrow': 'arrow_forward',
|
|
11355
|
+
'dot': 'fiber_manual_record'
|
|
11356
|
+
};
|
|
11357
|
+
return separatorMap[this.separator.type] || 'chevron_right';
|
|
11358
|
+
}
|
|
11359
|
+
getTooltipText(item) {
|
|
11360
|
+
if (!this.showTooltips)
|
|
11361
|
+
return '';
|
|
11362
|
+
let tooltip = item.label;
|
|
11363
|
+
if (item.type) {
|
|
11364
|
+
tooltip += ` (${item.type})`;
|
|
11365
|
+
}
|
|
11366
|
+
if (item.url) {
|
|
11367
|
+
tooltip += ` - ${item.url}`;
|
|
11368
|
+
}
|
|
11369
|
+
return tooltip;
|
|
11370
|
+
}
|
|
11371
|
+
// Public methods for external control
|
|
11372
|
+
toggleDropdown() {
|
|
11373
|
+
this.onDropdownToggle();
|
|
11374
|
+
}
|
|
11375
|
+
closeDropdown() {
|
|
11376
|
+
this.showDropdown.set(false);
|
|
11377
|
+
}
|
|
11378
|
+
updateItems(newItems) {
|
|
11379
|
+
this.items = newItems;
|
|
11380
|
+
this.processItems();
|
|
11381
|
+
}
|
|
11382
|
+
addItem(item) {
|
|
11383
|
+
this.items.push(item);
|
|
11384
|
+
this.processItems();
|
|
11385
|
+
}
|
|
11386
|
+
removeItem(itemId) {
|
|
11387
|
+
this.items = this.items.filter(item => item.id !== itemId);
|
|
11388
|
+
this.processItems();
|
|
11389
|
+
}
|
|
11390
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideEleBreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11391
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: CideEleBreadcrumbComponent, isStandalone: true, selector: "cide-ele-breadcrumb", inputs: { items: "items", style: "style", separator: "separator", showHomeIcon: "showHomeIcon", homeIcon: "homeIcon", maxItems: "maxItems", showDropdownOnOverflow: "showDropdownOnOverflow", dropdownOptions: "dropdownOptions", clickableItems: "clickableItems", showTooltips: "showTooltips", responsive: "responsive", compact: "compact", animated: "animated", loading: "loading", disabled: "disabled" }, outputs: { itemClick: "itemClick", dropdownOptionClick: "dropdownOptionClick", homeClick: "homeClick" }, host: { listeners: { "document:click": "onDocumentClick($event)" } }, ngImport: i0, template: "<!-- Breadcrumb Component Template -->\n<div [class]=\"getContainerClasses()\" class=\"tw-flex tw-items-center tw-text-xs tw-text-gray-700 tw-py-0\">\n \n <!-- Loading State -->\n @if (loading) {\n <div class=\"breadcrumb-loading\">\n <cide-ele-icon class=\"animate-spin\">refresh</cide-ele-icon>\n <span>Loading...</span>\n </div>\n }\n\n <!-- Main Breadcrumb Content -->\n @if (!loading) {\n <nav class=\"tw-flex tw-items-center tw-min-w-0 tw-flex-1\" role=\"navigation\" aria-label=\"Breadcrumb\">\n <ol class=\"tw-flex tw-items-center tw-list-none tw-m-0 tw-p-0 tw-gap-1 tw-flex-wrap\">\n \n <!-- Home Icon (if enabled) -->\n @if (config().showHomeIcon) {\n <li class=\"tw-flex tw-items-center tw-gap-1 tw-px-1 tw-whitespace-nowrap tw-relative\" \n [class.tw-cursor-pointer]=\"clickableItems && !disabled\"\n (click)=\"onHomeClick()\"\n [title]=\"showTooltips ? 'Go to Home' : ''\">\n <cide-ele-icon class=\"tw-text-gray-500 tw-text-xs\">\n {{ config().homeIcon }}\n </cide-ele-icon>\n </li>\n \n <!-- Separator after home -->\n @if (visibleItemsSignal().length > 0) {\n <li class=\"tw-flex tw-items-center tw-text-gray-300 tw-mx-0.5\">\n @if (separator.type === 'custom' && separator.text) {\n <span class=\"tw-font-normal tw-text-gray-400\">{{ separator.text }}</span>\n } @else {\n <cide-ele-icon class=\"tw-text-xs\">\n {{ getSeparatorIcon() }}\n </cide-ele-icon>\n }\n </li>\n }\n }\n\n <!-- Visible Items -->\n @for (item of visibleItemsSignal(); track item.id; let i = $index; let isLast = $last) {\n <li class=\"tw-flex tw-items-center tw-gap-1 tw-px-1 tw-whitespace-nowrap tw-relative\"\n [class.tw-cursor-pointer]=\"clickableItems && !disabled\"\n [class.tw-text-gray-400]=\"isLast\"\n (click)=\"onItemClick(item)\"\n [title]=\"getTooltipText(item)\"\n [attr.aria-current]=\"isLast ? 'page' : null\">\n \n <!-- Item Icon (if provided) -->\n @if (item.icon) {\n <cide-ele-icon class=\"tw-text-gray-500 tw-text-xs tw-flex-shrink-0\">\n {{ item.icon }}\n </cide-ele-icon>\n }\n \n <!-- Item Label -->\n <span class=\"tw-font-medium tw-text-xs\">\n {{ item.label }}\n </span>\n \n <!-- Item Type Badge (for hierarchical style) -->\n @if (style === 'hierarchical' && item.type && item.type !== 'root') {\n <span class=\"item-type-badge\" [class]=\"'type-' + item.type\">\n {{ item.type }}\n </span>\n }\n </li>\n\n <!-- Separator (except for last item) -->\n @if (!isLast || isOverflowingSignal()) {\n <li class=\"tw-flex tw-items-center tw-text-gray-300 tw-mx-0.5\">\n @if (separator.type === 'custom' && separator.text) {\n <span class=\"tw-font-normal tw-text-gray-400\">{{ separator.text }}</span>\n } @else {\n <cide-ele-icon class=\"tw-text-xs\">\n {{ getSeparatorIcon() }}\n </cide-ele-icon>\n }\n </li>\n }\n }\n\n <!-- Overflow Dropdown -->\n @if (isOverflowingSignal() && showDropdownOnOverflow) {\n <li class=\"breadcrumb-item overflow-item\">\n <div class=\"breadcrumb-dropdown-container\">\n <button type=\"button\" \n class=\"overflow-button\"\n (click)=\"onDropdownToggle()\"\n [disabled]=\"disabled\"\n [attr.aria-expanded]=\"showDropdownSignal()\"\n aria-haspopup=\"true\"\n [title]=\"showTooltips ? 'More items' : ''\">\n <cide-ele-icon class=\"overflow-icon\">more_horiz</cide-ele-icon>\n <span class=\"overflow-text\" [class.compact]=\"config().compact\">\n {{ hiddenItemsSignal().length }}+ more\n </span>\n </button>\n \n <!-- Dropdown Menu -->\n @if (showDropdownSignal()) {\n <div class=\"breadcrumb-dropdown\" role=\"menu\">\n <div class=\"dropdown-header\">\n <span>Hidden Items</span>\n </div>\n \n <!-- Hidden Items -->\n @for (item of hiddenItemsSignal(); track item.id) {\n <button type=\"button\" \n class=\"dropdown-item\"\n (click)=\"onItemClick(item)\"\n [disabled]=\"item.disabled || disabled\"\n role=\"menuitem\">\n @if (item.icon) {\n <cide-ele-icon class=\"dropdown-item-icon\">{{ item.icon }}</cide-ele-icon>\n }\n <span class=\"dropdown-item-label\">{{ item.label }}</span>\n </button>\n }\n \n <!-- Custom Dropdown Options -->\n @if (dropdownOptions.length > 0) {\n <div class=\"dropdown-divider\"></div>\n @for (option of dropdownOptions; track option.id) {\n <button type=\"button\" \n class=\"dropdown-option\"\n (click)=\"onDropdownOptionClick(option)\"\n [disabled]=\"option.disabled || disabled\"\n role=\"menuitem\">\n @if (option.icon) {\n <cide-ele-icon class=\"dropdown-option-icon\">{{ option.icon }}</cide-ele-icon>\n }\n <span class=\"dropdown-option-label\">{{ option.label }}</span>\n </button>\n }\n }\n </div>\n }\n </div>\n </li>\n }\n </ol>\n </nav>\n }\n\n</div>\n", styles: [".breadcrumb-container{display:flex;align-items:center;width:100%;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:12px;line-height:1.3;color:#374151;background:transparent;padding:2px 0}.breadcrumb-container.loading{opacity:.6;pointer-events:none}.breadcrumb-container.disabled{opacity:.5;pointer-events:none}@media (max-width: 768px){.breadcrumb-container.responsive{font-size:10px;padding:3px 0}}.breadcrumb-container.compact{font-size:10px;padding:1px 0}.breadcrumb-container.animated .breadcrumb-item{transition:color .15s ease}.breadcrumb-loading{display:flex;align-items:center;gap:8px;padding:12px 16px;color:#6b7280;font-size:14px}.breadcrumb-loading cide-ele-icon{animation:spin 1s linear infinite}.breadcrumb-nav{flex:1;min-width:0}.breadcrumb-list{display:flex;align-items:center;list-style:none;margin:0;padding:0;gap:4px;flex-wrap:wrap}.breadcrumb-item{display:flex;align-items:center;gap:2px;padding:0 2px;position:relative;white-space:nowrap}.breadcrumb-item.clickable{cursor:pointer}.breadcrumb-item.clickable:hover{color:#1f2937}.breadcrumb-item.disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.breadcrumb-item.last{color:#9ca3af}.breadcrumb-item.home-item{padding:0 1px}.breadcrumb-item.home-item .home-icon{color:#6b7280;font-size:13px}.breadcrumb-item.overflow-item{position:relative}.item-label{font-weight:500;color:inherit}.item-label.compact{font-weight:600}.item-icon{color:#6b7280;flex-shrink:0}.item-type-badge{padding:2px 6px;border-radius:4px;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.5px}.item-type-badge.type-category{background-color:#dbeafe;color:#1e40af}.item-type-badge.type-entity{background-color:#dcfce7;color:#166534}.item-type-badge.type-custom{background-color:#f3e8ff;color:#7c3aed}.breadcrumb-separator{display:flex;align-items:center;color:#d1d5db;margin:0 .5px}.breadcrumb-separator .separator-icon{font-size:11px}.breadcrumb-separator .custom-separator{font-weight:400;color:#9ca3af}.breadcrumb-dropdown-container{position:relative}.overflow-button{display:flex;align-items:center;gap:2px;padding:2px 4px;border:none;background:transparent;cursor:pointer;transition:color .15s ease;color:#6b7280}.overflow-button:hover{color:#374151}.overflow-button:disabled{opacity:.5;cursor:not-allowed}.overflow-icon{font-size:14px}.overflow-text{font-size:11px;font-weight:400}.breadcrumb-dropdown{position:absolute;top:100%;left:0;margin-top:4px;background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d;z-index:1000;min-width:200px;max-width:300px;overflow:hidden;animation:dropdownSlideIn .2s ease-out}.dropdown-header{padding:8px 12px;background:#f9fafb;border-bottom:1px solid #e5e7eb;font-size:12px;font-weight:600;color:#6b7280;text-transform:uppercase;letter-spacing:.5px}.dropdown-item,.dropdown-option{display:flex;align-items:center;gap:8px;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;transition:background-color .15s ease;color:#374151}.dropdown-item:hover,.dropdown-option:hover{background:#f3f4f6}.dropdown-item:disabled,.dropdown-option:disabled{opacity:.5;cursor:not-allowed}.dropdown-item-icon,.dropdown-option-icon{font-size:14px;color:#6b7280;flex-shrink:0}.dropdown-item-label,.dropdown-option-label{font-size:14px;font-weight:500}.dropdown-divider{height:1px;background:#e5e7eb;margin:4px 0}.style-modern .breadcrumb-item.clickable:hover{color:#1f2937}.style-modern .separator-icon{color:#d1d5db}.style-classic .breadcrumb-item{padding:2px 4px}.style-classic .breadcrumb-item.clickable:hover{color:#1f2937}.style-classic .separator-icon{color:#9ca3af;font-size:12px}.style-minimal .breadcrumb-item{padding:1px 2px}.style-minimal .breadcrumb-item.clickable:hover{color:#1f2937}.style-minimal .separator-icon{color:#d1d5db;font-size:10px}.style-hierarchical{background:transparent;border:none;padding:2px 0}.style-hierarchical .breadcrumb-item{padding:0 2px}.style-hierarchical .breadcrumb-item.clickable:hover{color:#1f2937}.style-hierarchical .separator-icon{color:#d1d5db}.style-hierarchical .breadcrumb-actions{display:none}@keyframes dropdownSlideIn{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.breadcrumb-container.animated .breadcrumb-item{transition:none}.breadcrumb-container.animated .breadcrumb-item:hover{transform:none}.breadcrumb-dropdown{animation:none}}@media (prefers-contrast: high){.breadcrumb-container .breadcrumb-item{border:1px solid transparent}.breadcrumb-container .breadcrumb-item.clickable:hover{border-color:#000}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: CideIconComponent, selector: "cide-ele-icon", inputs: ["size", "type", "toolTip"] }] });
|
|
11392
|
+
}
|
|
11393
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideEleBreadcrumbComponent, decorators: [{
|
|
11394
|
+
type: Component,
|
|
11395
|
+
args: [{ selector: 'cide-ele-breadcrumb', standalone: true, imports: [CommonModule, CideIconComponent], template: "<!-- Breadcrumb Component Template -->\n<div [class]=\"getContainerClasses()\" class=\"tw-flex tw-items-center tw-text-xs tw-text-gray-700 tw-py-0\">\n \n <!-- Loading State -->\n @if (loading) {\n <div class=\"breadcrumb-loading\">\n <cide-ele-icon class=\"animate-spin\">refresh</cide-ele-icon>\n <span>Loading...</span>\n </div>\n }\n\n <!-- Main Breadcrumb Content -->\n @if (!loading) {\n <nav class=\"tw-flex tw-items-center tw-min-w-0 tw-flex-1\" role=\"navigation\" aria-label=\"Breadcrumb\">\n <ol class=\"tw-flex tw-items-center tw-list-none tw-m-0 tw-p-0 tw-gap-1 tw-flex-wrap\">\n \n <!-- Home Icon (if enabled) -->\n @if (config().showHomeIcon) {\n <li class=\"tw-flex tw-items-center tw-gap-1 tw-px-1 tw-whitespace-nowrap tw-relative\" \n [class.tw-cursor-pointer]=\"clickableItems && !disabled\"\n (click)=\"onHomeClick()\"\n [title]=\"showTooltips ? 'Go to Home' : ''\">\n <cide-ele-icon class=\"tw-text-gray-500 tw-text-xs\">\n {{ config().homeIcon }}\n </cide-ele-icon>\n </li>\n \n <!-- Separator after home -->\n @if (visibleItemsSignal().length > 0) {\n <li class=\"tw-flex tw-items-center tw-text-gray-300 tw-mx-0.5\">\n @if (separator.type === 'custom' && separator.text) {\n <span class=\"tw-font-normal tw-text-gray-400\">{{ separator.text }}</span>\n } @else {\n <cide-ele-icon class=\"tw-text-xs\">\n {{ getSeparatorIcon() }}\n </cide-ele-icon>\n }\n </li>\n }\n }\n\n <!-- Visible Items -->\n @for (item of visibleItemsSignal(); track item.id; let i = $index; let isLast = $last) {\n <li class=\"tw-flex tw-items-center tw-gap-1 tw-px-1 tw-whitespace-nowrap tw-relative\"\n [class.tw-cursor-pointer]=\"clickableItems && !disabled\"\n [class.tw-text-gray-400]=\"isLast\"\n (click)=\"onItemClick(item)\"\n [title]=\"getTooltipText(item)\"\n [attr.aria-current]=\"isLast ? 'page' : null\">\n \n <!-- Item Icon (if provided) -->\n @if (item.icon) {\n <cide-ele-icon class=\"tw-text-gray-500 tw-text-xs tw-flex-shrink-0\">\n {{ item.icon }}\n </cide-ele-icon>\n }\n \n <!-- Item Label -->\n <span class=\"tw-font-medium tw-text-xs\">\n {{ item.label }}\n </span>\n \n <!-- Item Type Badge (for hierarchical style) -->\n @if (style === 'hierarchical' && item.type && item.type !== 'root') {\n <span class=\"item-type-badge\" [class]=\"'type-' + item.type\">\n {{ item.type }}\n </span>\n }\n </li>\n\n <!-- Separator (except for last item) -->\n @if (!isLast || isOverflowingSignal()) {\n <li class=\"tw-flex tw-items-center tw-text-gray-300 tw-mx-0.5\">\n @if (separator.type === 'custom' && separator.text) {\n <span class=\"tw-font-normal tw-text-gray-400\">{{ separator.text }}</span>\n } @else {\n <cide-ele-icon class=\"tw-text-xs\">\n {{ getSeparatorIcon() }}\n </cide-ele-icon>\n }\n </li>\n }\n }\n\n <!-- Overflow Dropdown -->\n @if (isOverflowingSignal() && showDropdownOnOverflow) {\n <li class=\"breadcrumb-item overflow-item\">\n <div class=\"breadcrumb-dropdown-container\">\n <button type=\"button\" \n class=\"overflow-button\"\n (click)=\"onDropdownToggle()\"\n [disabled]=\"disabled\"\n [attr.aria-expanded]=\"showDropdownSignal()\"\n aria-haspopup=\"true\"\n [title]=\"showTooltips ? 'More items' : ''\">\n <cide-ele-icon class=\"overflow-icon\">more_horiz</cide-ele-icon>\n <span class=\"overflow-text\" [class.compact]=\"config().compact\">\n {{ hiddenItemsSignal().length }}+ more\n </span>\n </button>\n \n <!-- Dropdown Menu -->\n @if (showDropdownSignal()) {\n <div class=\"breadcrumb-dropdown\" role=\"menu\">\n <div class=\"dropdown-header\">\n <span>Hidden Items</span>\n </div>\n \n <!-- Hidden Items -->\n @for (item of hiddenItemsSignal(); track item.id) {\n <button type=\"button\" \n class=\"dropdown-item\"\n (click)=\"onItemClick(item)\"\n [disabled]=\"item.disabled || disabled\"\n role=\"menuitem\">\n @if (item.icon) {\n <cide-ele-icon class=\"dropdown-item-icon\">{{ item.icon }}</cide-ele-icon>\n }\n <span class=\"dropdown-item-label\">{{ item.label }}</span>\n </button>\n }\n \n <!-- Custom Dropdown Options -->\n @if (dropdownOptions.length > 0) {\n <div class=\"dropdown-divider\"></div>\n @for (option of dropdownOptions; track option.id) {\n <button type=\"button\" \n class=\"dropdown-option\"\n (click)=\"onDropdownOptionClick(option)\"\n [disabled]=\"option.disabled || disabled\"\n role=\"menuitem\">\n @if (option.icon) {\n <cide-ele-icon class=\"dropdown-option-icon\">{{ option.icon }}</cide-ele-icon>\n }\n <span class=\"dropdown-option-label\">{{ option.label }}</span>\n </button>\n }\n }\n </div>\n }\n </div>\n </li>\n }\n </ol>\n </nav>\n }\n\n</div>\n", styles: [".breadcrumb-container{display:flex;align-items:center;width:100%;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:12px;line-height:1.3;color:#374151;background:transparent;padding:2px 0}.breadcrumb-container.loading{opacity:.6;pointer-events:none}.breadcrumb-container.disabled{opacity:.5;pointer-events:none}@media (max-width: 768px){.breadcrumb-container.responsive{font-size:10px;padding:3px 0}}.breadcrumb-container.compact{font-size:10px;padding:1px 0}.breadcrumb-container.animated .breadcrumb-item{transition:color .15s ease}.breadcrumb-loading{display:flex;align-items:center;gap:8px;padding:12px 16px;color:#6b7280;font-size:14px}.breadcrumb-loading cide-ele-icon{animation:spin 1s linear infinite}.breadcrumb-nav{flex:1;min-width:0}.breadcrumb-list{display:flex;align-items:center;list-style:none;margin:0;padding:0;gap:4px;flex-wrap:wrap}.breadcrumb-item{display:flex;align-items:center;gap:2px;padding:0 2px;position:relative;white-space:nowrap}.breadcrumb-item.clickable{cursor:pointer}.breadcrumb-item.clickable:hover{color:#1f2937}.breadcrumb-item.disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.breadcrumb-item.last{color:#9ca3af}.breadcrumb-item.home-item{padding:0 1px}.breadcrumb-item.home-item .home-icon{color:#6b7280;font-size:13px}.breadcrumb-item.overflow-item{position:relative}.item-label{font-weight:500;color:inherit}.item-label.compact{font-weight:600}.item-icon{color:#6b7280;flex-shrink:0}.item-type-badge{padding:2px 6px;border-radius:4px;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.5px}.item-type-badge.type-category{background-color:#dbeafe;color:#1e40af}.item-type-badge.type-entity{background-color:#dcfce7;color:#166534}.item-type-badge.type-custom{background-color:#f3e8ff;color:#7c3aed}.breadcrumb-separator{display:flex;align-items:center;color:#d1d5db;margin:0 .5px}.breadcrumb-separator .separator-icon{font-size:11px}.breadcrumb-separator .custom-separator{font-weight:400;color:#9ca3af}.breadcrumb-dropdown-container{position:relative}.overflow-button{display:flex;align-items:center;gap:2px;padding:2px 4px;border:none;background:transparent;cursor:pointer;transition:color .15s ease;color:#6b7280}.overflow-button:hover{color:#374151}.overflow-button:disabled{opacity:.5;cursor:not-allowed}.overflow-icon{font-size:14px}.overflow-text{font-size:11px;font-weight:400}.breadcrumb-dropdown{position:absolute;top:100%;left:0;margin-top:4px;background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d;z-index:1000;min-width:200px;max-width:300px;overflow:hidden;animation:dropdownSlideIn .2s ease-out}.dropdown-header{padding:8px 12px;background:#f9fafb;border-bottom:1px solid #e5e7eb;font-size:12px;font-weight:600;color:#6b7280;text-transform:uppercase;letter-spacing:.5px}.dropdown-item,.dropdown-option{display:flex;align-items:center;gap:8px;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;transition:background-color .15s ease;color:#374151}.dropdown-item:hover,.dropdown-option:hover{background:#f3f4f6}.dropdown-item:disabled,.dropdown-option:disabled{opacity:.5;cursor:not-allowed}.dropdown-item-icon,.dropdown-option-icon{font-size:14px;color:#6b7280;flex-shrink:0}.dropdown-item-label,.dropdown-option-label{font-size:14px;font-weight:500}.dropdown-divider{height:1px;background:#e5e7eb;margin:4px 0}.style-modern .breadcrumb-item.clickable:hover{color:#1f2937}.style-modern .separator-icon{color:#d1d5db}.style-classic .breadcrumb-item{padding:2px 4px}.style-classic .breadcrumb-item.clickable:hover{color:#1f2937}.style-classic .separator-icon{color:#9ca3af;font-size:12px}.style-minimal .breadcrumb-item{padding:1px 2px}.style-minimal .breadcrumb-item.clickable:hover{color:#1f2937}.style-minimal .separator-icon{color:#d1d5db;font-size:10px}.style-hierarchical{background:transparent;border:none;padding:2px 0}.style-hierarchical .breadcrumb-item{padding:0 2px}.style-hierarchical .breadcrumb-item.clickable:hover{color:#1f2937}.style-hierarchical .separator-icon{color:#d1d5db}.style-hierarchical .breadcrumb-actions{display:none}@keyframes dropdownSlideIn{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.breadcrumb-container.animated .breadcrumb-item{transition:none}.breadcrumb-container.animated .breadcrumb-item:hover{transform:none}.breadcrumb-dropdown{animation:none}}@media (prefers-contrast: high){.breadcrumb-container .breadcrumb-item{border:1px solid transparent}.breadcrumb-container .breadcrumb-item.clickable:hover{border-color:#000}}\n"] }]
|
|
11396
|
+
}], propDecorators: { items: [{
|
|
11397
|
+
type: Input
|
|
11398
|
+
}], style: [{
|
|
11399
|
+
type: Input
|
|
11400
|
+
}], separator: [{
|
|
11401
|
+
type: Input
|
|
11402
|
+
}], showHomeIcon: [{
|
|
11403
|
+
type: Input
|
|
11404
|
+
}], homeIcon: [{
|
|
11405
|
+
type: Input
|
|
11406
|
+
}], maxItems: [{
|
|
11407
|
+
type: Input
|
|
11408
|
+
}], showDropdownOnOverflow: [{
|
|
11409
|
+
type: Input
|
|
11410
|
+
}], dropdownOptions: [{
|
|
11411
|
+
type: Input
|
|
11412
|
+
}], clickableItems: [{
|
|
11413
|
+
type: Input
|
|
11414
|
+
}], showTooltips: [{
|
|
11415
|
+
type: Input
|
|
11416
|
+
}], responsive: [{
|
|
11417
|
+
type: Input
|
|
11418
|
+
}], compact: [{
|
|
11419
|
+
type: Input
|
|
11420
|
+
}], animated: [{
|
|
11421
|
+
type: Input
|
|
11422
|
+
}], loading: [{
|
|
11423
|
+
type: Input
|
|
11424
|
+
}], disabled: [{
|
|
11425
|
+
type: Input
|
|
11426
|
+
}], itemClick: [{
|
|
11427
|
+
type: Output
|
|
11428
|
+
}], dropdownOptionClick: [{
|
|
11429
|
+
type: Output
|
|
11430
|
+
}], homeClick: [{
|
|
11431
|
+
type: Output
|
|
11432
|
+
}], onDocumentClick: [{
|
|
11433
|
+
type: HostListener,
|
|
11434
|
+
args: ['document:click', ['$event']]
|
|
11435
|
+
}] } });
|
|
11436
|
+
|
|
11437
|
+
// Breadcrumb Component Interfaces and Types
|
|
11438
|
+
// Predefined configurations for each style
|
|
11439
|
+
const BREADCRUMB_STYLES = {
|
|
11440
|
+
modern: {
|
|
11441
|
+
style: 'modern',
|
|
11442
|
+
separator: { type: 'chevron' },
|
|
11443
|
+
showHomeIcon: true,
|
|
11444
|
+
homeIcon: 'home',
|
|
11445
|
+
maxItems: 5,
|
|
11446
|
+
showDropdownOnOverflow: true,
|
|
11447
|
+
dropdownOptions: [],
|
|
11448
|
+
clickableItems: true,
|
|
11449
|
+
showTooltips: true,
|
|
11450
|
+
responsive: true,
|
|
11451
|
+
compact: false,
|
|
11452
|
+
animated: true
|
|
11453
|
+
},
|
|
11454
|
+
classic: {
|
|
11455
|
+
style: 'classic',
|
|
11456
|
+
separator: { type: 'slash' },
|
|
11457
|
+
showHomeIcon: false,
|
|
11458
|
+
homeIcon: 'home',
|
|
11459
|
+
maxItems: 8,
|
|
11460
|
+
showDropdownOnOverflow: false,
|
|
11461
|
+
dropdownOptions: [],
|
|
11462
|
+
clickableItems: true,
|
|
11463
|
+
showTooltips: false,
|
|
11464
|
+
responsive: false,
|
|
11465
|
+
compact: true,
|
|
11466
|
+
animated: false
|
|
11467
|
+
},
|
|
11468
|
+
minimal: {
|
|
11469
|
+
style: 'minimal',
|
|
11470
|
+
separator: { type: 'dot' },
|
|
11471
|
+
showHomeIcon: false,
|
|
11472
|
+
homeIcon: 'home',
|
|
11473
|
+
maxItems: 3,
|
|
11474
|
+
showDropdownOnOverflow: true,
|
|
11475
|
+
dropdownOptions: [],
|
|
11476
|
+
clickableItems: false,
|
|
11477
|
+
showTooltips: true,
|
|
11478
|
+
responsive: true,
|
|
11479
|
+
compact: true,
|
|
11480
|
+
animated: false
|
|
11481
|
+
},
|
|
11482
|
+
hierarchical: {
|
|
11483
|
+
style: 'hierarchical',
|
|
11484
|
+
separator: { type: 'chevron' },
|
|
11485
|
+
showHomeIcon: true,
|
|
11486
|
+
homeIcon: 'home',
|
|
11487
|
+
maxItems: 4,
|
|
11488
|
+
showDropdownOnOverflow: true,
|
|
11489
|
+
dropdownOptions: [],
|
|
11490
|
+
clickableItems: true,
|
|
11491
|
+
showTooltips: true,
|
|
11492
|
+
responsive: true,
|
|
11493
|
+
compact: false,
|
|
11494
|
+
animated: true
|
|
11495
|
+
}
|
|
11496
|
+
};
|
|
11497
|
+
// Utility functions
|
|
11498
|
+
class BreadcrumbUtils {
|
|
11499
|
+
/**
|
|
11500
|
+
* Create a breadcrumb item
|
|
11501
|
+
*/
|
|
11502
|
+
static createItem(id, label, options = {}) {
|
|
11503
|
+
return {
|
|
11504
|
+
id,
|
|
11505
|
+
label,
|
|
11506
|
+
...options
|
|
11507
|
+
};
|
|
11508
|
+
}
|
|
11509
|
+
/**
|
|
11510
|
+
* Create a dropdown option
|
|
11511
|
+
*/
|
|
11512
|
+
static createDropdownOption(id, label, options = {}) {
|
|
11513
|
+
return {
|
|
11514
|
+
id,
|
|
11515
|
+
label,
|
|
11516
|
+
...options
|
|
11517
|
+
};
|
|
11518
|
+
}
|
|
11519
|
+
/**
|
|
11520
|
+
* Create a separator
|
|
11521
|
+
*/
|
|
11522
|
+
static createSeparator(type, options = {}) {
|
|
11523
|
+
return {
|
|
11524
|
+
type,
|
|
11525
|
+
...options
|
|
11526
|
+
};
|
|
11527
|
+
}
|
|
11528
|
+
/**
|
|
11529
|
+
* Get default configuration for a style
|
|
11530
|
+
*/
|
|
11531
|
+
static getDefaultConfig(style) {
|
|
11532
|
+
return { ...BREADCRUMB_STYLES[style] };
|
|
11533
|
+
}
|
|
11534
|
+
/**
|
|
11535
|
+
* Merge configurations
|
|
11536
|
+
*/
|
|
11537
|
+
static mergeConfig(base, override) {
|
|
11538
|
+
return { ...base, ...override };
|
|
11539
|
+
}
|
|
11540
|
+
}
|
|
11541
|
+
|
|
10935
11542
|
/*
|
|
10936
11543
|
* Public API Surface of cloud-ide-element
|
|
10937
11544
|
* Here we can add what need to be exported from library
|
|
@@ -10941,5 +11548,5 @@ var floatingContainerDynamic_directive = /*#__PURE__*/Object.freeze({
|
|
|
10941
11548
|
* Generated bundle index. Do not edit.
|
|
10942
11549
|
*/
|
|
10943
11550
|
|
|
10944
|
-
export { CideCoreFileManagerService, CideEleButtonComponent, CideEleConfirmationModalComponent, CideEleDataGridComponent, CideEleDropdownComponent, CideEleFileImageDirective, CideEleFileInputComponent, CideEleFileManagerService, CideEleFloatingContainerComponent, CideEleFloatingContainerDynamicDirective, CideEleFloatingContainerManagerComponent, CideEleFloatingContainerService, CideEleFloatingFeaturesService, CideEleFloatingFileUploaderComponent, CideEleFloatingFileUploaderService, CideEleGlobalNotificationsComponent, CideEleJsonEditorComponent, CideEleResizerDirective, CideEleSkeletonLoaderComponent, CideEleTabComponent, CideEleToastNotificationComponent, CideElementsService, CideIconComponent, CideInputComponent, CideSelectComponent, CideSelectOptionComponent, CideSpinnerComponent, CideTextareaComponent, ConfirmationService, CoreFileManagerInsertUpdatePayload, DEFAULT_GRID_CONFIG, DropdownManagerService, FloatingContainerShortcutsService, ICoreCyfmSave, KeyboardShortcutService, MFileManager, NotificationService, TooltipDirective };
|
|
11551
|
+
export { BREADCRUMB_STYLES, BreadcrumbUtils, CideCoreFileManagerService, CideEleBreadcrumbComponent, CideEleButtonComponent, CideEleConfirmationModalComponent, CideEleDataGridComponent, CideEleDropdownComponent, CideEleFileImageDirective, CideEleFileInputComponent, CideEleFileManagerService, CideEleFloatingContainerComponent, CideEleFloatingContainerDynamicDirective, CideEleFloatingContainerManagerComponent, CideEleFloatingContainerService, CideEleFloatingFeaturesService, CideEleFloatingFileUploaderComponent, CideEleFloatingFileUploaderService, CideEleGlobalNotificationsComponent, CideEleJsonEditorComponent, CideEleResizerDirective, CideEleSkeletonLoaderComponent, CideEleTabComponent, CideEleToastNotificationComponent, CideElementsService, CideFormFieldErrorComponent, CideIconComponent, CideInputComponent, CideSelectComponent, CideSelectOptionComponent, CideSpinnerComponent, CideTextareaComponent, ConfirmationService, CoreFileManagerInsertUpdatePayload, DEFAULT_GRID_CONFIG, DropdownManagerService, FloatingContainerShortcutsService, ICoreCyfmSave, KeyboardShortcutService, MFileManager, NotificationService, TooltipDirective };
|
|
10945
11552
|
//# sourceMappingURL=cloud-ide-element.mjs.map
|