@koobiq/components 18.13.0 → 18.15.0
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/LICENSE +1 -1
- package/accordion/accordion.component.d.ts +5 -5
- package/button/button.component.d.ts +3 -2
- package/button-toggle/_button-toggle-theme.scss +0 -4
- package/button-toggle/button-toggle-tokens.scss +1 -4
- package/button-toggle/button-toggle.component.d.ts +3 -2
- package/button-toggle/button-toggle.scss +11 -0
- package/core/locales/formatters.d.ts +36 -0
- package/core/locales/index.d.ts +1 -0
- package/core/locales/locale-service.d.ts +79 -0
- package/core/locales/tk-TM.d.ts +45 -0
- package/core/pop-up/constants.d.ts +6 -0
- package/core/pop-up/pop-up-trigger.d.ts +6 -0
- package/core/select/common.d.ts +17 -0
- package/core/select/constants.d.ts +0 -18
- package/esm2022/accordion/accordion.component.mjs +11 -10
- package/esm2022/button/button.component.mjs +3 -1
- package/esm2022/button-toggle/button-toggle.component.mjs +6 -4
- package/esm2022/core/locales/formatters.mjs +37 -1
- package/esm2022/core/locales/index.mjs +2 -1
- package/esm2022/core/locales/locale-service.mjs +7 -4
- package/esm2022/core/locales/tk-TM.mjs +44 -0
- package/esm2022/core/option/action.mjs +3 -4
- package/esm2022/core/pop-up/constants.mjs +8 -1
- package/esm2022/core/pop-up/pop-up-trigger.mjs +50 -3
- package/esm2022/core/select/common.mjs +63 -1
- package/esm2022/core/select/constants.mjs +1 -19
- package/esm2022/core/version.mjs +2 -2
- package/esm2022/form-field/form-field.mjs +5 -5
- package/esm2022/icon/icon-button.component.mjs +3 -1
- package/esm2022/link/link.component.mjs +4 -2
- package/esm2022/navbar/navbar-item.component.mjs +4 -2
- package/esm2022/navbar/navbar.component.mjs +6 -4
- package/esm2022/overflow-items/index.mjs +3 -0
- package/esm2022/overflow-items/koobiq-components-overflow-items.mjs +5 -0
- package/esm2022/overflow-items/module.mjs +25 -0
- package/esm2022/overflow-items/overflow-items.mjs +269 -0
- package/esm2022/popover/popover.component.mjs +4 -2
- package/esm2022/select/select-option.directive.mjs +17 -19
- package/esm2022/select/select.component.mjs +4 -78
- package/esm2022/tabs/tab-header.component.mjs +2 -2
- package/esm2022/tabs/tab-nav-bar.mjs +18 -18
- package/esm2022/timezone/timezone-option.directive.mjs +15 -12
- package/esm2022/title/title.directive.mjs +9 -18
- package/esm2022/toggle/toggle.component.mjs +12 -10
- package/esm2022/tooltip/tooltip.component.mjs +30 -27
- package/esm2022/tree-select/tree-select.component.mjs +21 -56
- package/fesm2022/koobiq-components-accordion.mjs +9 -7
- package/fesm2022/koobiq-components-accordion.mjs.map +1 -1
- package/fesm2022/koobiq-components-button-toggle.mjs +5 -3
- package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-button.mjs +2 -0
- package/fesm2022/koobiq-components-button.mjs.map +1 -1
- package/fesm2022/koobiq-components-core.mjs +219 -41
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-form-field.mjs +4 -4
- package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
- package/fesm2022/koobiq-components-icon.mjs +2 -0
- package/fesm2022/koobiq-components-icon.mjs.map +1 -1
- package/fesm2022/koobiq-components-link.mjs +3 -1
- package/fesm2022/koobiq-components-link.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar.mjs +8 -4
- package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-overflow-items.mjs +298 -0
- package/fesm2022/koobiq-components-overflow-items.mjs.map +1 -0
- package/fesm2022/koobiq-components-popover.mjs +3 -1
- package/fesm2022/koobiq-components-popover.mjs.map +1 -1
- package/fesm2022/koobiq-components-select.mjs +19 -95
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tabs.mjs +19 -19
- package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
- package/fesm2022/koobiq-components-timezone.mjs +14 -11
- package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
- package/fesm2022/koobiq-components-title.mjs +8 -17
- package/fesm2022/koobiq-components-title.mjs.map +1 -1
- package/fesm2022/koobiq-components-toggle.mjs +11 -9
- package/fesm2022/koobiq-components-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-tooltip.mjs +30 -27
- package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree-select.mjs +19 -54
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/form-field/_form-field-theme.scss +2 -2
- package/icon/icon-button.component.d.ts +3 -2
- package/link/_link-theme.scss +6 -4
- package/link/link.component.d.ts +3 -2
- package/navbar/navbar-item.component.d.ts +2 -1
- package/navbar/navbar.component.d.ts +2 -1
- package/overflow-items/index.d.ts +2 -0
- package/overflow-items/module.d.ts +7 -0
- package/overflow-items/overflow-items.d.ts +132 -0
- package/overflow-items/overflow-items.scss +20 -0
- package/package.json +10 -4
- package/popover/popover.component.d.ts +1 -0
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/light-theme.css +1 -1
- package/prebuilt-themes/theme.css +1 -1
- package/schematics/ng-add/index.js +4 -4
- package/select/select-option.directive.d.ts +3 -1
- package/select/select.component.d.ts +2 -15
- package/tabs/_tabs-common.scss +14 -0
- package/tabs/tab-header.scss +0 -14
- package/tabs/tab-nav-bar.d.ts +0 -1
- package/timezone/timezone-option.directive.d.ts +1 -0
- package/title/title.directive.d.ts +2 -2
- package/toggle/toggle.component.d.ts +6 -5
- package/tooltip/tooltip.component.d.ts +3 -3
- package/tree-select/tree-select.component.d.ts +5 -16
|
@@ -12,6 +12,7 @@ import * as i1$1 from '@angular/cdk/a11y';
|
|
|
12
12
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
13
13
|
import { SPACE, ENTER, TAB, ESCAPE, HOME, END } from '@koobiq/cdk/keycodes';
|
|
14
14
|
import { Overlay, ScrollDispatcher } from '@angular/cdk/overlay';
|
|
15
|
+
import { TooltipSizeArrowSize } from '@koobiq/design-tokens';
|
|
15
16
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
16
17
|
import { distinctUntilChanged, delay } from 'rxjs/operators';
|
|
17
18
|
|
|
@@ -942,6 +943,50 @@ const ruRULocaleData = {
|
|
|
942
943
|
}
|
|
943
944
|
};
|
|
944
945
|
|
|
946
|
+
const tkTMLocaleData = {
|
|
947
|
+
select: { hiddenItemsText: 'ýene {{ number }}' },
|
|
948
|
+
datepicker: {
|
|
949
|
+
placeholder: 'gg.aa.ýý.',
|
|
950
|
+
dateInput: 'gg.aa.ýý.'
|
|
951
|
+
},
|
|
952
|
+
timepicker: {
|
|
953
|
+
placeholder: {
|
|
954
|
+
full: 'ss:mm:seksek',
|
|
955
|
+
short: 'ss:mm'
|
|
956
|
+
}
|
|
957
|
+
},
|
|
958
|
+
fileUpload: {
|
|
959
|
+
single: {
|
|
960
|
+
captionText: 'Faýly geçiriň ýa-da {{ browseLink }} ',
|
|
961
|
+
browseLink: 'saýlaň'
|
|
962
|
+
},
|
|
963
|
+
multiple: {
|
|
964
|
+
captionText: 'Şu ýere geçiriň ýa-da {{ browseLink }}',
|
|
965
|
+
captionTextWhenSelected: 'Ýene geçiriň ýa-da {{ browseLink }}',
|
|
966
|
+
captionTextForCompactSize: 'Faýllary geçiriň ýa-da {{ browseLink }}',
|
|
967
|
+
browseLink: 'saýlaň',
|
|
968
|
+
title: 'Faýl ýükläň',
|
|
969
|
+
gridHeaders: {
|
|
970
|
+
file: 'Faýl',
|
|
971
|
+
size: 'Ölçegi'
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
},
|
|
975
|
+
codeBlock: {
|
|
976
|
+
softWrapOnTooltip: 'Sözler boýunça geçirmäni işjeňleşdirmek',
|
|
977
|
+
softWrapOffTooltip: 'Sözler boýunça geçirmäni öçürmek',
|
|
978
|
+
downloadTooltip: 'Ýüklemek',
|
|
979
|
+
copiedTooltip: '✓ Göçürildi',
|
|
980
|
+
copyTooltip: 'Göçürmek',
|
|
981
|
+
viewAllText: 'Hemmesini görkezmek',
|
|
982
|
+
viewLessText: 'Ýygyrmak',
|
|
983
|
+
openExternalSystemTooltip: 'Daşarky ulgamda açmak'
|
|
984
|
+
},
|
|
985
|
+
timezone: {
|
|
986
|
+
searchPlaceholder: 'Şäher ýa-da sagat guşagy'
|
|
987
|
+
}
|
|
988
|
+
};
|
|
989
|
+
|
|
945
990
|
const zhCNLocaleData = {
|
|
946
991
|
select: { hiddenItemsText: '另外 {{ number }} 个' },
|
|
947
992
|
datepicker: {
|
|
@@ -1204,6 +1249,42 @@ const zhCNFormattersData = {
|
|
|
1204
1249
|
}
|
|
1205
1250
|
}
|
|
1206
1251
|
};
|
|
1252
|
+
const tkTMFormattersData = {
|
|
1253
|
+
formatters: {
|
|
1254
|
+
number: {
|
|
1255
|
+
rounding: {
|
|
1256
|
+
separator: ' ',
|
|
1257
|
+
groupSeparator: '',
|
|
1258
|
+
thousand: 'M',
|
|
1259
|
+
million: 'Mn',
|
|
1260
|
+
billion: 'Mr',
|
|
1261
|
+
trillion: 'Tn'
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
},
|
|
1265
|
+
input: {
|
|
1266
|
+
number: {
|
|
1267
|
+
groupSeparator: [' '],
|
|
1268
|
+
fractionSeparator: ','
|
|
1269
|
+
}
|
|
1270
|
+
},
|
|
1271
|
+
sizeUnits: {
|
|
1272
|
+
defaultUnitSystem: 'SI',
|
|
1273
|
+
defaultPrecision: 2,
|
|
1274
|
+
unitSystems: {
|
|
1275
|
+
SI: {
|
|
1276
|
+
abbreviations: ['B', 'KB', 'MB', 'GB', 'TB'],
|
|
1277
|
+
base: 10,
|
|
1278
|
+
power: 3
|
|
1279
|
+
},
|
|
1280
|
+
IEC: {
|
|
1281
|
+
abbreviations: ['B', 'KiB', 'MiB', 'GiB', 'TiB'],
|
|
1282
|
+
base: 2,
|
|
1283
|
+
power: 10
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
};
|
|
1207
1288
|
|
|
1208
1289
|
const KBQ_LOCALE_ID = new InjectionToken('KbqLocaleId');
|
|
1209
1290
|
const KBQ_DEFAULT_LOCALE_ID = 'ru-RU';
|
|
@@ -1215,14 +1296,16 @@ function KBQ_DEFAULT_LOCALE_DATA_FACTORY() {
|
|
|
1215
1296
|
{ id: 'es-LA', name: 'Español' },
|
|
1216
1297
|
{ id: 'pt-BR', name: 'Português' },
|
|
1217
1298
|
{ id: 'ru-RU', name: 'Русский' },
|
|
1218
|
-
{ id: 'fa-IR', name: 'فارسی' }
|
|
1299
|
+
{ id: 'fa-IR', name: 'فارسی' },
|
|
1300
|
+
{ id: 'tk-TM', name: 'Türkmen' }
|
|
1219
1301
|
],
|
|
1220
1302
|
'en-US': { ...enUSLocaleData, ...enUSFormattersData },
|
|
1221
1303
|
'zh-CN': { ...zhCNLocaleData, ...zhCNFormattersData },
|
|
1222
1304
|
'es-LA': { ...esLALocaleData, ...esLAFormattersData },
|
|
1223
1305
|
'pt-BR': { ...ptBRLocaleData, ...ptBRFormattersData },
|
|
1224
1306
|
'ru-RU': { ...ruRULocaleData, ...ruRUFormattersData },
|
|
1225
|
-
'fa-IR': { ...faIRLocaleData, ...faIRFormattersData }
|
|
1307
|
+
'fa-IR': { ...faIRLocaleData, ...faIRFormattersData },
|
|
1308
|
+
'tk-TM': { ...tkTMLocaleData, ...tkTMFormattersData }
|
|
1226
1309
|
};
|
|
1227
1310
|
}
|
|
1228
1311
|
const KBQ_LOCALE_DATA = new InjectionToken('KBQ_LOCALE_DATA', {
|
|
@@ -2156,12 +2239,11 @@ class KbqOptionActionComponent extends KbqOptionActionMixinBase {
|
|
|
2156
2239
|
this.option = option;
|
|
2157
2240
|
this.hasFocus = false;
|
|
2158
2241
|
this.destroyRef = inject(DestroyRef);
|
|
2159
|
-
this.focusMonitor.monitor(this.elementRef.nativeElement);
|
|
2160
2242
|
}
|
|
2161
2243
|
ngAfterViewInit() {
|
|
2162
|
-
|
|
2244
|
+
this.focusMonitor.monitor(this.elementRef.nativeElement);
|
|
2245
|
+
if (!this.option.dropdownTrigger)
|
|
2163
2246
|
return;
|
|
2164
|
-
}
|
|
2165
2247
|
this.option.dropdownTrigger.restoreFocus = false;
|
|
2166
2248
|
this.option.dropdownTrigger.dropdownClosed.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
2167
2249
|
this.preventShowingTooltip();
|
|
@@ -2949,6 +3031,12 @@ var PopUpSizes;
|
|
|
2949
3031
|
* Tags Input, Timezone, TreeSelect).
|
|
2950
3032
|
*/
|
|
2951
3033
|
const defaultOffsetY = 4;
|
|
3034
|
+
/**
|
|
3035
|
+
* Variable used for offsetY(X) calculations when applying Angular Overlay
|
|
3036
|
+
*
|
|
3037
|
+
* @docs-private
|
|
3038
|
+
*/
|
|
3039
|
+
const ARROW_BOTTOM_MARGIN_AND_HALF_HEIGHT = Math.round(parseInt(TooltipSizeArrowSize) * Math.sqrt(2));
|
|
2952
3040
|
|
|
2953
3041
|
class KbqPopUp {
|
|
2954
3042
|
constructor() {
|
|
@@ -3071,6 +3159,36 @@ const applyPopupMargins = (renderer, element, name, value) => {
|
|
|
3071
3159
|
}
|
|
3072
3160
|
};
|
|
3073
3161
|
|
|
3162
|
+
const getOffset = ({ originX, overlayX, originY, overlayY }, { width, height }) => {
|
|
3163
|
+
const offset = {};
|
|
3164
|
+
const elementWidthHalf = width / 2;
|
|
3165
|
+
const elementHeightHalf = height / 2;
|
|
3166
|
+
// alignment should be applied only if the element is small
|
|
3167
|
+
if (ARROW_BOTTOM_MARGIN_AND_HALF_HEIGHT > elementWidthHalf) {
|
|
3168
|
+
const PADDING = ARROW_BOTTOM_MARGIN_AND_HALF_HEIGHT - elementWidthHalf;
|
|
3169
|
+
if (originX === overlayX) {
|
|
3170
|
+
if (originX === 'start') {
|
|
3171
|
+
offset.offsetX = -PADDING;
|
|
3172
|
+
}
|
|
3173
|
+
if (originX === 'end') {
|
|
3174
|
+
offset.offsetX = PADDING;
|
|
3175
|
+
}
|
|
3176
|
+
}
|
|
3177
|
+
}
|
|
3178
|
+
// alignment should be applied only if the element is small
|
|
3179
|
+
if (ARROW_BOTTOM_MARGIN_AND_HALF_HEIGHT > elementHeightHalf) {
|
|
3180
|
+
const PADDING = ARROW_BOTTOM_MARGIN_AND_HALF_HEIGHT - elementHeightHalf;
|
|
3181
|
+
if (originY === overlayY) {
|
|
3182
|
+
if (originY === 'top') {
|
|
3183
|
+
offset.offsetY = -PADDING;
|
|
3184
|
+
}
|
|
3185
|
+
if (originY === 'bottom') {
|
|
3186
|
+
offset.offsetY = PADDING;
|
|
3187
|
+
}
|
|
3188
|
+
}
|
|
3189
|
+
}
|
|
3190
|
+
return offset;
|
|
3191
|
+
};
|
|
3074
3192
|
class KbqPopUpTrigger {
|
|
3075
3193
|
constructor() {
|
|
3076
3194
|
this.overlay = inject(Overlay);
|
|
@@ -3254,12 +3372,29 @@ class KbqPopUpTrigger {
|
|
|
3254
3372
|
this.overlayRef = this.createOverlay();
|
|
3255
3373
|
this.subscribeOnClosingActions();
|
|
3256
3374
|
const position = this.overlayRef.getConfig().positionStrategy
|
|
3257
|
-
.withPositions(this.
|
|
3375
|
+
.withPositions(this.getAdjustedPositions())
|
|
3258
3376
|
.withPush(true);
|
|
3259
3377
|
if (reapplyPosition) {
|
|
3260
3378
|
setTimeout(() => position.reapplyLastPosition());
|
|
3261
3379
|
}
|
|
3262
3380
|
}
|
|
3381
|
+
/**
|
|
3382
|
+
* Returns a list of positions that are aligned with the element's dimensions and offsets.
|
|
3383
|
+
* @protected
|
|
3384
|
+
*/
|
|
3385
|
+
getAdjustedPositions() {
|
|
3386
|
+
const res = [];
|
|
3387
|
+
for (const pos of this.getPrioritizedPositions()) {
|
|
3388
|
+
const offset = this.arrow
|
|
3389
|
+
? getOffset(pos, this.elementRef.nativeElement.getBoundingClientRect())
|
|
3390
|
+
: {};
|
|
3391
|
+
res.push({
|
|
3392
|
+
...pos,
|
|
3393
|
+
...offset
|
|
3394
|
+
});
|
|
3395
|
+
}
|
|
3396
|
+
return res;
|
|
3397
|
+
}
|
|
3263
3398
|
getPriorityPlacementStrategy(value) {
|
|
3264
3399
|
const result = [];
|
|
3265
3400
|
const possiblePositions = Object.keys(this.availablePositions);
|
|
@@ -3319,6 +3454,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImpor
|
|
|
3319
3454
|
type: Directive
|
|
3320
3455
|
}] });
|
|
3321
3456
|
|
|
3457
|
+
/**
|
|
3458
|
+
* The select panel will only "fit" inside the viewport if it is positioned at
|
|
3459
|
+
* this value or more away from the viewport boundary.
|
|
3460
|
+
*/
|
|
3461
|
+
const SELECT_PANEL_VIEWPORT_PADDING = 8;
|
|
3462
|
+
/** Injection token that determines the scroll handling while a select is open. */
|
|
3463
|
+
const KBQ_SELECT_SCROLL_STRATEGY = new InjectionToken('kbq-select-scroll-strategy');
|
|
3464
|
+
/** @docs-private */
|
|
3465
|
+
function kbqSelectScrollStrategyProviderFactory(overlay) {
|
|
3466
|
+
return () => overlay.scrollStrategies.reposition();
|
|
3467
|
+
}
|
|
3468
|
+
/** @docs-private */
|
|
3469
|
+
const KBQ_SELECT_SCROLL_STRATEGY_PROVIDER = {
|
|
3470
|
+
provide: KBQ_SELECT_SCROLL_STRATEGY,
|
|
3471
|
+
deps: [Overlay],
|
|
3472
|
+
useFactory: kbqSelectScrollStrategyProviderFactory
|
|
3473
|
+
};
|
|
3474
|
+
|
|
3322
3475
|
class KbqSelectTrigger {
|
|
3323
3476
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqSelectTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3324
3477
|
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: KbqSelectTrigger, isStandalone: true, selector: "kbq-select-trigger, [kbq-select-trigger]", ngImport: i0 }); }
|
|
@@ -3436,42 +3589,67 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImpor
|
|
|
3436
3589
|
standalone: true
|
|
3437
3590
|
}]
|
|
3438
3591
|
}] });
|
|
3439
|
-
|
|
3440
|
-
/**
|
|
3441
|
-
* @TODO: should be removed within refactoring (#DS-3298)
|
|
3442
|
-
* The max height of the select's overlay panel
|
|
3443
|
-
* @deprecated
|
|
3444
|
-
*/
|
|
3445
|
-
const SELECT_PANEL_MAX_HEIGHT = 224;
|
|
3446
|
-
/**
|
|
3447
|
-
* @TODO: should be removed within refactoring (#DS-3298)
|
|
3448
|
-
* The panel's padding on the x-axis
|
|
3449
|
-
* @deprecated
|
|
3450
|
-
*/
|
|
3451
|
-
const SELECT_PANEL_PADDING_X = 0;
|
|
3452
|
-
/**
|
|
3453
|
-
* @TODO: should be removed within refactoring (#DS-3298)
|
|
3454
|
-
* The panel's x-axis padding if it is indented (e.g. there is an option group).
|
|
3455
|
-
* @deprecated
|
|
3456
|
-
*/
|
|
3457
|
-
const SELECT_PANEL_INDENT_PADDING_X = SELECT_PANEL_PADDING_X * 2;
|
|
3458
3592
|
/**
|
|
3459
|
-
*
|
|
3460
|
-
*
|
|
3593
|
+
* Abstract class representing a customizable select component with an overlay.
|
|
3594
|
+
*
|
|
3595
|
+
* This class provides base functionality for handling the overlay positioning.
|
|
3596
|
+
* @docs-private
|
|
3461
3597
|
*/
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3598
|
+
class KbqAbstractSelect {
|
|
3599
|
+
constructor() {
|
|
3600
|
+
/** Overlay panel class. */
|
|
3601
|
+
this.overlayPanelClass = 'kbq-select-overlay';
|
|
3602
|
+
}
|
|
3603
|
+
setOverlayPosition() {
|
|
3604
|
+
this.resetOverlay();
|
|
3605
|
+
const overlayRect = this.getOverlayRect();
|
|
3606
|
+
// Window width without scrollbar
|
|
3607
|
+
const windowWidth = this.overlayDir.overlayRef?.hostElement.clientWidth;
|
|
3608
|
+
let offsetX = 0;
|
|
3609
|
+
let overlayMaxWidth;
|
|
3610
|
+
// Determine if select overflows on either side.
|
|
3611
|
+
const leftOverflow = -overlayRect.left;
|
|
3612
|
+
const rightOverflow = overlayRect.right - windowWidth;
|
|
3613
|
+
// If the element overflows on either side, reduce the offset to allow it to fit.
|
|
3614
|
+
if (leftOverflow > 0 || rightOverflow > 0) {
|
|
3615
|
+
[offsetX, overlayMaxWidth] = this.calculateOverlayOffsetX(offsetX);
|
|
3616
|
+
this.overlayDir.overlayRef.overlayElement.style.maxWidth = `${overlayMaxWidth}px`;
|
|
3617
|
+
// reset the minWidth property
|
|
3618
|
+
this.overlayDir.overlayRef.overlayElement.style.minWidth = '';
|
|
3619
|
+
}
|
|
3620
|
+
// Set the offset directly in order to avoid having to go through change detection and
|
|
3621
|
+
// potentially triggering "changed after it was checked" errors. Round the value to avoid
|
|
3622
|
+
// blurry content in some browsers.
|
|
3623
|
+
this.overlayDir.offsetX = Math.round(offsetX);
|
|
3624
|
+
this.overlayDir.overlayRef.updatePosition();
|
|
3625
|
+
}
|
|
3626
|
+
calculateOverlayOffsetX(baseOffsetX) {
|
|
3627
|
+
let offsetX = baseOffsetX;
|
|
3628
|
+
const windowWidth = this.overlayDir.overlayRef?.hostElement.clientWidth;
|
|
3629
|
+
const { left: leftIndent, right: triggerRight, width: triggerWidth } = this.triggerRect;
|
|
3630
|
+
const { width: overlayRectWidth } = this.getOverlayRect();
|
|
3631
|
+
const rightIndent = windowWidth - triggerRight;
|
|
3632
|
+
// Setting direction of dropdown expansion
|
|
3633
|
+
const isRightDirection = leftIndent <= rightIndent;
|
|
3634
|
+
const indent = isRightDirection ? rightIndent : leftIndent;
|
|
3635
|
+
const maxDropdownWidth = indent + triggerWidth - SELECT_PANEL_VIEWPORT_PADDING;
|
|
3636
|
+
const overlayMaxWidth = overlayRectWidth < maxDropdownWidth ? overlayRectWidth : maxDropdownWidth;
|
|
3637
|
+
if (!isRightDirection) {
|
|
3638
|
+
const leftOffset = triggerRight - overlayMaxWidth;
|
|
3639
|
+
offsetX -= leftIndent - leftOffset;
|
|
3640
|
+
}
|
|
3641
|
+
return [offsetX, overlayMaxWidth];
|
|
3642
|
+
}
|
|
3643
|
+
getOverlayRect() {
|
|
3644
|
+
return this.overlayDir.overlayRef.overlayElement.getBoundingClientRect();
|
|
3645
|
+
}
|
|
3646
|
+
resetOverlay() {
|
|
3647
|
+
this.overlayDir.overlayRef.hostElement.classList.add(this.overlayPanelClass);
|
|
3648
|
+
this.overlayDir.offsetX = 0;
|
|
3649
|
+
this.overlayDir.overlayRef.overlayElement.style.maxWidth = 'unset';
|
|
3650
|
+
this.overlayDir.overlayRef.updatePosition();
|
|
3651
|
+
}
|
|
3468
3652
|
}
|
|
3469
|
-
/** @docs-private */
|
|
3470
|
-
const KBQ_SELECT_SCROLL_STRATEGY_PROVIDER = {
|
|
3471
|
-
provide: KBQ_SELECT_SCROLL_STRATEGY,
|
|
3472
|
-
deps: [Overlay],
|
|
3473
|
-
useFactory: kbqSelectScrollStrategyProviderFactory
|
|
3474
|
-
};
|
|
3475
3653
|
|
|
3476
3654
|
/**
|
|
3477
3655
|
* Returns an exception to be thrown when attempting to change a select's `multiple` option
|
|
@@ -3725,11 +3903,11 @@ const KBQ_VALIDATION = new InjectionToken('KbqUseValidation', {
|
|
|
3725
3903
|
factory: () => ({ useValidation: true })
|
|
3726
3904
|
});
|
|
3727
3905
|
|
|
3728
|
-
const VERSION = new Version('18.
|
|
3906
|
+
const VERSION = new Version('18.15.0+sha-63a6ee6');
|
|
3729
3907
|
|
|
3730
3908
|
/**
|
|
3731
3909
|
* Generated bundle index. Do not edit.
|
|
3732
3910
|
*/
|
|
3733
3911
|
|
|
3734
|
-
export { AbsoluteDateFormatterImpurePipe, AbsoluteDateFormatterPipe, AbsoluteDateShortFormatterImpurePipe, AbsoluteDateShortFormatterPipe, AbsoluteDateTimeFormatterImpurePipe, AbsoluteDateTimeFormatterPipe, AbsoluteShortDateTimeFormatterImpurePipe, AbsoluteShortDateTimeFormatterPipe, AnimationCurves, BOTTOM_LEFT_POSITION_PRIORITY, BOTTOM_POSITION_PRIORITY, BOTTOM_RIGHT_POSITION_PRIORITY, BaseFormatterPipe, DateAdapter, DateFormatter, EXTENDED_OVERLAY_POSITIONS, ErrorStateMatcher, FileValidators, KBQ_CUSTOM_SCROLL_STRATEGY_PROVIDER, KBQ_DATE_FORMATS, KBQ_DATE_LOCALE, KBQ_DATE_LOCALE_FACTORY, KBQ_DEFAULT_LOCALE_DATA_FACTORY, KBQ_DEFAULT_LOCALE_ID, KBQ_FORM_FIELD_REF, KBQ_LOCALE_DATA, KBQ_LOCALE_ID, KBQ_LOCALE_SERVICE, KBQ_NUMBER_FORMATTER_DEFAULT_OPTIONS, KBQ_NUMBER_FORMATTER_OPTIONS, KBQ_OPTION_ACTION_PARENT, KBQ_OPTION_PARENT_COMPONENT, KBQ_PARENT_ANIMATION_COMPONENT, KBQ_PARENT_POPUP, KBQ_SANITY_CHECKS, KBQ_SELECT_SCROLL_STRATEGY, KBQ_SELECT_SCROLL_STRATEGY_PROVIDER, KBQ_SIZE_UNITS_CONFIG, KBQ_SIZE_UNITS_DEFAULT_CONFIG, KBQ_TITLE_TEXT_REF, KBQ_VALIDATION, KbqCommonModule, KbqComponentColors, KbqDataSizePipe, KbqDecimalPipe, KbqDefaultThemes, KbqForm, KbqFormElement, KbqFormattersModule, KbqFormsModule, KbqHighlightModule, KbqHighlightPipe, KbqLine, KbqLineModule, KbqLineSetter, KbqLocaleService, KbqLocaleServiceModule, KbqMeasureScrollbarService, KbqOptgroup, KbqOptgroupBase, KbqOptgroupMixinBase, KbqOption, KbqOptionActionBase, KbqOptionActionComponent, KbqOptionActionMixinBase, KbqOptionBase, KbqOptionModule, KbqOptionSelectionChange, KbqPopUp, KbqPopUpTrigger, KbqPseudoCheckbox, KbqPseudoCheckboxBase, KbqPseudoCheckboxMixinBase, KbqPseudoCheckboxModule, KbqRoundDecimalPipe, KbqSelectFooter, KbqSelectMatcher, KbqSelectSearch, KbqSelectSearchEmptyResult, KbqSelectTrigger, KbqTableNumberPipe, KbqThemeSelector, KbqVirtualOption, LEFT_BOTTOM_POSITION_PRIORITY, LEFT_POSITION_PRIORITY, LEFT_TOP_POSITION_PRIORITY, MeasurementSystem, MultipleMode, NUMBER_FORMAT_REGEXP, POSITION_MAP, POSITION_PRIORITY_STRATEGY, POSITION_TO_CSS_MAP, PasswordValidators, PopUpPlacements, PopUpSizes, PopUpTriggers, PopUpVisibility, RIGHT_BOTTOM_POSITION_PRIORITY, RIGHT_POSITION_PRIORITY, RIGHT_TOP_POSITION_PRIORITY, RangeDateFormatterImpurePipe, RangeDateFormatterPipe, RangeDateTimeFormatterImpurePipe, RangeDateTimeFormatterPipe, RangeMiddleDateTimeFormatterImpurePipe, RangeMiddleDateTimeFormatterPipe, RangeShortDateFormatterImpurePipe, RangeShortDateFormatterPipe, RangeShortDateTimeFormatterImpurePipe, RangeShortDateTimeFormatterPipe, RelativeDateFormatterImpurePipe, RelativeDateFormatterPipe, RelativeDateTimeFormatterImpurePipe, RelativeDateTimeFormatterPipe, RelativeShortDateFormatterImpurePipe, RelativeShortDateFormatterPipe, RelativeShortDateTimeFormatterImpurePipe, RelativeShortDateTimeFormatterPipe,
|
|
3912
|
+
export { ARROW_BOTTOM_MARGIN_AND_HALF_HEIGHT, AbsoluteDateFormatterImpurePipe, AbsoluteDateFormatterPipe, AbsoluteDateShortFormatterImpurePipe, AbsoluteDateShortFormatterPipe, AbsoluteDateTimeFormatterImpurePipe, AbsoluteDateTimeFormatterPipe, AbsoluteShortDateTimeFormatterImpurePipe, AbsoluteShortDateTimeFormatterPipe, AnimationCurves, BOTTOM_LEFT_POSITION_PRIORITY, BOTTOM_POSITION_PRIORITY, BOTTOM_RIGHT_POSITION_PRIORITY, BaseFormatterPipe, DateAdapter, DateFormatter, EXTENDED_OVERLAY_POSITIONS, ErrorStateMatcher, FileValidators, KBQ_CUSTOM_SCROLL_STRATEGY_PROVIDER, KBQ_DATE_FORMATS, KBQ_DATE_LOCALE, KBQ_DATE_LOCALE_FACTORY, KBQ_DEFAULT_LOCALE_DATA_FACTORY, KBQ_DEFAULT_LOCALE_ID, KBQ_FORM_FIELD_REF, KBQ_LOCALE_DATA, KBQ_LOCALE_ID, KBQ_LOCALE_SERVICE, KBQ_NUMBER_FORMATTER_DEFAULT_OPTIONS, KBQ_NUMBER_FORMATTER_OPTIONS, KBQ_OPTION_ACTION_PARENT, KBQ_OPTION_PARENT_COMPONENT, KBQ_PARENT_ANIMATION_COMPONENT, KBQ_PARENT_POPUP, KBQ_SANITY_CHECKS, KBQ_SELECT_SCROLL_STRATEGY, KBQ_SELECT_SCROLL_STRATEGY_PROVIDER, KBQ_SIZE_UNITS_CONFIG, KBQ_SIZE_UNITS_DEFAULT_CONFIG, KBQ_TITLE_TEXT_REF, KBQ_VALIDATION, KbqAbstractSelect, KbqCommonModule, KbqComponentColors, KbqDataSizePipe, KbqDecimalPipe, KbqDefaultThemes, KbqForm, KbqFormElement, KbqFormattersModule, KbqFormsModule, KbqHighlightModule, KbqHighlightPipe, KbqLine, KbqLineModule, KbqLineSetter, KbqLocaleService, KbqLocaleServiceModule, KbqMeasureScrollbarService, KbqOptgroup, KbqOptgroupBase, KbqOptgroupMixinBase, KbqOption, KbqOptionActionBase, KbqOptionActionComponent, KbqOptionActionMixinBase, KbqOptionBase, KbqOptionModule, KbqOptionSelectionChange, KbqPopUp, KbqPopUpTrigger, KbqPseudoCheckbox, KbqPseudoCheckboxBase, KbqPseudoCheckboxMixinBase, KbqPseudoCheckboxModule, KbqRoundDecimalPipe, KbqSelectFooter, KbqSelectMatcher, KbqSelectSearch, KbqSelectSearchEmptyResult, KbqSelectTrigger, KbqTableNumberPipe, KbqThemeSelector, KbqVirtualOption, LEFT_BOTTOM_POSITION_PRIORITY, LEFT_POSITION_PRIORITY, LEFT_TOP_POSITION_PRIORITY, MeasurementSystem, MultipleMode, NUMBER_FORMAT_REGEXP, POSITION_MAP, POSITION_PRIORITY_STRATEGY, POSITION_TO_CSS_MAP, PasswordValidators, PopUpPlacements, PopUpSizes, PopUpTriggers, PopUpVisibility, RIGHT_BOTTOM_POSITION_PRIORITY, RIGHT_POSITION_PRIORITY, RIGHT_TOP_POSITION_PRIORITY, RangeDateFormatterImpurePipe, RangeDateFormatterPipe, RangeDateTimeFormatterImpurePipe, RangeDateTimeFormatterPipe, RangeMiddleDateTimeFormatterImpurePipe, RangeMiddleDateTimeFormatterPipe, RangeShortDateFormatterImpurePipe, RangeShortDateFormatterPipe, RangeShortDateTimeFormatterImpurePipe, RangeShortDateTimeFormatterPipe, RelativeDateFormatterImpurePipe, RelativeDateFormatterPipe, RelativeDateTimeFormatterImpurePipe, RelativeDateTimeFormatterPipe, RelativeShortDateFormatterImpurePipe, RelativeShortDateFormatterPipe, RelativeShortDateTimeFormatterImpurePipe, RelativeShortDateTimeFormatterPipe, SELECT_PANEL_VIEWPORT_PADDING, ShowOnControlDirtyErrorStateMatcher, ShowOnFormSubmitErrorStateMatcher, TOP_LEFT_POSITION_PRIORITY, TOP_POSITION_PRIORITY, TOP_RIGHT_POSITION_PRIORITY, ThemePalette, ThemeService, VERSION, applyPopupMargins, checkAndNormalizeLocalizedNumber, countGroupLabelsBeforeOption, defaultOffsetY, enUSFormattersData, enUSLocaleData, esLAFormattersData, esLALocaleData, escapeRegExp, faIRFormattersData, faIRLocaleData, fadeAnimation, formatDataSize, getHumanizedBytes, getKbqSelectDynamicMultipleError, getKbqSelectNonArrayValueError, getKbqSelectNonFunctionValueError, getOptionScrollPosition, isBoolean, isWithin, kbqErrorStateMatcherProvider, kbqSelectAnimations, kbqSelectScrollStrategyProviderFactory, mixinColor, mixinDisabled, mixinErrorState, mixinTabIndex, normalizeNumber, ptBRFormattersData, ptBRLocaleData, ruRUFormattersData, ruRULocaleData, selectEvents, tkTMFormattersData, tkTMLocaleData, toBoolean, validationTooltipHideDelay, validationTooltipShowDelay, zhCNFormattersData, zhCNLocaleData };
|
|
3735
3913
|
//# sourceMappingURL=koobiq-components-core.mjs.map
|