@mesgflow/ui-kit 0.6.0 → 0.8.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/README.md +56 -5
- package/fesm2022/mesgflow-ui-kit-accordion.mjs +9 -8
- package/fesm2022/mesgflow-ui-kit-accordion.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-agenda.mjs +208 -0
- package/fesm2022/mesgflow-ui-kit-agenda.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-alert.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-aspect-ratio.mjs +37 -0
- package/fesm2022/mesgflow-ui-kit-aspect-ratio.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-avatar-group.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-avatar.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-badge.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-banner.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-blocks.mjs +207 -0
- package/fesm2022/mesgflow-ui-kit-blocks.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-box-input.mjs +4 -4
- package/fesm2022/mesgflow-ui-kit-box-input.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-brand.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-breadcrumb.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-button-group.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-button.mjs +190 -244
- package/fesm2022/mesgflow-ui-kit-button.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-card.mjs +48 -27
- package/fesm2022/mesgflow-ui-kit-card.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-carousel.mjs +308 -0
- package/fesm2022/mesgflow-ui-kit-carousel.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-chart.mjs +12 -12
- package/fesm2022/mesgflow-ui-kit-checkbox.mjs +18 -23
- package/fesm2022/mesgflow-ui-kit-checkbox.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-chip.mjs +5 -5
- package/fesm2022/mesgflow-ui-kit-chip.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-code-block.mjs +11 -7
- package/fesm2022/mesgflow-ui-kit-code-block.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-collapsible.mjs +9 -9
- package/fesm2022/mesgflow-ui-kit-color-picker.mjs +9 -7
- package/fesm2022/mesgflow-ui-kit-color-picker.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-combobox.mjs +147 -67
- package/fesm2022/mesgflow-ui-kit-combobox.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-command.mjs +15 -16
- package/fesm2022/mesgflow-ui-kit-command.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-context-menu.mjs +7 -9
- package/fesm2022/mesgflow-ui-kit-context-menu.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-copy-button.mjs +6 -6
- package/fesm2022/mesgflow-ui-kit-core.mjs +446 -128
- package/fesm2022/mesgflow-ui-kit-core.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-countdown.mjs +149 -0
- package/fesm2022/mesgflow-ui-kit-countdown.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-date-picker.mjs +140 -19
- package/fesm2022/mesgflow-ui-kit-date-picker.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-description-list.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-dialog.mjs +310 -64
- package/fesm2022/mesgflow-ui-kit-dialog.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-divider.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-drawer.mjs +109 -0
- package/fesm2022/mesgflow-ui-kit-drawer.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-dropzone.mjs +6 -6
- package/fesm2022/mesgflow-ui-kit-dropzone.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-empty-state.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-field.mjs +55 -14
- package/fesm2022/mesgflow-ui-kit-field.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-file-upload.mjs +356 -0
- package/fesm2022/mesgflow-ui-kit-file-upload.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-hover-card.mjs +6 -6
- package/fesm2022/mesgflow-ui-kit-i18n-tr.mjs +135 -0
- package/fesm2022/mesgflow-ui-kit-i18n-tr.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-icon.mjs +8 -3
- package/fesm2022/mesgflow-ui-kit-icon.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-icons-lucide.mjs +371 -0
- package/fesm2022/mesgflow-ui-kit-icons-lucide.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-inline-edit.mjs +279 -0
- package/fesm2022/mesgflow-ui-kit-inline-edit.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-input.mjs +162 -19
- package/fesm2022/mesgflow-ui-kit-input.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-kbd.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-lightbox.mjs +299 -0
- package/fesm2022/mesgflow-ui-kit-lightbox.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-link.mjs +5 -5
- package/fesm2022/mesgflow-ui-kit-link.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-listbox.mjs +151 -0
- package/fesm2022/mesgflow-ui-kit-listbox.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-mention.mjs +283 -0
- package/fesm2022/mesgflow-ui-kit-mention.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-menu.mjs +178 -14
- package/fesm2022/mesgflow-ui-kit-menu.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-nav-menu.mjs +276 -0
- package/fesm2022/mesgflow-ui-kit-nav-menu.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-notification-center.mjs +281 -0
- package/fesm2022/mesgflow-ui-kit-notification-center.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-number-input.mjs +9 -6
- package/fesm2022/mesgflow-ui-kit-number-input.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-otp-input.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-page-header.mjs +6 -6
- package/fesm2022/mesgflow-ui-kit-pagination.mjs +7 -6
- package/fesm2022/mesgflow-ui-kit-pagination.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-password-input.mjs +38 -68
- package/fesm2022/mesgflow-ui-kit-password-input.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-popover.mjs +12 -52
- package/fesm2022/mesgflow-ui-kit-popover.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-progress.mjs +164 -23
- package/fesm2022/mesgflow-ui-kit-progress.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-qr-code.mjs +766 -0
- package/fesm2022/mesgflow-ui-kit-qr-code.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-radio.mjs +10 -12
- package/fesm2022/mesgflow-ui-kit-radio.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-rating.mjs +4 -4
- package/fesm2022/mesgflow-ui-kit-rating.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-scroll-area.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-search-input.mjs +11 -7
- package/fesm2022/mesgflow-ui-kit-search-input.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-segmented-control.mjs +15 -11
- package/fesm2022/mesgflow-ui-kit-segmented-control.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-select.mjs +6 -5
- package/fesm2022/mesgflow-ui-kit-select.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-sidebar.mjs +24 -21
- package/fesm2022/mesgflow-ui-kit-sidebar.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-skeleton.mjs +6 -5
- package/fesm2022/mesgflow-ui-kit-skeleton.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-slider.mjs +253 -6
- package/fesm2022/mesgflow-ui-kit-slider.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-sortable.mjs +526 -0
- package/fesm2022/mesgflow-ui-kit-sortable.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-spinner.mjs +44 -15
- package/fesm2022/mesgflow-ui-kit-spinner.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-split-button.mjs +205 -0
- package/fesm2022/mesgflow-ui-kit-split-button.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-splitter.mjs +213 -6
- package/fesm2022/mesgflow-ui-kit-splitter.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-stat-tile.mjs +13 -6
- package/fesm2022/mesgflow-ui-kit-stat-tile.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-stepper.mjs +171 -64
- package/fesm2022/mesgflow-ui-kit-stepper.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-switch.mjs +4 -4
- package/fesm2022/mesgflow-ui-kit-switch.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-table.mjs +34 -28
- package/fesm2022/mesgflow-ui-kit-table.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-tabs.mjs +421 -180
- package/fesm2022/mesgflow-ui-kit-tabs.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-tag-input.mjs +9 -4
- package/fesm2022/mesgflow-ui-kit-tag-input.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-theme-switcher.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-theming.mjs +7 -7
- package/fesm2022/mesgflow-ui-kit-theming.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-time-picker.mjs +6 -6
- package/fesm2022/mesgflow-ui-kit-time-picker.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-timeline.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-toast.mjs +118 -35
- package/fesm2022/mesgflow-ui-kit-toast.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-toggle.mjs +12 -11
- package/fesm2022/mesgflow-ui-kit-toggle.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-toolbar.mjs +13 -11
- package/fesm2022/mesgflow-ui-kit-toolbar.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-tooltip.mjs +76 -53
- package/fesm2022/mesgflow-ui-kit-tooltip.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-tour.mjs +17 -29
- package/fesm2022/mesgflow-ui-kit-tour.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-transfer-list.mjs +288 -0
- package/fesm2022/mesgflow-ui-kit-transfer-list.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-tree-select.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-tree.mjs +4 -4
- package/fesm2022/mesgflow-ui-kit-tree.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-virtual-list.mjs +109 -0
- package/fesm2022/mesgflow-ui-kit-virtual-list.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit.mjs +93 -12836
- package/fesm2022/mesgflow-ui-kit.mjs.map +1 -1
- package/package.json +91 -3
- package/schematics/collection.json +10 -0
- package/schematics/migration.json +10 -0
- package/schematics/migrations/v0-7.cjs +70 -0
- package/schematics/ng-add/index.cjs +234 -0
- package/schematics/ng-add/schema.json +43 -0
- package/tokens/color.css +96 -0
- package/tokens/controls.css +145 -0
- package/tokens/elevation.css +62 -6
- package/tokens/motion.css +304 -66
- package/tokens/radius.css +14 -0
- package/tokens.css +1 -0
- package/tokens.json +1583 -0
- package/types/mesgflow-ui-kit-agenda.d.ts +49 -0
- package/types/mesgflow-ui-kit-aspect-ratio.d.ts +18 -0
- package/types/mesgflow-ui-kit-blocks.d.ts +128 -0
- package/types/mesgflow-ui-kit-button.d.ts +23 -38
- package/types/mesgflow-ui-kit-card.d.ts +26 -16
- package/types/mesgflow-ui-kit-carousel.d.ts +51 -0
- package/types/mesgflow-ui-kit-checkbox.d.ts +8 -5
- package/types/mesgflow-ui-kit-code-block.d.ts +4 -1
- package/types/mesgflow-ui-kit-combobox.d.ts +47 -22
- package/types/mesgflow-ui-kit-command.d.ts +2 -2
- package/types/mesgflow-ui-kit-core.d.ts +279 -21
- package/types/mesgflow-ui-kit-countdown.d.ts +47 -0
- package/types/mesgflow-ui-kit-date-picker.d.ts +31 -1
- package/types/mesgflow-ui-kit-dialog.d.ts +122 -14
- package/types/mesgflow-ui-kit-drawer.d.ts +45 -0
- package/types/mesgflow-ui-kit-field.d.ts +17 -8
- package/types/mesgflow-ui-kit-file-upload.d.ts +64 -0
- package/types/mesgflow-ui-kit-hover-card.d.ts +2 -2
- package/types/mesgflow-ui-kit-icons-lucide.d.ts +27 -0
- package/types/mesgflow-ui-kit-inline-edit.d.ts +42 -0
- package/types/mesgflow-ui-kit-input.d.ts +64 -2
- package/types/mesgflow-ui-kit-lightbox.d.ts +54 -0
- package/types/mesgflow-ui-kit-listbox.d.ts +30 -0
- package/types/mesgflow-ui-kit-mention.d.ts +59 -0
- package/types/mesgflow-ui-kit-menu.d.ts +41 -2
- package/types/mesgflow-ui-kit-nav-menu.d.ts +58 -0
- package/types/mesgflow-ui-kit-notification-center.d.ts +41 -0
- package/types/mesgflow-ui-kit-number-input.d.ts +3 -1
- package/types/mesgflow-ui-kit-password-input.d.ts +35 -5
- package/types/mesgflow-ui-kit-popover.d.ts +13 -5
- package/types/mesgflow-ui-kit-progress.d.ts +33 -12
- package/types/mesgflow-ui-kit-qr-code.d.ts +160 -0
- package/types/mesgflow-ui-kit-radio.d.ts +2 -2
- package/types/mesgflow-ui-kit-search-input.d.ts +3 -1
- package/types/mesgflow-ui-kit-segmented-control.d.ts +4 -0
- package/types/mesgflow-ui-kit-sidebar.d.ts +1 -1
- package/types/mesgflow-ui-kit-slider.d.ts +60 -1
- package/types/mesgflow-ui-kit-sortable.d.ts +103 -0
- package/types/mesgflow-ui-kit-spinner.d.ts +5 -8
- package/types/mesgflow-ui-kit-split-button.d.ts +47 -0
- package/types/mesgflow-ui-kit-splitter.d.ts +64 -1
- package/types/mesgflow-ui-kit-stat-tile.d.ts +3 -0
- package/types/mesgflow-ui-kit-stepper.d.ts +54 -32
- package/types/mesgflow-ui-kit-table.d.ts +2 -0
- package/types/mesgflow-ui-kit-tabs.d.ts +193 -93
- package/types/mesgflow-ui-kit-tag-input.d.ts +3 -1
- package/types/mesgflow-ui-kit-toast.d.ts +48 -22
- package/types/mesgflow-ui-kit-tooltip.d.ts +15 -12
- package/types/mesgflow-ui-kit-transfer-list.d.ts +34 -0
- package/types/mesgflow-ui-kit-virtual-list.d.ts +35 -0
- package/types/mesgflow-ui-kit.d.ts +88 -5444
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, inject, computed, Component } from '@angular/core';
|
|
3
3
|
import { MF_COMMON_LABELS, cn } from '@mesgflow/ui-kit/core';
|
|
4
|
-
import { Icon } from '@mesgflow/ui-kit/icon';
|
|
5
4
|
|
|
6
5
|
const SIZE_PX = { xs: 14, sm: 16, md: 20, lg: 24 };
|
|
7
6
|
const TONE_CLASS = {
|
|
@@ -16,15 +15,12 @@ const TONE_CLASS = {
|
|
|
16
15
|
help: 'text-help',
|
|
17
16
|
};
|
|
18
17
|
/**
|
|
19
|
-
* `<mf-spinner size="sm" />` — dönen yüklenme göstergesi
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* görsel dil konuşuyor.
|
|
18
|
+
* `<mf-spinner size="sm" />` — dönen yüklenme göstergesi: iki katmanlı SVG
|
|
19
|
+
* halka (soluk iz + dönen yay). v0.7 öncesi Material Symbols ligature'ıydı —
|
|
20
|
+
* font yüklenene kadar "progress_activity" METNİ görünüyordu (FOUT) ve
|
|
21
|
+
* ikon seti değişince (Lucide) kırılıyordu; SVG her ikisinden bağımsız.
|
|
24
22
|
*
|
|
25
|
-
* `role="status"` + `aria-label` HOST'ta
|
|
26
|
-
* gereği her zaman `aria-hidden` — bkz. icon.ts) — ekran okuyucu ligature
|
|
27
|
-
* kaynak metnini ("progress_activity") DEĞİL, buradaki anlamlı etiketi anons eder.
|
|
23
|
+
* `role="status"` + `aria-label` HOST'ta, SVG `aria-hidden`.
|
|
28
24
|
*/
|
|
29
25
|
class Spinner {
|
|
30
26
|
size = input('md', /* @ts-ignore */
|
|
@@ -39,23 +35,56 @@ class Spinner {
|
|
|
39
35
|
...(ngDevMode ? [{ debugName: "effectiveAriaLabel" }] : /* istanbul ignore next */ []));
|
|
40
36
|
sizePx = computed(() => SIZE_PX[this.size()], /* @ts-ignore */
|
|
41
37
|
...(ngDevMode ? [{ debugName: "sizePx" }] : /* istanbul ignore next */ []));
|
|
42
|
-
iconClasses = computed(() => cn('animate-spin', TONE_CLASS[this.tone()]), /* @ts-ignore */
|
|
38
|
+
iconClasses = computed(() => cn('block animate-spin', TONE_CLASS[this.tone()]), /* @ts-ignore */
|
|
43
39
|
...(ngDevMode ? [{ debugName: "iconClasses" }] : /* istanbul ignore next */ []));
|
|
44
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
45
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.
|
|
40
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: Spinner, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
41
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: Spinner, isStandalone: true, selector: "mf-spinner", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "status" }, properties: { "attr.aria-label": "effectiveAriaLabel()" }, classAttribute: "inline-flex" }, exportAs: ["mfSpinner"], ngImport: i0, template: `
|
|
42
|
+
<svg
|
|
43
|
+
aria-hidden="true"
|
|
44
|
+
viewBox="0 0 24 24"
|
|
45
|
+
fill="none"
|
|
46
|
+
[attr.width]="sizePx()"
|
|
47
|
+
[attr.height]="sizePx()"
|
|
48
|
+
[class]="iconClasses()"
|
|
49
|
+
>
|
|
50
|
+
<circle cx="12" cy="12" r="9" stroke="currentColor" stroke-opacity="0.2" stroke-width="2.5" />
|
|
51
|
+
<path
|
|
52
|
+
d="M21 12a9 9 0 0 0-9-9"
|
|
53
|
+
stroke="currentColor"
|
|
54
|
+
stroke-width="2.5"
|
|
55
|
+
stroke-linecap="round"
|
|
56
|
+
/>
|
|
57
|
+
</svg>
|
|
58
|
+
`, isInline: true });
|
|
46
59
|
}
|
|
47
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: Spinner, decorators: [{
|
|
48
61
|
type: Component,
|
|
49
62
|
args: [{
|
|
50
63
|
selector: 'mf-spinner',
|
|
51
64
|
exportAs: 'mfSpinner',
|
|
52
|
-
imports: [Icon],
|
|
53
65
|
host: {
|
|
54
66
|
class: 'inline-flex',
|
|
55
67
|
role: 'status',
|
|
56
68
|
'[attr.aria-label]': 'effectiveAriaLabel()',
|
|
57
69
|
},
|
|
58
|
-
template:
|
|
70
|
+
template: `
|
|
71
|
+
<svg
|
|
72
|
+
aria-hidden="true"
|
|
73
|
+
viewBox="0 0 24 24"
|
|
74
|
+
fill="none"
|
|
75
|
+
[attr.width]="sizePx()"
|
|
76
|
+
[attr.height]="sizePx()"
|
|
77
|
+
[class]="iconClasses()"
|
|
78
|
+
>
|
|
79
|
+
<circle cx="12" cy="12" r="9" stroke="currentColor" stroke-opacity="0.2" stroke-width="2.5" />
|
|
80
|
+
<path
|
|
81
|
+
d="M21 12a9 9 0 0 0-9-9"
|
|
82
|
+
stroke="currentColor"
|
|
83
|
+
stroke-width="2.5"
|
|
84
|
+
stroke-linecap="round"
|
|
85
|
+
/>
|
|
86
|
+
</svg>
|
|
87
|
+
`,
|
|
59
88
|
}]
|
|
60
89
|
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
61
90
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mesgflow-ui-kit-spinner.mjs","sources":["../../../projects/ui-kit/spinner/spinner.ts","../../../projects/ui-kit/spinner/mesgflow-ui-kit-spinner.ts"],"sourcesContent":["import { Component, computed, inject, input } from '@angular/core';\r\nimport { cn, MF_COMMON_LABELS, type MfSize, type MfTone } from '@mesgflow/ui-kit/core';\r\
|
|
1
|
+
{"version":3,"file":"mesgflow-ui-kit-spinner.mjs","sources":["../../../projects/ui-kit/spinner/spinner.ts","../../../projects/ui-kit/spinner/mesgflow-ui-kit-spinner.ts"],"sourcesContent":["import { Component, computed, inject, input } from '@angular/core';\r\nimport { cn, MF_COMMON_LABELS, type MfSize, type MfTone } from '@mesgflow/ui-kit/core';\r\n\r\nexport type SpinnerSize = 'xs' | MfSize;\r\nexport type SpinnerTone = MfTone | 'current';\r\n\r\nconst SIZE_PX: Record<SpinnerSize, number> = { xs: 14, sm: 16, md: 20, lg: 24 };\r\n\r\nconst TONE_CLASS: Record<SpinnerTone, string> = {\r\n /** Ambient metin rengini MİRAS ALIR — ör. dolu bir butonun içine gömülü spinner, butonun kendi `text-fg-on-accent`'ini otomatik kullanır. Varsayılan. */\r\n current: 'text-current',\r\n neutral: 'text-fg-subtle',\r\n primary: 'text-accent',\r\n success: 'text-success',\r\n warning: 'text-warning',\r\n danger: 'text-danger',\r\n info: 'text-info',\r\n help: 'text-help',\r\n};\r\n\r\n/**\r\n * `<mf-spinner size=\"sm\" />` — dönen yüklenme göstergesi: iki katmanlı SVG\r\n * halka (soluk iz + dönen yay). v0.7 öncesi Material Symbols ligature'ıydı —\r\n * font yüklenene kadar \"progress_activity\" METNİ görünüyordu (FOUT) ve\r\n * ikon seti değişince (Lucide) kırılıyordu; SVG her ikisinden bağımsız.\r\n *\r\n * `role=\"status\"` + `aria-label` HOST'ta, SVG `aria-hidden`.\r\n */\r\n@Component({\r\n selector: 'mf-spinner',\r\n exportAs: 'mfSpinner',\r\n host: {\r\n class: 'inline-flex',\r\n role: 'status',\r\n '[attr.aria-label]': 'effectiveAriaLabel()',\r\n },\r\n template: `\r\n <svg\r\n aria-hidden=\"true\"\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n [attr.width]=\"sizePx()\"\r\n [attr.height]=\"sizePx()\"\r\n [class]=\"iconClasses()\"\r\n >\r\n <circle cx=\"12\" cy=\"12\" r=\"9\" stroke=\"currentColor\" stroke-opacity=\"0.2\" stroke-width=\"2.5\" />\r\n <path\r\n d=\"M21 12a9 9 0 0 0-9-9\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2.5\"\r\n stroke-linecap=\"round\"\r\n />\r\n </svg>\r\n `,\r\n})\r\nexport class Spinner {\r\n readonly size = input<SpinnerSize>('md');\r\n readonly tone = input<SpinnerTone>('current');\r\n /** Verilmezse `MF_COMMON_LABELS`'ın `loading`'i kullanılır (bkz. `provideMesgflowUi`). */\r\n readonly ariaLabel = input<string>();\r\n\r\n private readonly commonLabels = inject(MF_COMMON_LABELS);\r\n protected readonly effectiveAriaLabel = computed(\r\n () => this.ariaLabel() ?? this.commonLabels().loading,\r\n );\r\n\r\n protected readonly sizePx = computed(() => SIZE_PX[this.size()]);\r\n protected readonly iconClasses = computed(() =>\r\n cn('block animate-spin', TONE_CLASS[this.tone()]),\r\n );\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"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import * as i1 from '@angular/cdk/overlay';
|
|
2
|
+
import { OverlayModule } from '@angular/cdk/overlay';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { input, booleanAttribute, output, inject, computed, Component } from '@angular/core';
|
|
5
|
+
import { Button } from '@mesgflow/ui-kit/button';
|
|
6
|
+
import { MF_SPLIT_BUTTON_LABELS, cn } from '@mesgflow/ui-kit/core';
|
|
7
|
+
import { Icon } from '@mesgflow/ui-kit/icon';
|
|
8
|
+
import { Menu, MenuItem, MenuTrigger } from '@mesgflow/ui-kit/menu';
|
|
9
|
+
import { Popover } from '@mesgflow/ui-kit/popover';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* `<mf-split-button label="Kaydet" [items]="more" (primaryClick)="save()" (itemSelect)="run($event)" />`
|
|
13
|
+
*
|
|
14
|
+
* Birincil eylem + ilgili ikincil eylemler menüsü (GitHub "Merge ▾", Gmail
|
|
15
|
+
* "Gönder ▾"). İki gerçek düğme: soldaki eylemi çalıştırır, sağdaki
|
|
16
|
+
* (`aria-haspopup="menu"`) menüyü açar — ekran okuyucu ikisini ayrı duyurur.
|
|
17
|
+
*
|
|
18
|
+
* Menü `@angular/aria/menu` (ok tuşları, typeahead, Escape) + `mf-popover`
|
|
19
|
+
* (tetikleyiciden büyüyen panel). Öğeler VERİ olarak verilir: `mfMenuItem`
|
|
20
|
+
* içerik projeksiyonuyla aria menüsüne bağlanamadığı için bu bileşen onları
|
|
21
|
+
* kendi şablonunda çizer.
|
|
22
|
+
*/
|
|
23
|
+
class SplitButton {
|
|
24
|
+
label = input.required(/* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
26
|
+
items = input.required(/* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
28
|
+
icon = input('', /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
30
|
+
tone = input('primary', /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "tone" }] : /* istanbul ignore next */ []));
|
|
32
|
+
appearance = input('filled', /* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
34
|
+
size = input('md', /* @ts-ignore */
|
|
35
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
36
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
37
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
38
|
+
/** Menü düğmesinin erişilebilir adı — verilmezse `MF_SPLIT_BUTTON_LABELS`. */
|
|
39
|
+
menuLabel = input(/* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [undefined, { debugName: "menuLabel" }] : /* istanbul ignore next */ []));
|
|
41
|
+
primaryClick = output();
|
|
42
|
+
itemSelect = output();
|
|
43
|
+
labels = inject(MF_SPLIT_BUTTON_LABELS);
|
|
44
|
+
effectiveMenuLabel = computed(() => this.menuLabel() ?? this.labels().moreActions, /* @ts-ignore */
|
|
45
|
+
...(ngDevMode ? [{ debugName: "effectiveMenuLabel" }] : /* istanbul ignore next */ []));
|
|
46
|
+
/** Bitişik iki düğme: iç köşeler kare, ayırıcı çizgi (dolu görünümde açık ton). */
|
|
47
|
+
primaryClass = computed(() => cn('rounded-e-none'), /* @ts-ignore */
|
|
48
|
+
...(ngDevMode ? [{ debugName: "primaryClass" }] : /* istanbul ignore next */ []));
|
|
49
|
+
toggleClass = computed(() => cn('rounded-s-none px-2', this.appearance() === 'filled' || this.appearance() === 'soft'
|
|
50
|
+
? 'border-s-white/20 dark:border-s-black/20'
|
|
51
|
+
: '-ms-px'), /* @ts-ignore */
|
|
52
|
+
...(ngDevMode ? [{ debugName: "toggleClass" }] : /* istanbul ignore next */ []));
|
|
53
|
+
onSelect(value) {
|
|
54
|
+
this.itemSelect.emit(value);
|
|
55
|
+
}
|
|
56
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SplitButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
57
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: SplitButton, isStandalone: true, selector: "mf-split-button", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, menuLabel: { classPropertyName: "menuLabel", publicName: "menuLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { primaryClick: "primaryClick", itemSelect: "itemSelect" }, host: { classAttribute: "inline-flex" }, exportAs: ["mfSplitButton"], ngImport: i0, template: `
|
|
58
|
+
<div class="inline-flex" role="group" [attr.aria-label]="label()">
|
|
59
|
+
<button
|
|
60
|
+
mfButton
|
|
61
|
+
type="button"
|
|
62
|
+
[tone]="tone()"
|
|
63
|
+
[appearance]="appearance()"
|
|
64
|
+
[size]="size()"
|
|
65
|
+
[iconStart]="icon()"
|
|
66
|
+
[loading]="loading()"
|
|
67
|
+
[disabled]="disabled()"
|
|
68
|
+
[class]="primaryClass()"
|
|
69
|
+
(click)="primaryClick.emit()"
|
|
70
|
+
>
|
|
71
|
+
{{ label() }}
|
|
72
|
+
</button>
|
|
73
|
+
<button
|
|
74
|
+
mfButton
|
|
75
|
+
type="button"
|
|
76
|
+
cdkOverlayOrigin
|
|
77
|
+
#origin="cdkOverlayOrigin"
|
|
78
|
+
mfMenuTrigger
|
|
79
|
+
#trigger="ngMenuTrigger"
|
|
80
|
+
[menu]="menuRef"
|
|
81
|
+
[tone]="tone()"
|
|
82
|
+
[appearance]="appearance()"
|
|
83
|
+
[size]="size()"
|
|
84
|
+
[disabled]="disabled()"
|
|
85
|
+
[class]="toggleClass()"
|
|
86
|
+
[attr.aria-label]="effectiveMenuLabel()"
|
|
87
|
+
>
|
|
88
|
+
<span
|
|
89
|
+
mfIcon
|
|
90
|
+
[size]="16"
|
|
91
|
+
class="transition-transform duration-fast ease-emphasis"
|
|
92
|
+
[class.rotate-180]="trigger.expanded()"
|
|
93
|
+
>expand_more</span
|
|
94
|
+
>
|
|
95
|
+
</button>
|
|
96
|
+
</div>
|
|
97
|
+
<mf-popover
|
|
98
|
+
[origin]="origin"
|
|
99
|
+
[open]="trigger.expanded()"
|
|
100
|
+
(closed)="trigger.close()"
|
|
101
|
+
placement="bottom-end"
|
|
102
|
+
padding="none"
|
|
103
|
+
>
|
|
104
|
+
<mf-menu #menuRef="ngMenu" (itemSelected)="onSelect($event); trigger.close()">
|
|
105
|
+
@for (item of items(); track item.value) {
|
|
106
|
+
<button
|
|
107
|
+
mfMenuItem
|
|
108
|
+
[value]="item.value"
|
|
109
|
+
[disabled]="!!item.disabled"
|
|
110
|
+
[class.text-danger]="item.danger"
|
|
111
|
+
>
|
|
112
|
+
@if (item.icon) {
|
|
113
|
+
<span mfIcon [size]="16" class="text-fg-subtle" [class.text-danger]="item.danger">{{
|
|
114
|
+
item.icon
|
|
115
|
+
}}</span>
|
|
116
|
+
}
|
|
117
|
+
{{ item.label }}
|
|
118
|
+
</button>
|
|
119
|
+
}
|
|
120
|
+
</mf-menu>
|
|
121
|
+
</mf-popover>
|
|
122
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "component", type: Button, selector: "button[mfButton], a[mfButton]", inputs: ["tone", "appearance", "size", "shape", "type", "loading", "iconStart", "iconEnd"], exportAs: ["mfButton"] }, { kind: "directive", type: Icon, selector: "span[mfIcon]", inputs: ["size", "filled"] }, { kind: "component", type: Menu, selector: "mf-menu", exportAs: ["mfMenu"] }, { kind: "directive", type: MenuItem, selector: "button[mfMenuItem], div[mfMenuItem]" }, { kind: "directive", type: MenuTrigger, selector: "[mfMenuTrigger]", exportAs: ["mfMenuTrigger"] }, { kind: "component", type: Popover, selector: "mf-popover", inputs: ["origin", "open", "placement", "padding", "hasBackdrop", "matchTriggerWidth", "panelClass"], outputs: ["openChange", "closed"], exportAs: ["mfPopover"] }] });
|
|
123
|
+
}
|
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SplitButton, decorators: [{
|
|
125
|
+
type: Component,
|
|
126
|
+
args: [{
|
|
127
|
+
selector: 'mf-split-button',
|
|
128
|
+
exportAs: 'mfSplitButton',
|
|
129
|
+
imports: [OverlayModule, Button, Icon, Menu, MenuItem, MenuTrigger, Popover],
|
|
130
|
+
host: { class: 'inline-flex' },
|
|
131
|
+
template: `
|
|
132
|
+
<div class="inline-flex" role="group" [attr.aria-label]="label()">
|
|
133
|
+
<button
|
|
134
|
+
mfButton
|
|
135
|
+
type="button"
|
|
136
|
+
[tone]="tone()"
|
|
137
|
+
[appearance]="appearance()"
|
|
138
|
+
[size]="size()"
|
|
139
|
+
[iconStart]="icon()"
|
|
140
|
+
[loading]="loading()"
|
|
141
|
+
[disabled]="disabled()"
|
|
142
|
+
[class]="primaryClass()"
|
|
143
|
+
(click)="primaryClick.emit()"
|
|
144
|
+
>
|
|
145
|
+
{{ label() }}
|
|
146
|
+
</button>
|
|
147
|
+
<button
|
|
148
|
+
mfButton
|
|
149
|
+
type="button"
|
|
150
|
+
cdkOverlayOrigin
|
|
151
|
+
#origin="cdkOverlayOrigin"
|
|
152
|
+
mfMenuTrigger
|
|
153
|
+
#trigger="ngMenuTrigger"
|
|
154
|
+
[menu]="menuRef"
|
|
155
|
+
[tone]="tone()"
|
|
156
|
+
[appearance]="appearance()"
|
|
157
|
+
[size]="size()"
|
|
158
|
+
[disabled]="disabled()"
|
|
159
|
+
[class]="toggleClass()"
|
|
160
|
+
[attr.aria-label]="effectiveMenuLabel()"
|
|
161
|
+
>
|
|
162
|
+
<span
|
|
163
|
+
mfIcon
|
|
164
|
+
[size]="16"
|
|
165
|
+
class="transition-transform duration-fast ease-emphasis"
|
|
166
|
+
[class.rotate-180]="trigger.expanded()"
|
|
167
|
+
>expand_more</span
|
|
168
|
+
>
|
|
169
|
+
</button>
|
|
170
|
+
</div>
|
|
171
|
+
<mf-popover
|
|
172
|
+
[origin]="origin"
|
|
173
|
+
[open]="trigger.expanded()"
|
|
174
|
+
(closed)="trigger.close()"
|
|
175
|
+
placement="bottom-end"
|
|
176
|
+
padding="none"
|
|
177
|
+
>
|
|
178
|
+
<mf-menu #menuRef="ngMenu" (itemSelected)="onSelect($event); trigger.close()">
|
|
179
|
+
@for (item of items(); track item.value) {
|
|
180
|
+
<button
|
|
181
|
+
mfMenuItem
|
|
182
|
+
[value]="item.value"
|
|
183
|
+
[disabled]="!!item.disabled"
|
|
184
|
+
[class.text-danger]="item.danger"
|
|
185
|
+
>
|
|
186
|
+
@if (item.icon) {
|
|
187
|
+
<span mfIcon [size]="16" class="text-fg-subtle" [class.text-danger]="item.danger">{{
|
|
188
|
+
item.icon
|
|
189
|
+
}}</span>
|
|
190
|
+
}
|
|
191
|
+
{{ item.label }}
|
|
192
|
+
</button>
|
|
193
|
+
}
|
|
194
|
+
</mf-menu>
|
|
195
|
+
</mf-popover>
|
|
196
|
+
`,
|
|
197
|
+
}]
|
|
198
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], menuLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuLabel", required: false }] }], primaryClick: [{ type: i0.Output, args: ["primaryClick"] }], itemSelect: [{ type: i0.Output, args: ["itemSelect"] }] } });
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Generated bundle index. Do not edit.
|
|
202
|
+
*/
|
|
203
|
+
|
|
204
|
+
export { SplitButton };
|
|
205
|
+
//# sourceMappingURL=mesgflow-ui-kit-split-button.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesgflow-ui-kit-split-button.mjs","sources":["../../../projects/ui-kit/split-button/split-button.ts","../../../projects/ui-kit/split-button/mesgflow-ui-kit-split-button.ts"],"sourcesContent":["import { OverlayModule } from '@angular/cdk/overlay';\r\nimport { Component, booleanAttribute, computed, inject, input, output } from '@angular/core';\r\nimport { Button, type ButtonAppearance, type ButtonTone } from '@mesgflow/ui-kit/button';\r\nimport { MF_SPLIT_BUTTON_LABELS, cn } from '@mesgflow/ui-kit/core';\r\nimport { Icon } from '@mesgflow/ui-kit/icon';\r\nimport { Menu, MenuItem, MenuTrigger } from '@mesgflow/ui-kit/menu';\r\nimport { Popover } from '@mesgflow/ui-kit/popover';\r\n\r\nexport interface SplitButtonItem<V = string> {\r\n label: string;\r\n value: V;\r\n icon?: string;\r\n disabled?: boolean;\r\n /** Tehlikeli eylem (Sil) — kırmızı metin. */\r\n danger?: boolean;\r\n}\r\n\r\n/**\r\n * `<mf-split-button label=\"Kaydet\" [items]=\"more\" (primaryClick)=\"save()\" (itemSelect)=\"run($event)\" />`\r\n *\r\n * Birincil eylem + ilgili ikincil eylemler menüsü (GitHub \"Merge ▾\", Gmail\r\n * \"Gönder ▾\"). İki gerçek düğme: soldaki eylemi çalıştırır, sağdaki\r\n * (`aria-haspopup=\"menu\"`) menüyü açar — ekran okuyucu ikisini ayrı duyurur.\r\n *\r\n * Menü `@angular/aria/menu` (ok tuşları, typeahead, Escape) + `mf-popover`\r\n * (tetikleyiciden büyüyen panel). Öğeler VERİ olarak verilir: `mfMenuItem`\r\n * içerik projeksiyonuyla aria menüsüne bağlanamadığı için bu bileşen onları\r\n * kendi şablonunda çizer.\r\n */\r\n@Component({\r\n selector: 'mf-split-button',\r\n exportAs: 'mfSplitButton',\r\n imports: [OverlayModule, Button, Icon, Menu, MenuItem, MenuTrigger, Popover],\r\n host: { class: 'inline-flex' },\r\n template: `\r\n <div class=\"inline-flex\" role=\"group\" [attr.aria-label]=\"label()\">\r\n <button\r\n mfButton\r\n type=\"button\"\r\n [tone]=\"tone()\"\r\n [appearance]=\"appearance()\"\r\n [size]=\"size()\"\r\n [iconStart]=\"icon()\"\r\n [loading]=\"loading()\"\r\n [disabled]=\"disabled()\"\r\n [class]=\"primaryClass()\"\r\n (click)=\"primaryClick.emit()\"\r\n >\r\n {{ label() }}\r\n </button>\r\n <button\r\n mfButton\r\n type=\"button\"\r\n cdkOverlayOrigin\r\n #origin=\"cdkOverlayOrigin\"\r\n mfMenuTrigger\r\n #trigger=\"ngMenuTrigger\"\r\n [menu]=\"menuRef\"\r\n [tone]=\"tone()\"\r\n [appearance]=\"appearance()\"\r\n [size]=\"size()\"\r\n [disabled]=\"disabled()\"\r\n [class]=\"toggleClass()\"\r\n [attr.aria-label]=\"effectiveMenuLabel()\"\r\n >\r\n <span\r\n mfIcon\r\n [size]=\"16\"\r\n class=\"transition-transform duration-fast ease-emphasis\"\r\n [class.rotate-180]=\"trigger.expanded()\"\r\n >expand_more</span\r\n >\r\n </button>\r\n </div>\r\n <mf-popover\r\n [origin]=\"origin\"\r\n [open]=\"trigger.expanded()\"\r\n (closed)=\"trigger.close()\"\r\n placement=\"bottom-end\"\r\n padding=\"none\"\r\n >\r\n <mf-menu #menuRef=\"ngMenu\" (itemSelected)=\"onSelect($event); trigger.close()\">\r\n @for (item of items(); track item.value) {\r\n <button\r\n mfMenuItem\r\n [value]=\"item.value\"\r\n [disabled]=\"!!item.disabled\"\r\n [class.text-danger]=\"item.danger\"\r\n >\r\n @if (item.icon) {\r\n <span mfIcon [size]=\"16\" class=\"text-fg-subtle\" [class.text-danger]=\"item.danger\">{{\r\n item.icon\r\n }}</span>\r\n }\r\n {{ item.label }}\r\n </button>\r\n }\r\n </mf-menu>\r\n </mf-popover>\r\n `,\r\n})\r\nexport class SplitButton<V = string> {\r\n readonly label = input.required<string>();\r\n readonly items = input.required<SplitButtonItem<V>[]>();\r\n readonly icon = input('');\r\n readonly tone = input<ButtonTone>('primary');\r\n readonly appearance = input<ButtonAppearance>('filled');\r\n readonly size = input<'sm' | 'md' | 'lg'>('md');\r\n readonly loading = input(false, { transform: booleanAttribute });\r\n readonly disabled = input(false, { transform: booleanAttribute });\r\n /** Menü düğmesinin erişilebilir adı — verilmezse `MF_SPLIT_BUTTON_LABELS`. */\r\n readonly menuLabel = input<string>();\r\n\r\n readonly primaryClick = output<void>();\r\n readonly itemSelect = output<V>();\r\n\r\n private readonly labels = inject(MF_SPLIT_BUTTON_LABELS);\r\n protected readonly effectiveMenuLabel = computed(\r\n () => this.menuLabel() ?? this.labels().moreActions,\r\n );\r\n\r\n /** Bitişik iki düğme: iç köşeler kare, ayırıcı çizgi (dolu görünümde açık ton). */\r\n protected readonly primaryClass = computed(() => cn('rounded-e-none'));\r\n protected readonly toggleClass = computed(() =>\r\n cn(\r\n 'rounded-s-none px-2',\r\n this.appearance() === 'filled' || this.appearance() === 'soft'\r\n ? 'border-s-white/20 dark:border-s-black/20'\r\n : '-ms-px',\r\n ),\r\n );\r\n\r\n protected onSelect(value: V): void {\r\n this.itemSelect.emit(value);\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAiBA;;;;;;;;;;;AAWG;MAyEU,WAAW,CAAA;IACb,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAU;IAChC,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAwB;IAC9C,IAAI,GAAG,KAAK,CAAC,EAAE;6EAAC;IAChB,IAAI,GAAG,KAAK,CAAa,SAAS;6EAAC;IACnC,UAAU,GAAG,KAAK,CAAmB,QAAQ;mFAAC;IAC9C,IAAI,GAAG,KAAK,CAAqB,IAAI;6EAAC;IACtC,OAAO,GAAG,KAAK,CAAC,KAAK,+EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;IACvD,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAExD,IAAA,SAAS,GAAG,KAAK;6FAAU;IAE3B,YAAY,GAAG,MAAM,EAAQ;IAC7B,UAAU,GAAG,MAAM,EAAK;AAEhB,IAAA,MAAM,GAAG,MAAM,CAAC,sBAAsB,CAAC;AACrC,IAAA,kBAAkB,GAAG,QAAQ,CAC9C,MAAM,IAAI,CAAC,SAAS,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,WAAW;2FACpD;;IAGkB,YAAY,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,gBAAgB,CAAC;qFAAC;IACnD,WAAW,GAAG,QAAQ,CAAC,MACxC,EAAE,CACA,qBAAqB,EACrB,IAAI,CAAC,UAAU,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE,KAAK;A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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiET,EAAA,CAAA;AACF,iBAAA;;;ACpGD;;AAEG;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, inject, ElementRef, linkedSignal, computed, Component } from '@angular/core';
|
|
3
|
-
import { cn, inlineStartRatio, isRtl } from '@mesgflow/ui-kit/core';
|
|
2
|
+
import { input, inject, ElementRef, linkedSignal, computed, Component, signal, model, contentChildren, effect } from '@angular/core';
|
|
3
|
+
import { cn, inlineStartRatio, isRtl, MF_PANEL_GROUP_LABELS } from '@mesgflow/ui-kit/core';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* `<mf-splitter><div splitterPane1>Sol</div><div splitterPane2>Sağ</div></mf-splitter>`
|
|
@@ -81,17 +81,224 @@ class Splitter {
|
|
|
81
81
|
this.currentSplit.set(this.max());
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
85
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.
|
|
84
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: Splitter, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
85
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: Splitter, isStandalone: true, selector: "mf-splitter", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, initialSplit: { classPropertyName: "initialSplit", publicName: "split", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, exportAs: ["mfSplitter"], ngImport: i0, template: "<div class=\"min-h-0 min-w-0 overflow-auto\" [style.flex]=\"currentSplit() + '% 0 0'\">\r\n <ng-content select=\"[splitterPane1]\" />\r\n</div>\r\n\r\n<div\r\n role=\"separator\"\r\n tabindex=\"0\"\r\n [attr.aria-orientation]=\"orientation() === 'vertical' ? 'horizontal' : 'vertical'\"\r\n [attr.aria-valuenow]=\"currentSplit()\"\r\n [attr.aria-valuemin]=\"min()\"\r\n [attr.aria-valuemax]=\"max()\"\r\n [class]=\"\r\n 'shrink-0 touch-none bg-border transition-colors duration-fast ease-emphasis hover:bg-accent focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-ring ' +\r\n (orientation() === 'vertical' ? 'h-1 w-full cursor-row-resize' : 'w-1 cursor-col-resize')\r\n \"\r\n (pointerdown)=\"onPointerDown($event)\"\r\n (pointermove)=\"onPointerMove($event)\"\r\n (pointerup)=\"onPointerUp($event)\"\r\n (keydown)=\"onKeydown($event)\"\r\n></div>\r\n\r\n<div class=\"min-h-0 min-w-0 flex-1 overflow-auto\">\r\n <ng-content select=\"[splitterPane2]\" />\r\n</div>\r\n" });
|
|
86
86
|
}
|
|
87
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
87
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: Splitter, decorators: [{
|
|
88
88
|
type: Component,
|
|
89
89
|
args: [{ selector: 'mf-splitter', exportAs: 'mfSplitter', host: { '[class]': 'hostClasses()' }, template: "<div class=\"min-h-0 min-w-0 overflow-auto\" [style.flex]=\"currentSplit() + '% 0 0'\">\r\n <ng-content select=\"[splitterPane1]\" />\r\n</div>\r\n\r\n<div\r\n role=\"separator\"\r\n tabindex=\"0\"\r\n [attr.aria-orientation]=\"orientation() === 'vertical' ? 'horizontal' : 'vertical'\"\r\n [attr.aria-valuenow]=\"currentSplit()\"\r\n [attr.aria-valuemin]=\"min()\"\r\n [attr.aria-valuemax]=\"max()\"\r\n [class]=\"\r\n 'shrink-0 touch-none bg-border transition-colors duration-fast ease-emphasis hover:bg-accent focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-ring ' +\r\n (orientation() === 'vertical' ? 'h-1 w-full cursor-row-resize' : 'w-1 cursor-col-resize')\r\n \"\r\n (pointerdown)=\"onPointerDown($event)\"\r\n (pointermove)=\"onPointerMove($event)\"\r\n (pointerup)=\"onPointerUp($event)\"\r\n (keydown)=\"onKeydown($event)\"\r\n></div>\r\n\r\n<div class=\"min-h-0 min-w-0 flex-1 overflow-auto\">\r\n <ng-content select=\"[splitterPane2]\" />\r\n</div>\r\n" }]
|
|
90
90
|
}], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], initialSplit: [{ type: i0.Input, args: [{ isSignal: true, alias: "split", required: false }] }] } });
|
|
91
91
|
|
|
92
|
+
class Panel {
|
|
93
|
+
/** % */
|
|
94
|
+
minSize = input(10, /* @ts-ignore */
|
|
95
|
+
...(ngDevMode ? [{ debugName: "minSize" }] : /* istanbul ignore next */ []));
|
|
96
|
+
/** % */
|
|
97
|
+
maxSize = input(90, /* @ts-ignore */
|
|
98
|
+
...(ngDevMode ? [{ debugName: "maxSize" }] : /* istanbul ignore next */ []));
|
|
99
|
+
/** Grup tarafından yazılır (%). */
|
|
100
|
+
size = signal(0, /* @ts-ignore */
|
|
101
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
102
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: Panel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
103
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: Panel, isStandalone: true, selector: "mf-panel", inputs: { minSize: { classPropertyName: "minSize", publicName: "minSize", isSignal: true, isRequired: false, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.flex-basis.%": "size()", "style.flex-grow": "0", "style.flex-shrink": "1" }, classAttribute: "relative min-h-0 min-w-0 overflow-auto" }, exportAs: ["mfPanel"], ngImport: i0, template: '<ng-content />', isInline: true });
|
|
104
|
+
}
|
|
105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: Panel, decorators: [{
|
|
106
|
+
type: Component,
|
|
107
|
+
args: [{
|
|
108
|
+
selector: 'mf-panel',
|
|
109
|
+
exportAs: 'mfPanel',
|
|
110
|
+
host: {
|
|
111
|
+
class: 'relative min-h-0 min-w-0 overflow-auto',
|
|
112
|
+
'[style.flex-basis.%]': 'size()',
|
|
113
|
+
'[style.flex-grow]': '0',
|
|
114
|
+
'[style.flex-shrink]': '1',
|
|
115
|
+
},
|
|
116
|
+
template: '<ng-content />',
|
|
117
|
+
}]
|
|
118
|
+
}], propDecorators: { minSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "minSize", required: false }] }], maxSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSize", required: false }] }] } });
|
|
119
|
+
/**
|
|
120
|
+
* `<mf-panel-group [(sizes)]="layout" orientation="horizontal">
|
|
121
|
+
* <mf-panel [minSize]="15">Gezgin</mf-panel>
|
|
122
|
+
* <mf-panel-resizer />
|
|
123
|
+
* <mf-panel>Editör</mf-panel>
|
|
124
|
+
* <mf-panel-resizer />
|
|
125
|
+
* <mf-panel [minSize]="20">Önizleme</mf-panel>
|
|
126
|
+
* </mf-panel-group>`
|
|
127
|
+
*
|
|
128
|
+
* N panelli yeniden boyutlandırma (IDE/e-posta editörü düzeni). `sizes`
|
|
129
|
+
* yüzde dizisi (toplam 100); her ayırıcı iki komşu paneli etkiler.
|
|
130
|
+
* Ayırıcı WAI-ARIA "Window Splitter": `role="separator"` + `aria-valuenow`
|
|
131
|
+
* (sol panelin yüzdesi) + ok tuşları (Shift ile 10), Home/End, çift tık eşitler.
|
|
132
|
+
* `minSize`/`maxSize` panel başına sınır. `sizes` verilmezse eşit bölünür.
|
|
133
|
+
*/
|
|
134
|
+
class PanelGroup {
|
|
135
|
+
sizes = model([], /* @ts-ignore */
|
|
136
|
+
...(ngDevMode ? [{ debugName: "sizes" }] : /* istanbul ignore next */ []));
|
|
137
|
+
orientation = input('horizontal', /* @ts-ignore */
|
|
138
|
+
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
139
|
+
panels = contentChildren(Panel, /* @ts-ignore */
|
|
140
|
+
...(ngDevMode ? [{ debugName: "panels" }] : /* istanbul ignore next */ []));
|
|
141
|
+
resizers = contentChildren(PanelResizer, /* @ts-ignore */
|
|
142
|
+
...(ngDevMode ? [{ debugName: "resizers" }] : /* istanbul ignore next */ []));
|
|
143
|
+
host = inject(ElementRef);
|
|
144
|
+
/** Etkin boyutlar — `sizes` panel sayısıyla uyuşmuyorsa eşit bölünmüş. */
|
|
145
|
+
resolved = computed(() => {
|
|
146
|
+
const n = this.panels().length;
|
|
147
|
+
const sizes = this.sizes();
|
|
148
|
+
if (sizes.length === n && n > 0)
|
|
149
|
+
return sizes;
|
|
150
|
+
return Array.from({ length: n }, () => 100 / Math.max(1, n));
|
|
151
|
+
}, /* @ts-ignore */
|
|
152
|
+
...(ngDevMode ? [{ debugName: "resolved" }] : /* istanbul ignore next */ []));
|
|
153
|
+
constructor() {
|
|
154
|
+
effect(() => {
|
|
155
|
+
const sizes = this.resolved();
|
|
156
|
+
this.panels().forEach((p, i) => p.size.set(sizes[i] ?? 0));
|
|
157
|
+
this.resizers().forEach((r, i) => r.index.set(i));
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/** `index` numaralı ayırıcıyı `delta` yüzde kaydırır (komşu iki panel arasında). */
|
|
161
|
+
resize(index, delta) {
|
|
162
|
+
const sizes = [...this.resolved()];
|
|
163
|
+
const a = this.panels()[index];
|
|
164
|
+
const b = this.panels()[index + 1];
|
|
165
|
+
if (!a || !b)
|
|
166
|
+
return;
|
|
167
|
+
const total = sizes[index] + sizes[index + 1];
|
|
168
|
+
const min = a.minSize();
|
|
169
|
+
const max = Math.min(a.maxSize(), total - b.minSize());
|
|
170
|
+
const next = Math.min(max, Math.max(min, Math.max(total - b.maxSize(), sizes[index] + delta)));
|
|
171
|
+
sizes[index] = +next.toFixed(2);
|
|
172
|
+
sizes[index + 1] = +(total - next).toFixed(2);
|
|
173
|
+
this.sizes.set(sizes);
|
|
174
|
+
}
|
|
175
|
+
/** İki komşuyu eşitler (çift tık). */
|
|
176
|
+
equalize(index) {
|
|
177
|
+
const sizes = this.resolved();
|
|
178
|
+
const half = (sizes[index] + sizes[index + 1]) / 2;
|
|
179
|
+
this.resize(index, half - sizes[index]);
|
|
180
|
+
}
|
|
181
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PanelGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
182
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", type: PanelGroup, isStandalone: true, selector: "mf-panel-group", inputs: { sizes: { classPropertyName: "sizes", publicName: "sizes", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sizes: "sizesChange" }, host: { properties: { "class": "'flex h-full w-full ' + (orientation() === 'vertical' ? 'flex-col' : 'flex-row')", "attr.data-orientation": "orientation()" } }, queries: [{ propertyName: "panels", predicate: Panel, isSignal: true }, { propertyName: "resizers", predicate: PanelResizer, isSignal: true }], exportAs: ["mfPanelGroup"], ngImport: i0, template: '<ng-content />', isInline: true });
|
|
183
|
+
}
|
|
184
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PanelGroup, decorators: [{
|
|
185
|
+
type: Component,
|
|
186
|
+
args: [{
|
|
187
|
+
selector: 'mf-panel-group',
|
|
188
|
+
exportAs: 'mfPanelGroup',
|
|
189
|
+
host: {
|
|
190
|
+
'[class]': "'flex h-full w-full ' + (orientation() === 'vertical' ? 'flex-col' : 'flex-row')",
|
|
191
|
+
'[attr.data-orientation]': 'orientation()',
|
|
192
|
+
},
|
|
193
|
+
template: '<ng-content />',
|
|
194
|
+
}]
|
|
195
|
+
}], ctorParameters: () => [], propDecorators: { sizes: [{ type: i0.Input, args: [{ isSignal: true, alias: "sizes", required: false }] }, { type: i0.Output, args: ["sizesChange"] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], panels: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => Panel), { isSignal: true }] }], resizers: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PanelResizer), { isSignal: true }] }] } });
|
|
196
|
+
class PanelResizer {
|
|
197
|
+
group = inject(PanelGroup);
|
|
198
|
+
labels = inject(MF_PANEL_GROUP_LABELS);
|
|
199
|
+
el = inject(ElementRef).nativeElement;
|
|
200
|
+
index = signal(0, /* @ts-ignore */
|
|
201
|
+
...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
|
|
202
|
+
startPos = 0;
|
|
203
|
+
startSize = 0;
|
|
204
|
+
dragging = false;
|
|
205
|
+
valueNow = computed(() => Math.round(this.group.resolved()[this.index()] ?? 0), /* @ts-ignore */
|
|
206
|
+
...(ngDevMode ? [{ debugName: "valueNow" }] : /* istanbul ignore next */ []));
|
|
207
|
+
valueMin = computed(() => this.group.panels()[this.index()]?.minSize() ?? 0, /* @ts-ignore */
|
|
208
|
+
...(ngDevMode ? [{ debugName: "valueMin" }] : /* istanbul ignore next */ []));
|
|
209
|
+
valueMax = computed(() => this.group.panels()[this.index()]?.maxSize() ?? 100, /* @ts-ignore */
|
|
210
|
+
...(ngDevMode ? [{ debugName: "valueMax" }] : /* istanbul ignore next */ []));
|
|
211
|
+
label = computed(() => this.labels().resize.replace('{index}', String(this.index() + 1)), /* @ts-ignore */
|
|
212
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
213
|
+
classes = computed(() => {
|
|
214
|
+
const vertical = this.group.orientation() === 'vertical';
|
|
215
|
+
return [
|
|
216
|
+
'group/resizer relative z-[1] flex shrink-0 items-center justify-center outline-none touch-none select-none',
|
|
217
|
+
'before:absolute before:rounded-full before:bg-border before:transition-colors before:duration-fast',
|
|
218
|
+
'hover:before:bg-accent focus-visible:before:bg-focus-ring active:before:bg-accent',
|
|
219
|
+
vertical
|
|
220
|
+
? 'h-2 w-full cursor-row-resize before:inset-x-0 before:top-1/2 before:h-px before:-translate-y-1/2 hover:before:h-0.5'
|
|
221
|
+
: 'h-full w-2 cursor-col-resize before:inset-0 before:mx-auto before:w-px hover:before:w-0.5',
|
|
222
|
+
].join(' ');
|
|
223
|
+
}, /* @ts-ignore */
|
|
224
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
225
|
+
onKeydown(e) {
|
|
226
|
+
const event = e;
|
|
227
|
+
const vertical = this.group.orientation() === 'vertical';
|
|
228
|
+
const rtl = !vertical && isRtl(this.el);
|
|
229
|
+
const step = event.shiftKey ? 10 : 2;
|
|
230
|
+
const grow = vertical ? 'ArrowDown' : rtl ? 'ArrowLeft' : 'ArrowRight';
|
|
231
|
+
const shrink = vertical ? 'ArrowUp' : rtl ? 'ArrowRight' : 'ArrowLeft';
|
|
232
|
+
const i = this.index();
|
|
233
|
+
if (event.key === grow)
|
|
234
|
+
this.group.resize(i, step);
|
|
235
|
+
else if (event.key === shrink)
|
|
236
|
+
this.group.resize(i, -step);
|
|
237
|
+
else if (event.key === 'Home')
|
|
238
|
+
this.group.resize(i, -100);
|
|
239
|
+
else if (event.key === 'End')
|
|
240
|
+
this.group.resize(i, 100);
|
|
241
|
+
else if (event.key === 'Enter')
|
|
242
|
+
this.group.equalize(i);
|
|
243
|
+
else
|
|
244
|
+
return;
|
|
245
|
+
event.preventDefault();
|
|
246
|
+
}
|
|
247
|
+
onPointerDown(e) {
|
|
248
|
+
const event = e;
|
|
249
|
+
this.dragging = true;
|
|
250
|
+
this.el.setPointerCapture?.(event.pointerId);
|
|
251
|
+
this.startPos = this.group.orientation() === 'vertical' ? event.clientY : event.clientX;
|
|
252
|
+
this.startSize = this.group.resolved()[this.index()] ?? 0;
|
|
253
|
+
event.preventDefault();
|
|
254
|
+
}
|
|
255
|
+
onPointerMove(e) {
|
|
256
|
+
const event = e;
|
|
257
|
+
if (!this.dragging)
|
|
258
|
+
return;
|
|
259
|
+
const rect = this.group.host.nativeElement.getBoundingClientRect();
|
|
260
|
+
const vertical = this.group.orientation() === 'vertical';
|
|
261
|
+
const px = (vertical ? event.clientY : event.clientX) - this.startPos;
|
|
262
|
+
const total = vertical ? rect.height : rect.width;
|
|
263
|
+
const dir = !vertical && isRtl(this.el) ? -1 : 1;
|
|
264
|
+
const target = this.startSize + (dir * px * 100) / total;
|
|
265
|
+
this.group.resize(this.index(), target - (this.group.resolved()[this.index()] ?? 0));
|
|
266
|
+
}
|
|
267
|
+
onPointerUp(e) {
|
|
268
|
+
const event = e;
|
|
269
|
+
this.dragging = false;
|
|
270
|
+
this.el.releasePointerCapture?.(event.pointerId);
|
|
271
|
+
}
|
|
272
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PanelResizer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
273
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.7", type: PanelResizer, isStandalone: true, selector: "mf-panel-resizer", host: { attributes: { "role": "separator", "tabindex": "0" }, listeners: { "keydown": "onKeydown($event)", "pointerdown": "onPointerDown($event)", "pointermove": "onPointerMove($event)", "pointerup": "onPointerUp($event)", "dblclick": "group.equalize(index())" }, properties: { "attr.aria-orientation": "group.orientation() === 'horizontal' ? 'vertical' : 'horizontal'", "attr.aria-valuenow": "valueNow()", "attr.aria-valuemin": "valueMin()", "attr.aria-valuemax": "valueMax()", "attr.aria-label": "label()", "class": "classes()" } }, exportAs: ["mfPanelResizer"], ngImport: i0, template: '', isInline: true });
|
|
274
|
+
}
|
|
275
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PanelResizer, decorators: [{
|
|
276
|
+
type: Component,
|
|
277
|
+
args: [{
|
|
278
|
+
selector: 'mf-panel-resizer',
|
|
279
|
+
template: '',
|
|
280
|
+
exportAs: 'mfPanelResizer',
|
|
281
|
+
host: {
|
|
282
|
+
role: 'separator',
|
|
283
|
+
tabindex: '0',
|
|
284
|
+
'[attr.aria-orientation]': "group.orientation() === 'horizontal' ? 'vertical' : 'horizontal'",
|
|
285
|
+
'[attr.aria-valuenow]': 'valueNow()',
|
|
286
|
+
'[attr.aria-valuemin]': 'valueMin()',
|
|
287
|
+
'[attr.aria-valuemax]': 'valueMax()',
|
|
288
|
+
'[attr.aria-label]': 'label()',
|
|
289
|
+
'[class]': 'classes()',
|
|
290
|
+
'(keydown)': 'onKeydown($event)',
|
|
291
|
+
'(pointerdown)': 'onPointerDown($event)',
|
|
292
|
+
'(pointermove)': 'onPointerMove($event)',
|
|
293
|
+
'(pointerup)': 'onPointerUp($event)',
|
|
294
|
+
'(dblclick)': 'group.equalize(index())',
|
|
295
|
+
},
|
|
296
|
+
}]
|
|
297
|
+
}] });
|
|
298
|
+
|
|
92
299
|
/**
|
|
93
300
|
* Generated bundle index. Do not edit.
|
|
94
301
|
*/
|
|
95
302
|
|
|
96
|
-
export { Splitter };
|
|
303
|
+
export { Panel, PanelGroup, PanelResizer, Splitter };
|
|
97
304
|
//# sourceMappingURL=mesgflow-ui-kit-splitter.mjs.map
|