@ship-ui/core 0.13.32 → 0.14.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/ship-ui-core.mjs +60 -37
- package/fesm2022/ship-ui-core.mjs.map +1 -1
- package/index.d.ts +3 -2
- package/package.json +1 -1
- package/styles/components/ship-alert-container.component.scss +2 -2
- package/styles/components/ship-alert.component.scss +17 -146
- package/styles/components/ship-button.component.scss +12 -260
- package/styles/components/ship-checkbox.component.scss +8 -160
- package/styles/components/ship-chip.component.scss +5 -207
- package/styles/components/ship-event-card.component.scss +2 -159
- package/styles/components/ship-sheet.utility.scss +298 -0
- package/styles/core/core/loader.scss +1 -1
- package/styles/index.scss +4 -0
|
@@ -47,10 +47,11 @@ class ShipAlertComponent {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ShipAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
50
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: ShipAlertComponent, isStandalone: true, selector: "sh-alert", inputs: { alertService: { classPropertyName: "alertService", publicName: "alertService", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
50
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: ShipAlertComponent, isStandalone: true, selector: "sh-alert", inputs: { alertService: { classPropertyName: "alertService", publicName: "alertService", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "sh-sheet" }, ngImport: i0, template: `
|
|
51
51
|
<div class="alert">
|
|
52
52
|
<div #ref class="icon" [style.display]="!ref.children.length ? 'none' : 'block'">
|
|
53
|
-
<ng-content select="[icon]"
|
|
53
|
+
<ng-content select="[icon]" />
|
|
54
|
+
<ng-content select="sh-icon" />
|
|
54
55
|
</div>
|
|
55
56
|
|
|
56
57
|
<div class="icon">
|
|
@@ -72,8 +73,8 @@ class ShipAlertComponent {
|
|
|
72
73
|
</div>
|
|
73
74
|
|
|
74
75
|
<div class="title">
|
|
75
|
-
<ng-content select="[title]"
|
|
76
|
-
<ng-content
|
|
76
|
+
<ng-content select="[title]" />
|
|
77
|
+
<ng-content />
|
|
77
78
|
</div>
|
|
78
79
|
|
|
79
80
|
@if (id()) {
|
|
@@ -81,7 +82,8 @@ class ShipAlertComponent {
|
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
<div class="content">
|
|
84
|
-
<ng-content select="[content]"
|
|
85
|
+
<ng-content select="[content]" />
|
|
86
|
+
<ng-content select="p" />
|
|
85
87
|
</div>
|
|
86
88
|
</div>
|
|
87
89
|
`, isInline: true, dependencies: [{ kind: "component", type: ShipIconComponent, selector: "sh-icon" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
@@ -94,7 +96,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
94
96
|
template: `
|
|
95
97
|
<div class="alert">
|
|
96
98
|
<div #ref class="icon" [style.display]="!ref.children.length ? 'none' : 'block'">
|
|
97
|
-
<ng-content select="[icon]"
|
|
99
|
+
<ng-content select="[icon]" />
|
|
100
|
+
<ng-content select="sh-icon" />
|
|
98
101
|
</div>
|
|
99
102
|
|
|
100
103
|
<div class="icon">
|
|
@@ -116,8 +119,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
116
119
|
</div>
|
|
117
120
|
|
|
118
121
|
<div class="title">
|
|
119
|
-
<ng-content select="[title]"
|
|
120
|
-
<ng-content
|
|
122
|
+
<ng-content select="[title]" />
|
|
123
|
+
<ng-content />
|
|
121
124
|
</div>
|
|
122
125
|
|
|
123
126
|
@if (id()) {
|
|
@@ -125,11 +128,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
125
128
|
}
|
|
126
129
|
|
|
127
130
|
<div class="content">
|
|
128
|
-
<ng-content select="[content]"
|
|
131
|
+
<ng-content select="[content]" />
|
|
132
|
+
<ng-content select="p" />
|
|
129
133
|
</div>
|
|
130
134
|
</div>
|
|
131
135
|
`,
|
|
132
136
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
137
|
+
host: {
|
|
138
|
+
class: 'sh-sheet',
|
|
139
|
+
},
|
|
133
140
|
}]
|
|
134
141
|
}] });
|
|
135
142
|
|
|
@@ -526,7 +533,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
526
533
|
|
|
527
534
|
class ShipButtonComponent {
|
|
528
535
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ShipButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
529
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: ShipButtonComponent, isStandalone: true, selector: "[shButton]", ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
536
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: ShipButtonComponent, isStandalone: true, selector: "[shButton]", host: { classAttribute: "sh-sheet-h" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
530
537
|
}
|
|
531
538
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ShipButtonComponent, decorators: [{
|
|
532
539
|
type: Component,
|
|
@@ -535,6 +542,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
535
542
|
imports: [],
|
|
536
543
|
template: '<ng-content></ng-content>',
|
|
537
544
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
545
|
+
host: {
|
|
546
|
+
class: 'sh-sheet-h',
|
|
547
|
+
},
|
|
538
548
|
}]
|
|
539
549
|
}] });
|
|
540
550
|
|
|
@@ -564,11 +574,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
564
574
|
}]
|
|
565
575
|
}] });
|
|
566
576
|
|
|
577
|
+
function classMutationSignal() {
|
|
578
|
+
const element = inject(ElementRef).nativeElement;
|
|
579
|
+
if (!element)
|
|
580
|
+
return signal('');
|
|
581
|
+
const classListSignal = signal(element.className, ...(ngDevMode ? [{ debugName: "classListSignal" }] : []));
|
|
582
|
+
if (typeof MutationObserver === 'undefined')
|
|
583
|
+
return classListSignal.asReadonly();
|
|
584
|
+
const destroyRef = inject(DestroyRef);
|
|
585
|
+
const observer = new MutationObserver((mutations) => {
|
|
586
|
+
for (const mutation of mutations) {
|
|
587
|
+
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
|
|
588
|
+
const target = mutation.target;
|
|
589
|
+
classListSignal.set(target.className);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
observer.observe(element, { attributes: true });
|
|
594
|
+
destroyRef.onDestroy(() => observer.disconnect());
|
|
595
|
+
return classListSignal.asReadonly();
|
|
596
|
+
}
|
|
597
|
+
|
|
567
598
|
class ShipCheckboxComponent {
|
|
568
|
-
|
|
599
|
+
constructor() {
|
|
600
|
+
this.currentClassList = classMutationSignal();
|
|
601
|
+
this.showClasses = computed(() => {
|
|
602
|
+
const classArr = this.currentClassList().split(' ');
|
|
603
|
+
return classArr.includes('active') ? classArr : '';
|
|
604
|
+
}, ...(ngDevMode ? [{ debugName: "showClasses" }] : []));
|
|
605
|
+
}
|
|
569
606
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ShipCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
570
607
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: ShipCheckboxComponent, isStandalone: true, selector: "sh-checkbox", ngImport: i0, template: `
|
|
571
|
-
<div class="box">
|
|
608
|
+
<div class="box sh-sheet" [class]="showClasses()">
|
|
572
609
|
<sh-icon class="inherit default-indicator">check-bold</sh-icon>
|
|
573
610
|
<sh-icon class="inherit indeterminate-indicator">minus-bold</sh-icon>
|
|
574
611
|
</div>
|
|
@@ -582,7 +619,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
582
619
|
selector: 'sh-checkbox',
|
|
583
620
|
imports: [ShipIconComponent],
|
|
584
621
|
template: `
|
|
585
|
-
<div class="box">
|
|
622
|
+
<div class="box sh-sheet" [class]="showClasses()">
|
|
586
623
|
<sh-icon class="inherit default-indicator">check-bold</sh-icon>
|
|
587
624
|
<sh-icon class="inherit indeterminate-indicator">minus-bold</sh-icon>
|
|
588
625
|
</div>
|
|
@@ -595,7 +632,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
595
632
|
|
|
596
633
|
class ShipChipComponent {
|
|
597
634
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ShipChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
598
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: ShipChipComponent, isStandalone: true, selector: "sh-chip", ngImport: i0, template: '<div><ng-content></ng-content></div>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
635
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: ShipChipComponent, isStandalone: true, selector: "sh-chip", host: { classAttribute: "sh-sheet" }, ngImport: i0, template: '<div><ng-content></ng-content></div>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
599
636
|
}
|
|
600
637
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ShipChipComponent, decorators: [{
|
|
601
638
|
type: Component,
|
|
@@ -604,6 +641,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
604
641
|
imports: [],
|
|
605
642
|
template: '<div><ng-content></ng-content></div>',
|
|
606
643
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
644
|
+
host: {
|
|
645
|
+
class: 'sh-sheet',
|
|
646
|
+
},
|
|
607
647
|
}]
|
|
608
648
|
}] });
|
|
609
649
|
|
|
@@ -1248,24 +1288,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1248
1288
|
args: ['click']
|
|
1249
1289
|
}] } });
|
|
1250
1290
|
|
|
1251
|
-
function classMutationSignal(element) {
|
|
1252
|
-
const classListSignal = signal(element.className, ...(ngDevMode ? [{ debugName: "classListSignal" }] : []));
|
|
1253
|
-
if (typeof MutationObserver === 'undefined')
|
|
1254
|
-
return classListSignal.asReadonly();
|
|
1255
|
-
const destroyRef = inject(DestroyRef);
|
|
1256
|
-
const observer = new MutationObserver((mutations) => {
|
|
1257
|
-
for (const mutation of mutations) {
|
|
1258
|
-
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
|
|
1259
|
-
const target = mutation.target;
|
|
1260
|
-
classListSignal.set(target.className);
|
|
1261
|
-
}
|
|
1262
|
-
}
|
|
1263
|
-
});
|
|
1264
|
-
observer.observe(element, { attributes: true });
|
|
1265
|
-
destroyRef.onDestroy(() => observer.disconnect());
|
|
1266
|
-
return classListSignal.asReadonly();
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
1291
|
function contentProjectionSignal(hostElement, querySelector) {
|
|
1270
1292
|
const projectedElementsSignal = signal([], ...(ngDevMode ? [{ debugName: "projectedElementsSignal" }] : []));
|
|
1271
1293
|
const destroyRef = inject(DestroyRef);
|
|
@@ -1299,7 +1321,6 @@ function contentProjectionSignal(hostElement, querySelector) {
|
|
|
1299
1321
|
|
|
1300
1322
|
class ShipDatepickerComponent {
|
|
1301
1323
|
constructor() {
|
|
1302
|
-
this.#selfRef = inject(ElementRef);
|
|
1303
1324
|
this.#INIT_DATE = this.#getUTCDate(new Date());
|
|
1304
1325
|
this.date = model(null, ...(ngDevMode ? [{ debugName: "date" }] : []));
|
|
1305
1326
|
this.endDate = model(null, ...(ngDevMode ? [{ debugName: "endDate" }] : []));
|
|
@@ -1319,7 +1340,7 @@ class ShipDatepickerComponent {
|
|
|
1319
1340
|
const weekdayLabels = this.weekdayLabels();
|
|
1320
1341
|
return weekdayLabels.slice(startOfWeek).concat(weekdayLabels.slice(0, startOfWeek));
|
|
1321
1342
|
}, ...(ngDevMode ? [{ debugName: "weekdays" }] : []));
|
|
1322
|
-
this.currentClasses = classMutationSignal(
|
|
1343
|
+
this.currentClasses = classMutationSignal();
|
|
1323
1344
|
this.someEffect = effect(() => {
|
|
1324
1345
|
const _ = this.currentClasses();
|
|
1325
1346
|
this.#findSelectedAndCalc();
|
|
@@ -1330,7 +1351,6 @@ class ShipDatepickerComponent {
|
|
|
1330
1351
|
this.#setDateAsCurrent();
|
|
1331
1352
|
}, ...(ngDevMode ? [{ debugName: "#newDateEffect" }] : []));
|
|
1332
1353
|
}
|
|
1333
|
-
#selfRef;
|
|
1334
1354
|
#INIT_DATE;
|
|
1335
1355
|
getLastVisibleMonth() {
|
|
1336
1356
|
const lastMonthOffset = this.monthsToShow() - 1;
|
|
@@ -1647,7 +1667,7 @@ class ShipDatepickerInputComponent {
|
|
|
1647
1667
|
}, ...(ngDevMode ? [{ debugName: "_maskedDate" }] : []));
|
|
1648
1668
|
this.internalDate = signal(this.#INIT_DATE, ...(ngDevMode ? [{ debugName: "internalDate" }] : []));
|
|
1649
1669
|
this.isOpen = model(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
1650
|
-
this.currentClass = classMutationSignal(
|
|
1670
|
+
this.currentClass = classMutationSignal();
|
|
1651
1671
|
this.#inputObserver = contentProjectionSignal(this.#elementRef.nativeElement, '#input-wrap input');
|
|
1652
1672
|
this.#inputRefEffect = effect(() => {
|
|
1653
1673
|
const inputs = this.#inputObserver();
|
|
@@ -2000,7 +2020,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
2000
2020
|
|
|
2001
2021
|
class ShipEventCardComponent {
|
|
2002
2022
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ShipEventCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2003
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: ShipEventCardComponent, isStandalone: true, selector: "sh-event-card", ngImport: i0, template: `
|
|
2023
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: ShipEventCardComponent, isStandalone: true, selector: "sh-event-card", host: { classAttribute: "sh-sheet" }, ngImport: i0, template: `
|
|
2004
2024
|
<div class="content">
|
|
2005
2025
|
<ng-content />
|
|
2006
2026
|
</div>
|
|
@@ -2027,6 +2047,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
2027
2047
|
</div>
|
|
2028
2048
|
`,
|
|
2029
2049
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2050
|
+
host: {
|
|
2051
|
+
class: 'sh-sheet',
|
|
2052
|
+
},
|
|
2030
2053
|
}]
|
|
2031
2054
|
}] });
|
|
2032
2055
|
|