@ship-ui/core 0.15.26 → 0.15.29
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 +91 -3
- package/fesm2022/ship-ui-core.mjs.map +1 -1
- package/index.d.ts +12 -1
- package/package.json +1 -1
- package/styles/components/ship-button-group.component.scss +62 -10
- package/styles/components/ship-tabs.component.scss +31 -3
- package/styles/core/helpers/mixins/scroll-shadows.scss +44 -0
- package/styles/helpers.scss +1 -0
|
@@ -1625,8 +1625,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
1625
1625
|
}] } });
|
|
1626
1626
|
|
|
1627
1627
|
class ShipButtonGroupComponent {
|
|
1628
|
+
constructor() {
|
|
1629
|
+
this.id = '--' + Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 12);
|
|
1630
|
+
}
|
|
1628
1631
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ShipButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1629
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", type: ShipButtonGroupComponent, isStandalone: true, selector: "sh-button-group", ngImport: i0, template: `
|
|
1632
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", type: ShipButtonGroupComponent, isStandalone: true, selector: "sh-button-group", host: { properties: { "style.--btng-id": "id" } }, ngImport: i0, template: `
|
|
1630
1633
|
<ng-content />
|
|
1631
1634
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1632
1635
|
}
|
|
@@ -1639,6 +1642,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
1639
1642
|
<ng-content />
|
|
1640
1643
|
`,
|
|
1641
1644
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1645
|
+
host: {
|
|
1646
|
+
'[style.--btng-id]': 'id',
|
|
1647
|
+
},
|
|
1642
1648
|
}]
|
|
1643
1649
|
}] });
|
|
1644
1650
|
|
|
@@ -6078,8 +6084,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
6078
6084
|
}] } });
|
|
6079
6085
|
|
|
6080
6086
|
class ShipTabsComponent {
|
|
6087
|
+
constructor() {
|
|
6088
|
+
this.id = '--' + Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 12);
|
|
6089
|
+
}
|
|
6081
6090
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ShipTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6082
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", type: ShipTabsComponent, isStandalone: true, selector: "sh-tabs", ngImport: i0, template: `
|
|
6091
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", type: ShipTabsComponent, isStandalone: true, selector: "sh-tabs", host: { properties: { "style.--tabs-id": "id" } }, ngImport: i0, template: `
|
|
6083
6092
|
<ng-content />
|
|
6084
6093
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6085
6094
|
}
|
|
@@ -6092,6 +6101,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
6092
6101
|
<ng-content />
|
|
6093
6102
|
`,
|
|
6094
6103
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
6104
|
+
host: {
|
|
6105
|
+
'[style.--tabs-id]': 'id',
|
|
6106
|
+
},
|
|
6095
6107
|
}]
|
|
6096
6108
|
}] });
|
|
6097
6109
|
|
|
@@ -6550,6 +6562,82 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
6550
6562
|
args: ['drop', ['$event']]
|
|
6551
6563
|
}] } });
|
|
6552
6564
|
|
|
6565
|
+
class ShipInputMaskDirective {
|
|
6566
|
+
constructor() {
|
|
6567
|
+
this.#selfRef = inject(ElementRef);
|
|
6568
|
+
this.#renderer = inject(Renderer2);
|
|
6569
|
+
this.shInputMask = input('(999) 999-9999', ...(ngDevMode ? [{ debugName: "shInputMask" }] : []));
|
|
6570
|
+
}
|
|
6571
|
+
#selfRef;
|
|
6572
|
+
#renderer;
|
|
6573
|
+
onInput(event) {
|
|
6574
|
+
const inputElement = this.#selfRef.nativeElement;
|
|
6575
|
+
const oldRawValue = inputElement.value;
|
|
6576
|
+
const newRawValue = event.target.value;
|
|
6577
|
+
const oldCursorPos = inputElement.selectionStart ?? 0;
|
|
6578
|
+
const newCleanValue = this.#cleanValue(newRawValue);
|
|
6579
|
+
const maskedValue = this.#applyMask(newCleanValue);
|
|
6580
|
+
this.#renderer.setProperty(inputElement, 'value', maskedValue);
|
|
6581
|
+
const newCursorPos = this.#getNewCursorPosition(maskedValue, oldRawValue, oldCursorPos);
|
|
6582
|
+
inputElement.setSelectionRange(newCursorPos, newCursorPos);
|
|
6583
|
+
}
|
|
6584
|
+
#getNewCursorPosition(maskedValue, oldRawValue, oldCursorPos) {
|
|
6585
|
+
let digitsBeforeCursor = 0;
|
|
6586
|
+
for (let i = 0; i < oldCursorPos; i++) {
|
|
6587
|
+
if (oldRawValue[i] && oldRawValue[i].match(/\d/)) {
|
|
6588
|
+
digitsBeforeCursor++;
|
|
6589
|
+
}
|
|
6590
|
+
}
|
|
6591
|
+
let newCursorPos = 0;
|
|
6592
|
+
let digitsFound = 0;
|
|
6593
|
+
while (newCursorPos < maskedValue.length && digitsFound < digitsBeforeCursor) {
|
|
6594
|
+
if (maskedValue[newCursorPos].match(/\d/)) {
|
|
6595
|
+
digitsFound++;
|
|
6596
|
+
}
|
|
6597
|
+
newCursorPos++;
|
|
6598
|
+
}
|
|
6599
|
+
return newCursorPos;
|
|
6600
|
+
}
|
|
6601
|
+
#cleanValue(value) {
|
|
6602
|
+
if (!value)
|
|
6603
|
+
return '';
|
|
6604
|
+
return value.replace(/\D/g, '');
|
|
6605
|
+
}
|
|
6606
|
+
#applyMask(cleanValue) {
|
|
6607
|
+
const inputMask = this.shInputMask();
|
|
6608
|
+
if (typeof inputMask === 'function') {
|
|
6609
|
+
return inputMask(cleanValue) ?? '';
|
|
6610
|
+
}
|
|
6611
|
+
const pattern = inputMask;
|
|
6612
|
+
let masked = '';
|
|
6613
|
+
let digitIndex = 0;
|
|
6614
|
+
for (let i = 0; i < pattern.length && digitIndex < cleanValue.length; i++) {
|
|
6615
|
+
const maskChar = pattern[i];
|
|
6616
|
+
const digitChar = cleanValue[digitIndex];
|
|
6617
|
+
if (maskChar === '9') {
|
|
6618
|
+
masked += digitChar;
|
|
6619
|
+
digitIndex++;
|
|
6620
|
+
}
|
|
6621
|
+
else {
|
|
6622
|
+
masked += maskChar;
|
|
6623
|
+
}
|
|
6624
|
+
}
|
|
6625
|
+
return masked;
|
|
6626
|
+
}
|
|
6627
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ShipInputMaskDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
6628
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.0", type: ShipInputMaskDirective, isStandalone: true, selector: "[shInputMask]", inputs: { shInputMask: { classPropertyName: "shInputMask", publicName: "shInputMask", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "onInput($event)" } }, ngImport: i0 }); }
|
|
6629
|
+
}
|
|
6630
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ShipInputMaskDirective, decorators: [{
|
|
6631
|
+
type: Directive,
|
|
6632
|
+
args: [{
|
|
6633
|
+
selector: '[shInputMask]',
|
|
6634
|
+
standalone: true,
|
|
6635
|
+
}]
|
|
6636
|
+
}], propDecorators: { onInput: [{
|
|
6637
|
+
type: HostListener,
|
|
6638
|
+
args: ['input', ['$event']]
|
|
6639
|
+
}] } });
|
|
6640
|
+
|
|
6553
6641
|
class ShipPreventWheelDirective {
|
|
6554
6642
|
wheel(event) {
|
|
6555
6643
|
event.preventDefault();
|
|
@@ -6780,5 +6868,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
6780
6868
|
* Generated bundle index. Do not edit.
|
|
6781
6869
|
*/
|
|
6782
6870
|
|
|
6783
|
-
export { GridSortableDirective, SHIP_CONFIG, ShipAlertComponent, ShipAlertContainerComponent, ShipAlertModule, ShipAlertService, ShipBlueprintComponent, ShipButtonComponent, ShipButtonGroupComponent, ShipCardComponent, ShipCheckboxComponent, ShipChipComponent, ShipColorPickerComponent, ShipDatepickerComponent, ShipDatepickerInputComponent, ShipDaterangeInputComponent, ShipDialogComponent, ShipDialogService, ShipDividerComponent, ShipEventCardComponent, ShipFileDragDropDirective, ShipFileUploadComponent, ShipFormFieldComponent, ShipIconComponent, ShipListComponent, ShipMenuComponent, ShipPopoverComponent, ShipPreventWheelDirective, ShipProgressBarComponent, ShipRadioComponent, ShipRangeSliderComponent, ShipResizeDirective, ShipSelectComponent, ShipSidenavComponent, ShipSortDirective, ShipSortableComponent, ShipSortableDirective, ShipSpinnerComponent, ShipStepperComponent, ShipStickyColumnsDirective, ShipTableComponent, ShipTabsComponent, ShipToggleCardComponent, ShipToggleComponent, ShipTooltipComponent, ShipTooltipDirective, ShipTooltipWrapper, ShipVirtualScrollComponent, TEST_NODES, moveIndex, watchHostClass };
|
|
6871
|
+
export { GridSortableDirective, SHIP_CONFIG, ShipAlertComponent, ShipAlertContainerComponent, ShipAlertModule, ShipAlertService, ShipBlueprintComponent, ShipButtonComponent, ShipButtonGroupComponent, ShipCardComponent, ShipCheckboxComponent, ShipChipComponent, ShipColorPickerComponent, ShipDatepickerComponent, ShipDatepickerInputComponent, ShipDaterangeInputComponent, ShipDialogComponent, ShipDialogService, ShipDividerComponent, ShipEventCardComponent, ShipFileDragDropDirective, ShipFileUploadComponent, ShipFormFieldComponent, ShipIconComponent, ShipInputMaskDirective, ShipListComponent, ShipMenuComponent, ShipPopoverComponent, ShipPreventWheelDirective, ShipProgressBarComponent, ShipRadioComponent, ShipRangeSliderComponent, ShipResizeDirective, ShipSelectComponent, ShipSidenavComponent, ShipSortDirective, ShipSortableComponent, ShipSortableDirective, ShipSpinnerComponent, ShipStepperComponent, ShipStickyColumnsDirective, ShipTableComponent, ShipTabsComponent, ShipToggleCardComponent, ShipToggleComponent, ShipTooltipComponent, ShipTooltipDirective, ShipTooltipWrapper, ShipVirtualScrollComponent, TEST_NODES, moveIndex, watchHostClass };
|
|
6784
6872
|
//# sourceMappingURL=ship-ui-core.mjs.map
|