@konce-pt/react 0.12.0 → 0.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/README.md +122 -64
- package/dist/accordion/accordion.d.ts +14 -6
- package/dist/accordion/accordion.js +14 -7
- package/dist/accordion/llms.txt +22 -10
- package/dist/alert/alert.d.ts +2 -2
- package/dist/alert/alert.js +2 -2
- package/dist/alert/llms.txt +10 -10
- package/dist/app-shell/app-shell.d.ts +14 -14
- package/dist/app-shell/app-shell.js +11 -11
- package/dist/app-shell/llms.txt +13 -13
- package/dist/auth/auth-types.d.ts +6 -6
- package/dist/auth/auth.d.ts +2 -2
- package/dist/auth/auth.js +7 -7
- package/dist/auth/llms.txt +9 -9
- package/dist/autocomplete/autocomplete.d.ts +19 -6
- package/dist/autocomplete/autocomplete.js +23 -10
- package/dist/autocomplete/llms.txt +16 -5
- package/dist/avatar/avatar.d.ts +6 -6
- package/dist/avatar/avatar.js +5 -5
- package/dist/avatar/llms.txt +10 -10
- package/dist/avatar-group/avatar-group.d.ts +4 -4
- package/dist/avatar-group/avatar-group.js +3 -3
- package/dist/avatar-group/llms.txt +8 -8
- package/dist/backdrop/backdrop.d.ts +7 -7
- package/dist/backdrop/backdrop.js +16 -16
- package/dist/backdrop/llms.txt +27 -27
- package/dist/badge/badge.d.ts +3 -3
- package/dist/badge/badge.js +1 -1
- package/dist/badge/llms.txt +11 -11
- package/dist/bottom-sheet/bottom-sheet.d.ts +4 -4
- package/dist/bottom-sheet/bottom-sheet.js +2 -2
- package/dist/bottom-sheet/llms.txt +9 -9
- package/dist/breadcrumb/breadcrumb.d.ts +2 -2
- package/dist/breadcrumb/breadcrumb.js +3 -3
- package/dist/breadcrumb/llms.txt +3 -3
- package/dist/button/button.d.ts +3 -3
- package/dist/button/button.js +8 -8
- package/dist/button/llms.txt +27 -19
- package/dist/button-group/button-group.d.ts +9 -9
- package/dist/button-group/button-group.js +30 -8
- package/dist/button-group/llms.txt +20 -14
- package/dist/card/card.d.ts +8 -8
- package/dist/card/card.js +6 -6
- package/dist/card/llms.txt +20 -20
- package/dist/carousel/carousel.d.ts +6 -6
- package/dist/carousel/carousel.js +4 -4
- package/dist/carousel/llms.txt +10 -10
- package/dist/charts/chart-legend.d.ts +3 -3
- package/dist/charts/chart-legend.js +1 -1
- package/dist/charts/chart-tooltip.d.ts +3 -3
- package/dist/charts/chart-tooltip.js +1 -1
- package/dist/charts/chart.d.ts +1 -1
- package/dist/charts/chart.js +8 -8
- package/dist/charts/llms.txt +6 -6
- package/dist/charts-entry/public-api.js +2 -2
- package/dist/chat/chat.d.ts +17 -10
- package/dist/chat/chat.js +42 -18
- package/dist/chat/llms.txt +32 -17
- package/dist/chat-composer/chat-composer.d.ts +17 -7
- package/dist/chat-composer/chat-composer.js +21 -8
- package/dist/chat-composer/llms.txt +20 -11
- package/dist/chat-dock/chat-dock.d.ts +11 -4
- package/dist/chat-dock/chat-dock.js +9 -6
- package/dist/chat-dock/llms.txt +15 -14
- package/dist/chat-entry/public-api.js +1 -1
- package/dist/chat-message/chat-message.d.ts +12 -5
- package/dist/chat-message/chat-message.js +17 -7
- package/dist/chat-message/llms.txt +16 -15
- package/dist/chat-typing/chat-typing.d.ts +2 -2
- package/dist/chat-typing/chat-typing.js +3 -3
- package/dist/chat-typing/llms.txt +6 -6
- package/dist/checkbox/checkbox.d.ts +13 -6
- package/dist/checkbox/checkbox.js +26 -7
- package/dist/checkbox/llms.txt +24 -12
- package/dist/chip/chip.d.ts +4 -4
- package/dist/chip/chip.js +2 -2
- package/dist/chip/llms.txt +11 -11
- package/dist/chips-input/chips-input.d.ts +4 -4
- package/dist/chips-input/chips-input.js +35 -9
- package/dist/chips-input/llms.txt +15 -8
- package/dist/clock/clock.d.ts +4 -4
- package/dist/clock/clock.js +7 -7
- package/dist/clock/llms.txt +8 -8
- package/dist/color-picker/color-picker.d.ts +6 -6
- package/dist/color-picker/color-picker.js +3 -3
- package/dist/color-picker/llms.txt +5 -5
- package/dist/confirm/confirm-container.d.ts +3 -3
- package/dist/confirm/confirm-container.js +5 -5
- package/dist/confirm/confirm-store.d.ts +4 -4
- package/dist/confirm/confirm-store.js +7 -7
- package/dist/confirm/llms.txt +6 -6
- package/dist/context-menu/context-menu.d.ts +1 -1
- package/dist/context-menu/context-menu.js +5 -5
- package/dist/context-menu/llms.txt +7 -7
- package/dist/data-table/data-table-types.d.ts +5 -5
- package/dist/data-table/data-table.d.ts +29 -8
- package/dist/data-table/data-table.js +340 -95
- package/dist/data-table/export-csv.d.ts +3 -3
- package/dist/data-table/export-csv.js +4 -4
- package/dist/data-table/llms.txt +127 -94
- package/dist/data-view/data-view.d.ts +13 -5
- package/dist/data-view/data-view.js +67 -6
- package/dist/data-view/llms.txt +29 -10
- package/dist/date-range/date-range.d.ts +9 -9
- package/dist/date-range/date-range.js +24 -24
- package/dist/date-range/llms.txt +20 -20
- package/dist/datepicker/datepicker.d.ts +10 -10
- package/dist/datepicker/datepicker.js +29 -29
- package/dist/datepicker/llms.txt +24 -24
- package/dist/dialog/dialog.d.ts +12 -7
- package/dist/dialog/dialog.js +4 -4
- package/dist/dialog/llms.txt +14 -11
- package/dist/divider/divider.d.ts +1 -1
- package/dist/divider/llms.txt +4 -4
- package/dist/drawer/drawer.d.ts +5 -5
- package/dist/drawer/drawer.js +2 -2
- package/dist/drawer/llms.txt +11 -11
- package/dist/empty/empty.d.ts +2 -2
- package/dist/empty/empty.js +1 -1
- package/dist/empty/llms.txt +9 -9
- package/dist/fab/fab.d.ts +1 -1
- package/dist/fab/fab.js +1 -1
- package/dist/fab/llms.txt +10 -6
- package/dist/fieldset/fieldset.d.ts +18 -4
- package/dist/fieldset/fieldset.js +9 -6
- package/dist/fieldset/llms.txt +26 -9
- package/dist/file-upload/file-upload.d.ts +3 -3
- package/dist/file-upload/file-upload.js +7 -7
- package/dist/file-upload/llms.txt +7 -7
- package/dist/form-field/form-field-context.d.ts +4 -4
- package/dist/form-field/form-field.d.ts +12 -4
- package/dist/form-field/form-field.js +26 -6
- package/dist/form-field/llms.txt +25 -11
- package/dist/galleria/galleria.d.ts +3 -3
- package/dist/galleria/galleria.js +5 -5
- package/dist/galleria/llms.txt +7 -7
- package/dist/grid/col.d.ts +4 -4
- package/dist/grid/col.js +2 -2
- package/dist/grid/flex.d.ts +3 -3
- package/dist/grid/flex.js +1 -1
- package/dist/grid/grid.d.ts +7 -7
- package/dist/grid/grid.js +3 -3
- package/dist/grid/layout.d.ts +2 -2
- package/dist/grid/layout.js +2 -2
- package/dist/grid/llms.txt +15 -15
- package/dist/grid-entry/public-api.js +1 -1
- package/dist/i18n/i18n-context.d.ts +3 -3
- package/dist/i18n/i18n-context.js +7 -7
- package/dist/icon/icon-registry.d.ts +3 -3
- package/dist/icon/icon-registry.js +3 -3
- package/dist/icon/icon.d.ts +4 -4
- package/dist/icon/icon.js +6 -6
- package/dist/icon/llms.txt +13 -13
- package/dist/icon-button/icon-button.d.ts +2 -2
- package/dist/icon-button/icon-button.js +1 -1
- package/dist/icon-button/llms.txt +9 -5
- package/dist/icons-entry/public-api.d.ts +2 -2
- package/dist/icons-entry/public-api.js +3 -3
- package/dist/image/image.js +1 -1
- package/dist/image/llms.txt +13 -13
- package/dist/input/input.d.ts +18 -5
- package/dist/input/input.js +21 -6
- package/dist/input/llms.txt +25 -11
- package/dist/input-mask/input-mask.d.ts +1 -1
- package/dist/input-mask/input-mask.js +2 -2
- package/dist/input-mask/llms.txt +5 -5
- package/dist/input-number/input-number.d.ts +9 -9
- package/dist/input-number/input-number.js +11 -11
- package/dist/input-number/llms.txt +14 -14
- package/dist/input-otp/input-otp.d.ts +6 -6
- package/dist/input-otp/input-otp.js +10 -10
- package/dist/input-otp/llms.txt +9 -9
- package/dist/internal/calendar-focus.d.ts +1 -1
- package/dist/internal/calendar-focus.js +3 -3
- package/dist/internal/cn.d.ts +1 -1
- package/dist/internal/mask.d.ts +2 -2
- package/dist/internal/mask.js +4 -4
- package/dist/internal/option-key.d.ts +2 -2
- package/dist/internal/option-key.js +2 -2
- package/dist/internal/option-nav.d.ts +4 -4
- package/dist/internal/option-nav.js +5 -5
- package/dist/internal/overlay-container.js +1 -1
- package/dist/internal/overlay.d.ts +3 -3
- package/dist/internal/overlay.js +8 -8
- package/dist/internal/password-strength.d.ts +2 -2
- package/dist/internal/password-strength.js +6 -6
- package/dist/internal/roving.d.ts +2 -2
- package/dist/internal/roving.js +3 -3
- package/dist/internal/scroll-lock.d.ts +1 -1
- package/dist/internal/scroll-lock.js +2 -2
- package/dist/internal/slot-children.d.ts +3 -3
- package/dist/internal/slot-children.js +4 -4
- package/dist/internal/slot.d.ts +3 -3
- package/dist/internal/slot.js +2 -2
- package/dist/internal/step.d.ts +3 -3
- package/dist/internal/step.js +4 -4
- package/dist/internal/tween.d.ts +5 -5
- package/dist/internal/tween.js +5 -5
- package/dist/internal/types.d.ts +2 -2
- package/dist/internal/use-breakpoint.d.ts +2 -2
- package/dist/internal/use-breakpoint.js +4 -4
- package/dist/internal/use-controllable-state.d.ts +1 -1
- package/dist/internal/use-controllable-state.js +3 -3
- package/dist/internal/use-id.d.ts +2 -2
- package/dist/internal/use-id.js +2 -2
- package/dist/internal/use-modal-focus.d.ts +1 -1
- package/dist/internal/use-modal-focus.js +3 -3
- package/dist/knob/knob.d.ts +4 -4
- package/dist/knob/knob.js +14 -10
- package/dist/knob/llms.txt +17 -12
- package/dist/listbox/listbox.d.ts +6 -6
- package/dist/listbox/listbox.js +9 -9
- package/dist/listbox/llms.txt +10 -10
- package/dist/loader/llms.txt +56 -0
- package/dist/loader/loader.d.ts +49 -0
- package/dist/loader/loader.js +68 -0
- package/dist/map/llms.txt +25 -22
- package/dist/map/map-create-dialog.d.ts +4 -4
- package/dist/map/map-create-dialog.js +10 -10
- package/dist/map/map-hours-field.d.ts +4 -4
- package/dist/map/map-hours-field.js +7 -7
- package/dist/map/map-image-field.d.ts +2 -2
- package/dist/map/map-image-field.js +4 -4
- package/dist/map/map-legend.d.ts +4 -4
- package/dist/map/map-legend.js +2 -2
- package/dist/map/map-poi-card.d.ts +3 -3
- package/dist/map/map-poi-card.js +9 -9
- package/dist/map/map-search.d.ts +17 -6
- package/dist/map/map-search.js +21 -18
- package/dist/map/map.d.ts +21 -14
- package/dist/map/map.js +30 -29
- package/dist/map/ports.d.ts +9 -9
- package/dist/map/ports.js +6 -6
- package/dist/map-entry/public-api.js +2 -2
- package/dist/megamenu/llms.txt +9 -9
- package/dist/megamenu/megamenu.d.ts +6 -6
- package/dist/megamenu/megamenu.js +10 -10
- package/dist/mention/llms.txt +15 -15
- package/dist/mention/mention.d.ts +5 -5
- package/dist/mention/mention.js +2 -2
- package/dist/mention/mentions.d.ts +1 -1
- package/dist/mention/mentions.js +1 -1
- package/dist/menu/llms.txt +12 -12
- package/dist/menu/menu-item.d.ts +4 -4
- package/dist/menu/menu-keys.d.ts +2 -2
- package/dist/menu/menu-keys.js +5 -5
- package/dist/menu/menu.d.ts +2 -2
- package/dist/menu/menu.js +6 -6
- package/dist/menubar/llms.txt +10 -10
- package/dist/menubar/menubar.d.ts +5 -5
- package/dist/menubar/menubar.js +10 -10
- package/dist/meter-group/llms.txt +12 -12
- package/dist/meter-group/meter-group.d.ts +2 -2
- package/dist/meter-group/meter-group.js +1 -1
- package/dist/motion/motion-context.d.ts +22 -0
- package/dist/motion/motion-context.js +28 -0
- package/dist/order-list/llms.txt +22 -10
- package/dist/order-list/order-list.d.ts +12 -4
- package/dist/order-list/order-list.js +104 -21
- package/dist/paginator/llms.txt +8 -8
- package/dist/paginator/paginator.js +1 -1
- package/dist/panel/llms.txt +25 -13
- package/dist/panel/panel.d.ts +11 -3
- package/dist/panel/panel.js +7 -4
- package/dist/password/llms.txt +16 -8
- package/dist/password/password.d.ts +2 -2
- package/dist/password/password.js +24 -3
- package/dist/peek/llms.txt +10 -10
- package/dist/peek/peek.d.ts +6 -6
- package/dist/peek/peek.js +7 -7
- package/dist/pick-list/llms.txt +33 -13
- package/dist/pick-list/pick-list.d.ts +12 -4
- package/dist/pick-list/pick-list.js +111 -23
- package/dist/popover/llms.txt +11 -11
- package/dist/popover/popover.d.ts +4 -4
- package/dist/popover/popover.js +5 -5
- package/dist/progress/llms.txt +17 -17
- package/dist/progress/progress.d.ts +7 -7
- package/dist/progress/progress.js +6 -6
- package/dist/public-api.d.ts +15 -3
- package/dist/public-api.js +13 -7
- package/dist/radio-group/llms.txt +13 -6
- package/dist/radio-group/radio-group.d.ts +11 -4
- package/dist/radio-group/radio-group.js +15 -7
- package/dist/rating/llms.txt +20 -13
- package/dist/rating/rating-pointer.d.ts +16 -0
- package/dist/rating/rating-pointer.js +26 -0
- package/dist/rating/rating.d.ts +6 -6
- package/dist/rating/rating.js +76 -12
- package/dist/rich-text/lists.d.ts +2 -2
- package/dist/rich-text/lists.js +7 -7
- package/dist/rich-text/llms.txt +26 -17
- package/dist/rich-text/rich-text.d.ts +12 -7
- package/dist/rich-text/rich-text.js +78 -54
- package/dist/rich-text/sanitize.d.ts +3 -3
- package/dist/rich-text/sanitize.js +12 -12
- package/dist/rich-text/tables.d.ts +3 -3
- package/dist/rich-text/tables.js +3 -3
- package/dist/roadmap/llms.txt +15 -15
- package/dist/roadmap/roadmap.d.ts +6 -6
- package/dist/roadmap/roadmap.js +19 -19
- package/dist/roadmap-entry/public-api.js +2 -2
- package/dist/scroll-top/llms.txt +6 -6
- package/dist/scroll-top/scroll-top.d.ts +1 -1
- package/dist/scroll-top/scroll-top.js +1 -1
- package/dist/select/llms.txt +19 -12
- package/dist/select/select.d.ts +8 -8
- package/dist/select/select.js +47 -21
- package/dist/shared/types.d.ts +5 -5
- package/dist/shared/types.js +1 -1
- package/dist/sidenav/llms.txt +9 -9
- package/dist/sidenav/sidenav.d.ts +1 -1
- package/dist/sidenav/sidenav.js +1 -1
- package/dist/skeleton/llms.txt +3 -3
- package/dist/skeleton/skeleton.d.ts +1 -1
- package/dist/skeleton/skeleton.js +1 -1
- package/dist/slider/llms.txt +32 -13
- package/dist/slider/slider-drag.d.ts +26 -0
- package/dist/slider/slider-drag.js +79 -0
- package/dist/slider/slider.d.ts +6 -5
- package/dist/slider/slider.js +27 -8
- package/dist/speech/llms.txt +97 -0
- package/dist/speech/speech-button.d.ts +44 -0
- package/dist/speech/speech-button.js +86 -0
- package/dist/speech/speech-wave.d.ts +19 -0
- package/dist/speech/speech-wave.js +16 -0
- package/dist/speech/use-speech-recognition.d.ts +81 -0
- package/dist/speech/use-speech-recognition.js +179 -0
- package/dist/speed-dial/llms.txt +14 -8
- package/dist/speed-dial/speed-dial.d.ts +1 -1
- package/dist/speed-dial/speed-dial.js +1 -1
- package/dist/spinner/llms.txt +7 -7
- package/dist/spinner/spinner.d.ts +1 -1
- package/dist/spinner/spinner.js +1 -1
- package/dist/split-button/llms.txt +21 -15
- package/dist/split-button/split-button.d.ts +2 -2
- package/dist/split-button/split-button.js +4 -4
- package/dist/splitter/llms.txt +11 -11
- package/dist/splitter/splitter.d.ts +3 -3
- package/dist/splitter/splitter.js +5 -5
- package/dist/stepper/llms.txt +33 -14
- package/dist/stepper/stepper.d.ts +6 -6
- package/dist/stepper/stepper.js +53 -10
- package/dist/switch/llms.txt +12 -5
- package/dist/switch/switch.d.ts +10 -3
- package/dist/switch/switch.js +12 -5
- package/dist/switch-group/llms.txt +9 -9
- package/dist/switch-group/switch-group.d.ts +4 -4
- package/dist/switch-group/switch-group.js +4 -4
- package/dist/tabs/llms.txt +10 -10
- package/dist/tabs/tabs.d.ts +5 -5
- package/dist/tabs/tabs.js +8 -8
- package/dist/textarea/llms.txt +23 -12
- package/dist/textarea/textarea.d.ts +19 -6
- package/dist/textarea/textarea.js +21 -7
- package/dist/timeline/llms.txt +4 -4
- package/dist/timeline/timeline.d.ts +1 -1
- package/dist/timeline/timeline.js +1 -1
- package/dist/toast/llms.txt +47 -17
- package/dist/toast/toast-container.d.ts +9 -3
- package/dist/toast/toast-container.js +17 -9
- package/dist/toast/toast-store.d.ts +40 -4
- package/dist/toast/toast-store.js +36 -1
- package/dist/toolbar/llms.txt +7 -7
- package/dist/toolbar/toolbar.d.ts +3 -3
- package/dist/toolbar/toolbar.js +2 -2
- package/dist/tooltip/llms.txt +10 -10
- package/dist/tooltip/tooltip.d.ts +3 -3
- package/dist/tooltip/tooltip.js +18 -18
- package/dist/tree/llms.txt +25 -12
- package/dist/tree/tree-keys.d.ts +5 -5
- package/dist/tree/tree-keys.js +7 -7
- package/dist/tree/tree.d.ts +14 -7
- package/dist/tree/tree.js +53 -18
- package/dist/update/llms.txt +54 -0
- package/dist/update/update.d.ts +49 -0
- package/dist/update/update.js +82 -0
- package/package.json +15 -13
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Sanityzacja treści edytora. Kod nie zna frameworka
|
|
3
|
-
* w porcie Angulara: `rich-text/sanitize.ts`
|
|
2
|
+
* Sanityzacja treści edytora. Kod nie zna frameworka - operuje wyłącznie na DOM. Bliźniak
|
|
3
|
+
* w porcie Angulara: `rich-text/sanitize.ts` - zmiana w obu (docelowo wspólna paczka pure-TS).
|
|
4
4
|
*/
|
|
5
5
|
/** Znaczniki dopuszczone w treści; pozostałe rozwijamy do dzieci, nie usuwając tekstu. */
|
|
6
6
|
const ALLOWED_TAGS = new Set([
|
|
@@ -15,7 +15,7 @@ const ALLOWED_STYLES = new Set([
|
|
|
15
15
|
/*
|
|
16
16
|
* `data-mention` i `contenteditable` są tu dla wzmianek: identyfikator musi przeżyć zapis treści,
|
|
17
17
|
* a `contenteditable="false"` trzyma wzmiankę jako jeden kawałek, w którego środku nie da się
|
|
18
|
-
* pisać. Oba atrybuty są bierne
|
|
18
|
+
* pisać. Oba atrybuty są bierne - nie wykonują niczego i nie wskazują zasobów, więc wpuszczenie
|
|
19
19
|
* ich nie otwiera nowej furtki. `class` przechodzi osobno, tylko z klasami samego edytora.
|
|
20
20
|
*/
|
|
21
21
|
const ALLOWED_ATTRS = new Set([
|
|
@@ -23,12 +23,12 @@ const ALLOWED_ATTRS = new Set([
|
|
|
23
23
|
'data-mention', 'contenteditable',
|
|
24
24
|
]);
|
|
25
25
|
/**
|
|
26
|
-
* Klasy, które zostawia sam edytor (`kpt-rt-table`, `kpt-mention`). Obce klasy z wklejki
|
|
27
|
-
* biblioteki (`kpt-dialog`, `kpt-visually-hidden`) czy Tailwinda
|
|
26
|
+
* Klasy, które zostawia sam edytor (`kpt-rt-table`, `kpt-mention`). Obce klasy z wklejki - aplikacji,
|
|
27
|
+
* biblioteki (`kpt-dialog`, `kpt-visually-hidden`) czy Tailwinda - przejęłyby ich wygląd tam,
|
|
28
28
|
* gdzie aplikacja wyświetla treść.
|
|
29
29
|
*/
|
|
30
30
|
const EDITOR_CLASS = /^kpt-(rt-[a-z0-9-]+|mention)$/;
|
|
31
|
-
// Schematy dopuszczone w `href`
|
|
31
|
+
// Schematy dopuszczone w `href` - ta sama allowlista dla narzędzia "link" i dla wklejonego HTML.
|
|
32
32
|
const SAFE_URL_SCHEME = /^(https?:|mailto:|tel:)/i;
|
|
33
33
|
const HAS_URL_SCHEME = /^[a-z][a-z0-9+.-]*:/i;
|
|
34
34
|
/** Znaki sterujące, które przeglądarka pomija przy parsowaniu URL-a (`jav\tascript:`). */
|
|
@@ -63,7 +63,7 @@ function sanitizeAttribute(el, attr, report) {
|
|
|
63
63
|
if (kept === null)
|
|
64
64
|
remove();
|
|
65
65
|
else if (kept.split('; ').length !== declared) {
|
|
66
|
-
// Zmiana tylko wtedy, gdy wypadła deklaracja
|
|
66
|
+
// Zmiana tylko wtedy, gdy wypadła deklaracja - samo przeformatowanie zapisu się nie liczy.
|
|
67
67
|
el.setAttribute('style', kept);
|
|
68
68
|
report.changed = true;
|
|
69
69
|
}
|
|
@@ -79,11 +79,11 @@ function sanitizeAttribute(el, attr, report) {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
else if (!ALLOWED_ATTRS.has(name)) {
|
|
82
|
-
// Także `on*` i `src`
|
|
82
|
+
// Także `on*` i `src` - żaden dopuszczony znacznik nie ładuje zasobów.
|
|
83
83
|
remove();
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
/** Link otwierany w nowej karcie dostaje `noopener noreferrer`
|
|
86
|
+
/** Link otwierany w nowej karcie dostaje `noopener noreferrer` - bez tego karta sięga do `opener`. */
|
|
87
87
|
function secureTarget(el, report) {
|
|
88
88
|
if (el.tagName !== 'A' || !el.hasAttribute('target'))
|
|
89
89
|
return;
|
|
@@ -107,7 +107,7 @@ function sanitizeElement(el, report) {
|
|
|
107
107
|
secureTarget(el, report);
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
|
-
* Czyści HTML i mówi, czy coś usunął. `changed: false` znaczy, że treść była czysta
|
|
110
|
+
* Czyści HTML i mówi, czy coś usunął. `changed: false` znaczy, że treść była czysta - wtedy
|
|
111
111
|
* wołający nie musi nadpisywać wartości modelu (serializacja DOM potrafi zmienić zapis, np.
|
|
112
112
|
* cudzysłowy, bez zmiany treści, a taka różnica nie może brudzić formularza).
|
|
113
113
|
*/
|
|
@@ -127,8 +127,8 @@ export function sanitizeHtml(html) {
|
|
|
127
127
|
return sanitizeHtmlReport(html).html;
|
|
128
128
|
}
|
|
129
129
|
/**
|
|
130
|
-
* Waliduje URL z narzędzia
|
|
131
|
-
* bez zmian; schemat spoza allowlisty
|
|
130
|
+
* Waliduje URL z narzędzia "link". Brak schematu -> dopisujemy `https://`; `#` i `/` przechodzą
|
|
131
|
+
* bez zmian; schemat spoza allowlisty -> `null`, czyli link nie zostaje wstawiony.
|
|
132
132
|
*/
|
|
133
133
|
export function sanitizeUrl(url) {
|
|
134
134
|
const trimmed = url.trim().replace(URL_CONTROL, '');
|
|
@@ -14,7 +14,7 @@ export interface Bounds {
|
|
|
14
14
|
}
|
|
15
15
|
/** Klasa znacząca komórki objęte zaznaczeniem prostokątnym. */
|
|
16
16
|
export declare const CELL_SELECTED = "kpt-rt-cell-sel";
|
|
17
|
-
/** Macierz komórek: pozycja w siatce, a nie w DOM
|
|
17
|
+
/** Macierz komórek: pozycja w siatce, a nie w DOM - scalona komórka zajmuje kilka pól. */
|
|
18
18
|
export declare function buildGrid(table: HTMLTableElement): {
|
|
19
19
|
grid: HTMLTableCellElement[][];
|
|
20
20
|
pos: GridPos;
|
|
@@ -23,7 +23,7 @@ export declare function buildGrid(table: HTMLTableElement): {
|
|
|
23
23
|
export declare function cellsInRegion(grid: HTMLTableCellElement[][], b: Bounds): Set<HTMLTableCellElement>;
|
|
24
24
|
/**
|
|
25
25
|
* Prostokątne zaznaczenie od komórki-kotwicy do komórki pod kursorem. Granice rosną, aż region
|
|
26
|
-
* w pełni obejmie scalone komórki na brzegach
|
|
26
|
+
* w pełni obejmie scalone komórki na brzegach - inaczej scalanie działałoby na pół komórki.
|
|
27
27
|
*/
|
|
28
28
|
export declare function regionBetween(anchor: HTMLTableCellElement, focus: HTMLTableCellElement): Set<HTMLTableCellElement>;
|
|
29
29
|
/** Równe szerokości kolumn po wstawieniu albo usunięciu kolumny. */
|
|
@@ -34,7 +34,7 @@ export declare function insertColumn(cell: HTMLTableCellElement, dir: 'left' | '
|
|
|
34
34
|
export declare function deleteColumn(cell: HTMLTableCellElement): void;
|
|
35
35
|
export declare function insertRow(cell: HTMLTableCellElement, dir: 'above' | 'below'): void;
|
|
36
36
|
export declare function deleteRow(cell: HTMLTableCellElement): void;
|
|
37
|
-
/** Podmienia znacznik komórki `td`
|
|
37
|
+
/** Podmienia znacznik komórki `td` <-> `th`, zachowując atrybuty i treść. */
|
|
38
38
|
export declare function swapCellTag(cell: HTMLTableCellElement, tag: 'td' | 'th'): void;
|
|
39
39
|
export declare function toggleHeaderRow(cell: HTMLTableCellElement): void;
|
|
40
40
|
export declare function toggleHeaderColumn(cell: HTMLTableCellElement): void;
|
package/dist/rich-text/tables.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/** Klasa znacząca komórki objęte zaznaczeniem prostokątnym. */
|
|
6
6
|
export const CELL_SELECTED = 'kpt-rt-cell-sel';
|
|
7
|
-
/** Macierz komórek: pozycja w siatce, a nie w DOM
|
|
7
|
+
/** Macierz komórek: pozycja w siatce, a nie w DOM - scalona komórka zajmuje kilka pól. */
|
|
8
8
|
export function buildGrid(table) {
|
|
9
9
|
const grid = [];
|
|
10
10
|
const pos = new Map();
|
|
@@ -65,7 +65,7 @@ function growBounds(grid, pos, b) {
|
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Prostokątne zaznaczenie od komórki-kotwicy do komórki pod kursorem. Granice rosną, aż region
|
|
68
|
-
* w pełni obejmie scalone komórki na brzegach
|
|
68
|
+
* w pełni obejmie scalone komórki na brzegach - inaczej scalanie działałoby na pół komórki.
|
|
69
69
|
*/
|
|
70
70
|
export function regionBetween(anchor, focus) {
|
|
71
71
|
const table = anchor.closest('table');
|
|
@@ -153,7 +153,7 @@ export function deleteRow(cell) {
|
|
|
153
153
|
}
|
|
154
154
|
tr.remove();
|
|
155
155
|
}
|
|
156
|
-
/** Podmienia znacznik komórki `td`
|
|
156
|
+
/** Podmienia znacznik komórki `td` <-> `th`, zachowując atrybuty i treść. */
|
|
157
157
|
export function swapCellTag(cell, tag) {
|
|
158
158
|
if (cell.tagName.toLowerCase() === tag)
|
|
159
159
|
return;
|
package/dist/roadmap/llms.txt
CHANGED
|
@@ -9,40 +9,40 @@ A separate subpath, because the geometry, the styles and the data model are heav
|
|
|
9
9
|
library core and not every app needs them.
|
|
10
10
|
|
|
11
11
|
## Props
|
|
12
|
-
- `config`: `KptRoadmapConfig` (required)
|
|
13
|
-
- `scrollHeight`: string | null
|
|
14
|
-
- `labelWidth`: string
|
|
15
|
-
- `cellWidthPx`: number | null
|
|
16
|
-
- `showToday`: boolean
|
|
17
|
-
- `virtual`: boolean
|
|
18
|
-
- `collapsedGroups` / `defaultCollapsedGroups` / `onCollapsedGroupsChange`
|
|
12
|
+
- `config`: `KptRoadmapConfig` (required) - the data and every option
|
|
13
|
+
- `scrollHeight`: string | null - a fixed height, e.g. '420px'; enables the sticky header
|
|
14
|
+
- `labelWidth`: string - the width of the label column (default '14rem')
|
|
15
|
+
- `cellWidthPx`: number | null - the width of an axis column; without it the value depends on the zoom
|
|
16
|
+
- `showToday`: boolean - the "today" marker (default true)
|
|
17
|
+
- `virtual`: boolean - renders only the visible rows; worth it from roughly 100 rows up
|
|
18
|
+
- `collapsedGroups` / `defaultCollapsedGroups` / `onCollapsedGroupsChange` - the ids of collapsed
|
|
19
19
|
groups, controlled or uncontrolled
|
|
20
|
-
- `onItemClick(item)`, `onRangeChange(range)`
|
|
20
|
+
- `onItemClick(item)`, `onRangeChange(range)` - the click on a bar and the computed axis range
|
|
21
21
|
- `className`, `ref` and every other `<div>` prop go to the host
|
|
22
|
-
- `locale`, `dictionary`
|
|
22
|
+
- `locale`, `dictionary` - the per-component i18n overrides
|
|
23
23
|
|
|
24
24
|
## The config is the API
|
|
25
25
|
`{ items, groups?, links?, zoom?, range?, locale?, today?, timeline?, rows?, dependencies?,
|
|
26
|
-
interaction? }`
|
|
26
|
+
interaction? }` - the same shape the Angular port takes, because both read it from
|
|
27
27
|
`@konce-pt/roadmap`. An item is `{ id, label, start, end?, sublabel?, variant?, color?, progress?,
|
|
28
28
|
groupId?, dependsOn?, milestone?, meta? }`; no `end` means a milestone diamond, and a bare string in
|
|
29
29
|
`dependsOn` is an 'FS' dependency.
|
|
30
30
|
|
|
31
31
|
## The geometry lives in a package
|
|
32
32
|
The calendar arithmetic, the timeline bands and cells, the row layout, lane packing and the
|
|
33
|
-
dependency polylines come from `@konce-pt/roadmap`
|
|
33
|
+
dependency polylines come from `@konce-pt/roadmap` - pure functions with `node --test` coverage,
|
|
34
34
|
shared with the Angular port. The component only turns them into DOM and SVG.
|
|
35
35
|
|
|
36
36
|
## Collapsing has two sources
|
|
37
37
|
`group.collapsed` in the data and the `collapsedGroups` prop are kept apart, so an app that controls
|
|
38
38
|
the state keeps control while a group collapsed declaratively still works. Expanding removes the
|
|
39
|
-
group from both
|
|
39
|
+
group from both - otherwise `group.collapsed` would immediately collapse it again. The declarative
|
|
40
40
|
set is recomputed during render whenever the `groups` array identity changes; an effect would do it
|
|
41
41
|
one render too late, that is after the group flashed open.
|
|
42
42
|
|
|
43
43
|
## Measuring, not guessing
|
|
44
44
|
The SVG dependency layer works in pixels, so the lane width and the scroll viewport are measured
|
|
45
|
-
with a `ResizeObserver` in a layout effect. Before the first measurement no link is drawn
|
|
45
|
+
with a `ResizeObserver` in a layout effect. Before the first measurement no link is drawn - half a
|
|
46
46
|
frame without arrows beats arrows in the wrong place.
|
|
47
47
|
|
|
48
48
|
## Examples
|
|
@@ -63,7 +63,7 @@ frame without arrows beats arrows in the wrong place.
|
|
|
63
63
|
different lengths; inside a column the position is interpolated linearly.
|
|
64
64
|
- An item extending past the axis range is cut off on the side where it is clipped.
|
|
65
65
|
- Tooltips use `KptTooltip`, mostly with `onlyWhenTruncated`: a tooltip shows what cannot be seen.
|
|
66
|
-
Milestones and header cells carry one unconditionally
|
|
66
|
+
Milestones and header cells carry one unconditionally - a diamond shows no text at all.
|
|
67
67
|
- Dependencies: 'FS' (the default), 'SS', 'FF', 'SF'; violated ones are drawn as a dashed line in
|
|
68
68
|
the danger color.
|
|
69
69
|
- Entries with an invalid date or a duplicate `id` are skipped, with a warning in a development build.
|
|
@@ -79,7 +79,7 @@ Sizes: `--kpt-roadmap-label-w`, `--kpt-roadmap-cell-w` (both can be overridden f
|
|
|
79
79
|
|
|
80
80
|
## Accessibility
|
|
81
81
|
Bars and milestones are `role="button"` with an accessible name built from the label, sublabel, date range
|
|
82
|
-
and progress (`Design, 3
|
|
82
|
+
and progress (`Design, 3-14 Mar 2026, 40% complete`) - the end is exclusive, so the last occupied day is
|
|
83
83
|
announced. The whole bar grid is one Tab stop (roving tabindex): Left/Right move within a row, Up/Down go to
|
|
84
84
|
the bar with the nearest start in the neighbouring row, Home/End jump to the row's edge, Ctrl+Home/End to the
|
|
85
85
|
first/last bar; Enter and Space act like a click. With `virtual` on, moving to a row outside the window
|
|
@@ -8,15 +8,15 @@ export interface KptRoadmapProps<TItem = unknown, TGroup = unknown> extends Omit
|
|
|
8
8
|
scrollHeight?: string | null;
|
|
9
9
|
/** Szerokość kolumny etykiet. */
|
|
10
10
|
labelWidth?: string;
|
|
11
|
-
/** Szerokość kolumny osi czasu; brak
|
|
11
|
+
/** Szerokość kolumny osi czasu; brak => wartość zależna od zoomu. */
|
|
12
12
|
cellWidthPx?: number | null;
|
|
13
|
-
/** Znacznik
|
|
13
|
+
/** Znacznik "dziś". */
|
|
14
14
|
showToday?: boolean;
|
|
15
15
|
/** Renderowanie tylko widocznych wierszy. Warto włączyć od ~100 wierszy. */
|
|
16
16
|
virtual?: boolean;
|
|
17
|
-
/** Zwinięte grupy
|
|
17
|
+
/** Zwinięte grupy - tryb kontrolowany. */
|
|
18
18
|
collapsedGroups?: string[];
|
|
19
|
-
/** Zwinięte grupy na starcie
|
|
19
|
+
/** Zwinięte grupy na starcie - tryb niekontrolowany. */
|
|
20
20
|
defaultCollapsedGroups?: string[];
|
|
21
21
|
onCollapsedGroupsChange?: (ids: string[]) => void;
|
|
22
22
|
onItemClick?: (item: KptRoadmapItem<TItem>) => void;
|
|
@@ -24,11 +24,11 @@ export interface KptRoadmapProps<TItem = unknown, TGroup = unknown> extends Omit
|
|
|
24
24
|
onRangeChange?: (range: KptTimeRange) => void;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
* Roadmapa
|
|
27
|
+
* Roadmapa - wiersze zadań na poziomej osi czasu (widok typu Gantt).
|
|
28
28
|
*
|
|
29
29
|
* Układ opiera się na DOM i `position: sticky` (kolumna etykiet oraz nagłówek),
|
|
30
30
|
* paski są pozycjonowane procentowo w torze, a zależności rysuje warstwa SVG
|
|
31
|
-
* rozpięta nad torami. Cała geometria pochodzi z `@konce-pt/roadmap`
|
|
31
|
+
* rozpięta nad torami. Cała geometria pochodzi z `@konce-pt/roadmap` - tej samej
|
|
32
32
|
* paczki, z której korzysta port Angulara.
|
|
33
33
|
*
|
|
34
34
|
* @example
|
package/dist/roadmap/roadmap.js
CHANGED
|
@@ -16,16 +16,16 @@ const CELL_WIDTH = {
|
|
|
16
16
|
day: 44,
|
|
17
17
|
hour: 46,
|
|
18
18
|
};
|
|
19
|
-
/** Wysokość paska w trybie
|
|
19
|
+
/** Wysokość paska w trybie "jeden item na wiersz" (px). */
|
|
20
20
|
const BAR_HEIGHT = 22;
|
|
21
|
-
/** Odstęp między pasami w trybie
|
|
21
|
+
/** Odstęp między pasami w trybie "pack" (px). */
|
|
22
22
|
const LANE_GAP = 4;
|
|
23
23
|
/**
|
|
24
|
-
* Roadmapa
|
|
24
|
+
* Roadmapa - wiersze zadań na poziomej osi czasu (widok typu Gantt).
|
|
25
25
|
*
|
|
26
26
|
* Układ opiera się na DOM i `position: sticky` (kolumna etykiet oraz nagłówek),
|
|
27
27
|
* paski są pozycjonowane procentowo w torze, a zależności rysuje warstwa SVG
|
|
28
|
-
* rozpięta nad torami. Cała geometria pochodzi z `@konce-pt/roadmap`
|
|
28
|
+
* rozpięta nad torami. Cała geometria pochodzi z `@konce-pt/roadmap` - tej samej
|
|
29
29
|
* paczki, z której korzysta port Angulara.
|
|
30
30
|
*
|
|
31
31
|
* @example
|
|
@@ -41,7 +41,7 @@ export function KptRoadmap({ config, scrollHeight = null, labelWidth = '14rem',
|
|
|
41
41
|
/**
|
|
42
42
|
* Grupy zwinięte na starcie przez `group.collapsed`. Trzymamy je osobno od stanu aplikacji,
|
|
43
43
|
* żeby sterowanie z zewnątrz pozostało w jej rękach, a zwinięcie zadeklarowane w danych
|
|
44
|
-
* nadal działało. Wyliczamy w trakcie renderu i resetujemy, gdy zmieni się lista grup
|
|
44
|
+
* nadal działało. Wyliczamy w trakcie renderu i resetujemy, gdy zmieni się lista grup -
|
|
45
45
|
* efekt zrobiłby to samo o jeden render za późno, czyli po mignięciu rozwiniętej grupy.
|
|
46
46
|
*/
|
|
47
47
|
const [fromConfig, setFromConfig] = useState(() => declaredCollapsed(config.groups));
|
|
@@ -50,13 +50,13 @@ export function KptRoadmap({ config, scrollHeight = null, labelWidth = '14rem',
|
|
|
50
50
|
setPrevGroups(config.groups);
|
|
51
51
|
setFromConfig(declaredCollapsed(config.groups));
|
|
52
52
|
}
|
|
53
|
-
/** Suma obu źródeł
|
|
53
|
+
/** Suma obu źródeł - stan faktycznie użyty do budowy wierszy. */
|
|
54
54
|
const collapsedIds = useMemo(() => new Set([...fromConfig, ...collapsed]), [fromConfig, collapsed]);
|
|
55
55
|
const scrollRef = useRef(null);
|
|
56
56
|
const laneRef = useRef(null);
|
|
57
57
|
const [scrollTop, setScrollTop] = useState(0);
|
|
58
58
|
const [viewportHeight, setViewportHeight] = useState(0);
|
|
59
|
-
/** Szerokość toru w px
|
|
59
|
+
/** Szerokość toru w px - potrzebna warstwie SVG, która pracuje w pikselach. */
|
|
60
60
|
const [laneWidth, setLaneWidth] = useState(0);
|
|
61
61
|
const zoom = config.zoom ?? 'week';
|
|
62
62
|
const cellWidth = cellWidthPx ?? CELL_WIDTH[zoom];
|
|
@@ -71,7 +71,7 @@ export function KptRoadmap({ config, scrollHeight = null, labelWidth = '14rem',
|
|
|
71
71
|
const layout = useMemo(() => buildRows(config.items, config.groups, collapsedIds, config.rows), [config.items, config.groups, config.rows, collapsedIds]);
|
|
72
72
|
const itemLocale = config.locale ?? config.timeline?.locale ?? locale;
|
|
73
73
|
/**
|
|
74
|
-
* Paski widoczne na osi, wiersz po wierszu
|
|
74
|
+
* Paski widoczne na osi, wiersz po wierszu - mapa dla nawigacji strzałkami. Liczona ze wszystkich
|
|
75
75
|
* wierszy, nie z okna wirtualizacji: strzałka w dół z ostatniego wyrenderowanego wiersza ma dokąd iść.
|
|
76
76
|
*/
|
|
77
77
|
const navGrid = useMemo(() => layout.rows.map((row) => row.kind === 'group'
|
|
@@ -83,7 +83,7 @@ export function KptRoadmap({ config, scrollHeight = null, labelWidth = '14rem',
|
|
|
83
83
|
/** Pasek, na którym ostatnio był fokus. */
|
|
84
84
|
const [activeId, setActiveId] = useState(null);
|
|
85
85
|
/**
|
|
86
|
-
* Jedyny przystanek Tab w siatce pasków (roving tabindex)
|
|
86
|
+
* Jedyny przystanek Tab w siatce pasków (roving tabindex) - ostatnio aktywny pasek, a gdy zniknął
|
|
87
87
|
* (zwinięta grupa, inne dane), pierwszy. Bez tego roadmapa ze stu zadaniami to sto przystanków Tab.
|
|
88
88
|
*/
|
|
89
89
|
const tabStopId = useMemo(() => {
|
|
@@ -91,13 +91,13 @@ export function KptRoadmap({ config, scrollHeight = null, labelWidth = '14rem',
|
|
|
91
91
|
return activeId;
|
|
92
92
|
return navGrid.find((row) => row.length > 0)?.[0].id ?? null;
|
|
93
93
|
}, [navGrid, activeId]);
|
|
94
|
-
/** Wiersze faktycznie renderowane
|
|
94
|
+
/** Wiersze faktycznie renderowane - całość albo okno wirtualizacji. */
|
|
95
95
|
const visibleRows = useMemo(() => {
|
|
96
96
|
if (!virtual || viewportHeight <= 0)
|
|
97
97
|
return layout.rows;
|
|
98
98
|
return sliceRows(layout, scrollTop, viewportHeight).rows;
|
|
99
99
|
}, [virtual, viewportHeight, layout, scrollTop]);
|
|
100
|
-
// Zakres jest wielkością wyliczaną
|
|
100
|
+
// Zakres jest wielkością wyliczaną - informujemy o nim po każdym przeliczeniu.
|
|
101
101
|
useEffect(() => {
|
|
102
102
|
onRangeChange?.(range);
|
|
103
103
|
}, [range, onRangeChange]);
|
|
@@ -126,14 +126,14 @@ export function KptRoadmap({ config, scrollHeight = null, labelWidth = '14rem',
|
|
|
126
126
|
console.warn('[kpt-roadmap] Pominięto elementy:', invalid.map((entry) => `${entry.id} (${entry.reason})`).join(', '));
|
|
127
127
|
}
|
|
128
128
|
}, [layout]);
|
|
129
|
-
/** Wysokość paska wraz z odstępem
|
|
129
|
+
/** Wysokość paska wraz z odstępem - wspólna dla widoku i geometrii zależności. */
|
|
130
130
|
const laneStep = barHeight + LANE_GAP;
|
|
131
131
|
/** Offset pionowy paska wewnątrz wiersza (px). */
|
|
132
132
|
const barTop = useCallback((row, lane) => {
|
|
133
133
|
const total = row.laneCount * barHeight + (row.laneCount - 1) * LANE_GAP;
|
|
134
134
|
return Math.max(0, (row.height - total) / 2) + lane * laneStep;
|
|
135
135
|
}, [barHeight, laneStep]);
|
|
136
|
-
/** Nazwa dostępna paska:
|
|
136
|
+
/** Nazwa dostępna paska: "Etykieta, 3-14 mar 2026, ukończono 40%". */
|
|
137
137
|
const itemAriaLabel = useCallback((item) => {
|
|
138
138
|
const source = item.source;
|
|
139
139
|
const dates = roadmapItemDates(item.start, item.end, itemLocale, {
|
|
@@ -163,7 +163,7 @@ export function KptRoadmap({ config, scrollHeight = null, labelWidth = '14rem',
|
|
|
163
163
|
top: barTop(row, item.lane),
|
|
164
164
|
height: barHeight,
|
|
165
165
|
label: source.label,
|
|
166
|
-
title: source.sublabel ? `${source.label}
|
|
166
|
+
title: source.sublabel ? `${source.label} - ${source.sublabel}` : source.label,
|
|
167
167
|
variant: source.variant ?? 'primary',
|
|
168
168
|
color: source.color,
|
|
169
169
|
progress: source.progress ?? null,
|
|
@@ -268,7 +268,7 @@ export function KptRoadmap({ config, scrollHeight = null, labelWidth = '14rem',
|
|
|
268
268
|
};
|
|
269
269
|
/**
|
|
270
270
|
* Klawiatura na pasku: Enter/Spacja działają jak kliknięcie, strzałki przenoszą fokus po siatce
|
|
271
|
-
* (w poziomie po wierszu, w pionie między wierszami), Home/End na skraj wiersza, z Ctrl
|
|
271
|
+
* (w poziomie po wierszu, w pionie między wierszami), Home/End na skraj wiersza, z Ctrl - roadmapy.
|
|
272
272
|
*/
|
|
273
273
|
const handleItemKeydown = (event, item) => {
|
|
274
274
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
@@ -293,17 +293,17 @@ export function KptRoadmap({ config, scrollHeight = null, labelWidth = '14rem',
|
|
|
293
293
|
};
|
|
294
294
|
/**
|
|
295
295
|
* Treść dymka dla kolumny etykiet. Pusta tam, gdzie dymek nie miałby czego
|
|
296
|
-
* uzupełnić
|
|
296
|
+
* uzupełnić - komponent pomija wtedy podpowiedź.
|
|
297
297
|
*/
|
|
298
298
|
const labelTooltip = (row) => {
|
|
299
299
|
// Wiersz grupy ma własny dymek, osadzony głębiej (na stosie etykiet).
|
|
300
300
|
if (row.kind === 'group')
|
|
301
301
|
return '';
|
|
302
|
-
// Tryb 'pack' mieści wiele zadań w jednym wierszu
|
|
302
|
+
// Tryb 'pack' mieści wiele zadań w jednym wierszu - nie ma jednej etykiety.
|
|
303
303
|
if (row.items.length !== 1)
|
|
304
304
|
return '';
|
|
305
305
|
const source = row.items[0].source;
|
|
306
|
-
return source.sublabel ? `${source.label}
|
|
306
|
+
return source.sublabel ? `${source.label} - ${source.sublabel}` : source.label;
|
|
307
307
|
};
|
|
308
308
|
const onScroll = (event) => {
|
|
309
309
|
setScrollTop(event.currentTarget.scrollTop);
|
|
@@ -319,7 +319,7 @@ export function KptRoadmap({ config, scrollHeight = null, labelWidth = '14rem',
|
|
|
319
319
|
const group = row.group;
|
|
320
320
|
const first = row.items[0];
|
|
321
321
|
const sum = row.kind === 'group' ? summary(row) : null;
|
|
322
|
-
return (_jsxs("div", { className: cn('kpt-roadmap__row', row.kind === 'group' && 'kpt-roadmap__row--group'), style: { insetBlockStart: `${row.top}px`, blockSize: `${row.height}px` }, children: [_jsx(KptTooltip, { text: labelTooltip(row), onlyWhenTruncated: true, children: _jsx("div", { className: cn('kpt-roadmap__label', row.kind === 'group' && 'kpt-roadmap__label--group'), style: { paddingInlineStart: `${0.75 + row.depth * 1}rem` }, children: group ? (_jsxs(_Fragment, { children: [_jsx(KptTooltip, { text: isCollapsed(group) ? t('roadmap.expandGroup') : t('roadmap.collapseGroup'), children: _jsx("button", { type: "button", className: "kpt-roadmap__toggle", "aria-expanded": !isCollapsed(group), "aria-label": group.label, onClick: () => toggleGroup(group), children: _jsx("span", { className: cn('kpt-roadmap__toggle-icon', !isCollapsed(group) && 'kpt-roadmap__toggle-icon--open') }) }) }), _jsx(KptTooltip, { text: group.sublabel ? `${group.label}
|
|
322
|
+
return (_jsxs("div", { className: cn('kpt-roadmap__row', row.kind === 'group' && 'kpt-roadmap__row--group'), style: { insetBlockStart: `${row.top}px`, blockSize: `${row.height}px` }, children: [_jsx(KptTooltip, { text: labelTooltip(row), onlyWhenTruncated: true, children: _jsx("div", { className: cn('kpt-roadmap__label', row.kind === 'group' && 'kpt-roadmap__label--group'), style: { paddingInlineStart: `${0.75 + row.depth * 1}rem` }, children: group ? (_jsxs(_Fragment, { children: [_jsx(KptTooltip, { text: isCollapsed(group) ? t('roadmap.expandGroup') : t('roadmap.collapseGroup'), children: _jsx("button", { type: "button", className: "kpt-roadmap__toggle", "aria-expanded": !isCollapsed(group), "aria-label": group.label, onClick: () => toggleGroup(group), children: _jsx("span", { className: cn('kpt-roadmap__toggle-icon', !isCollapsed(group) && 'kpt-roadmap__toggle-icon--open') }) }) }), _jsx(KptTooltip, { text: group.sublabel ? `${group.label} - ${group.sublabel}` : group.label, onlyWhenTruncated: true, children: _jsxs("span", { className: "kpt-roadmap__label-stack", children: [_jsx("span", { className: "kpt-roadmap__label-text kpt-roadmap__label-text--group", children: group.label }), group.sublabel && _jsx("span", { className: "kpt-roadmap__label-sub", children: group.sublabel })] }) }), row.groupState?.itemCount ? (_jsx("span", { className: "kpt-roadmap__label-count", children: row.groupState.itemCount })) : null] })) : (first && (_jsxs(_Fragment, { children: [_jsx("span", { className: "kpt-roadmap__label-text", children: first.source.label }), row.items.length === 1 && first.source.sublabel && (_jsx("span", { className: "kpt-roadmap__label-sub", children: first.source.sublabel }))] }))) }) }), _jsx("div", { className: "kpt-roadmap__lane", children: row.kind === 'group'
|
|
323
323
|
? sum && (_jsx("div", { className: "kpt-roadmap__summary", "data-variant": sum.variant, style: {
|
|
324
324
|
insetInlineStart: `${sum.left}%`,
|
|
325
325
|
inlineSize: `${sum.width}%`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @konce-pt/react/roadmap
|
|
2
|
+
* @konce-pt/react/roadmap - oś czasu typu Gantt. Osobny subpath, bo geometria, style i dane
|
|
3
3
|
* roadmapy są ciężkie względem rdzenia biblioteki i nie każda aplikacja ich potrzebuje.
|
|
4
4
|
*/
|
|
5
5
|
export { KptRoadmap } from "../roadmap/roadmap.js";
|
|
6
|
-
// Rdzeń obliczeniowy (pure TS)
|
|
6
|
+
// Rdzeń obliczeniowy (pure TS) - przydatny do własnych rozszerzeń, SSR i testów.
|
|
7
7
|
export { buildTimeline, buildRows, normalizeItems, packLanes, sliceRows, spanOf, rollupProgress, resolveLinks, linkGeometry, roundedPolyline, arrowHead, autoRange, resolveRange, isoWeekNumber, isoWeekYear, isoWeekday, isoWeeksInYear, startOfIsoWeek, startOfDay, addDays, addHours, addMonths, addUnits, floorToUnit, ceilToUnit, countUnits, diffDays, daysInMonth, isSameDay, toTimestamp, } from '@konce-pt/roadmap';
|
package/dist/scroll-top/llms.txt
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
# KptScrollTop (@konce-pt/react)
|
|
2
2
|
|
|
3
|
-
A "back to top" button
|
|
3
|
+
A "back to top" button - appears once the scroll passes `threshold` px.
|
|
4
4
|
Import: `import { KptScrollTop } from '@konce-pt/react';`
|
|
5
5
|
|
|
6
6
|
## DOM
|
|
7
7
|
<div class="kpt-scroll-top-host">
|
|
8
|
-
<button class="kpt-scroll-top is-visible" tabindex="0" aria-label="Scroll to top"
|
|
8
|
+
<button class="kpt-scroll-top is-visible" tabindex="0" aria-label="Scroll to top">...</button>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
11
|
## Props
|
|
12
12
|
- `threshold`: number (px, default 300)
|
|
13
|
-
- `target`: string | null
|
|
13
|
+
- `target`: string | null - a selector for the scrolled element; the window by default
|
|
14
14
|
- `className`, `ref` and every other `<div>` prop go to the host
|
|
15
15
|
|
|
16
16
|
## `target` is not optional in a shell
|
|
17
|
-
Whenever the app scrolls a container rather than the page
|
|
17
|
+
Whenever the app scrolls a container rather than the page - an `KptAppShell` layout, for instance -
|
|
18
18
|
the window never scrolls and the button would never appear. Point it at the container:
|
|
19
19
|
`target=".kpt-app-shell__content"`.
|
|
20
20
|
|
|
@@ -24,7 +24,7 @@ component, and on the server it does not exist at all. The listener is removed o
|
|
|
24
24
|
position is read once on mount, because the page may already be scrolled (arriving at an anchor).
|
|
25
25
|
|
|
26
26
|
## The hidden button stays in the DOM
|
|
27
|
-
It fades in and out, so hiding it is `tabindex="-1"` plus the CSS class, not a conditional render
|
|
27
|
+
It fades in and out, so hiding it is `tabindex="-1"` plus the CSS class, not a conditional render -
|
|
28
28
|
otherwise the animation would have nothing to run on.
|
|
29
29
|
|
|
30
30
|
## Examples
|
|
@@ -42,4 +42,4 @@ A real `<button>` labelled from `scrollTop.label`; while hidden it is `visibilit
|
|
|
42
42
|
out of the tab order and the accessibility tree. It sits in the bottom-end corner
|
|
43
43
|
(`inset-inline-end`), so it moves to the left in RTL. With `prefers-reduced-motion` the scroll is a
|
|
44
44
|
jump instead of smooth and the button appears without a transition. Focus stays on the button after
|
|
45
|
-
the jump
|
|
45
|
+
the jump - move it to your page heading if that matters.
|
|
@@ -7,7 +7,7 @@ export interface KptScrollTopProps extends ComponentPropsWithRef<'div'>, KptI18n
|
|
|
7
7
|
target?: string | null;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* Przycisk
|
|
10
|
+
* Przycisk "do góry" - pojawia się po przewinięciu ponad `threshold` px.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* <KptScrollTop threshold={300} />
|
|
@@ -5,7 +5,7 @@ import { cn } from "../internal/cn.js";
|
|
|
5
5
|
import { useKptMessages } from "../i18n/i18n-context.js";
|
|
6
6
|
import { KptIcon } from "../icon/icon.js";
|
|
7
7
|
/**
|
|
8
|
-
* Przycisk
|
|
8
|
+
* Przycisk "do góry" - pojawia się po przewinięciu ponad `threshold` px.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
* <KptScrollTop threshold={300} />
|
package/dist/select/llms.txt
CHANGED
|
@@ -6,21 +6,21 @@ A select on its own panel. Variants: single, with a search box (`filter`) and mu
|
|
|
6
6
|
## DOM
|
|
7
7
|
<span class="kpt-select-host">
|
|
8
8
|
<div class="kpt-select" role="combobox" tabindex="0" aria-expanded="false">
|
|
9
|
-
<div class="kpt-select__value"><span class="kpt-select__placeholder">Choose
|
|
10
|
-
<span class="kpt-icon-host kpt-select__chevron"
|
|
9
|
+
<div class="kpt-select__value"><span class="kpt-select__placeholder">Choose...</span></div>
|
|
10
|
+
<span class="kpt-icon-host kpt-select__chevron">...</span>
|
|
11
11
|
</div>
|
|
12
12
|
</span>
|
|
13
13
|
<!-- while open, in a portal on document.body: -->
|
|
14
|
-
<div class="kpt-select__panel"><ul class="kpt-select__list" role="listbox"
|
|
14
|
+
<div class="kpt-select__panel"><ul class="kpt-select__list" role="listbox">...</ul></div>
|
|
15
15
|
|
|
16
16
|
## Props
|
|
17
|
-
- `options`: `KptOption<T>[]`
|
|
18
|
-
- `value` / `defaultValue` / `onValueChange`
|
|
19
|
-
- `open` / `defaultOpen` / `onOpenChange`
|
|
17
|
+
- `options`: `KptOption<T>[]` - `{ label, value, disabled? }`
|
|
18
|
+
- `value` / `defaultValue` / `onValueChange` - a single `T`, or `T[]` in `multiple` mode
|
|
19
|
+
- `open` / `defaultOpen` / `onOpenChange` - the panel state, so the list can be opened from outside
|
|
20
20
|
- `placeholder`, `multiple`, `filter`, `disabled`, `invalid`, `touched`
|
|
21
|
-
- `onTouch()`
|
|
21
|
+
- `onTouch()` - fires when the panel closes or focus leaves the closed trigger
|
|
22
22
|
- `aria-label` (through the rest props) names the trigger when no `<label for>` describes it
|
|
23
|
-
- `locale`, `dictionary`
|
|
23
|
+
- `locale`, `dictionary` - i18n overrides for this component only
|
|
24
24
|
- `className`, `ref` and every other `<div>` prop go to the trigger
|
|
25
25
|
|
|
26
26
|
## The panel is a portal
|
|
@@ -35,20 +35,20 @@ through `aria-activedescendant` (with `filter`, focus moves to the search field)
|
|
|
35
35
|
ArrowUp, Enter, Space, Home and End open the list, typing letters opens it on the first match, and
|
|
36
36
|
in `multiple` mode Backspace/Delete removes the last chip. Open: ArrowUp/ArrowDown move by one,
|
|
37
37
|
Home/End to the ends, PageUp/PageDown by ten, skipping disabled options without wrapping; Enter (and
|
|
38
|
-
Space on the trigger) picks
|
|
38
|
+
Space on the trigger) picks - a single select closes and returns focus to the trigger; typing jumps
|
|
39
39
|
to the next match, diacritics ignored; Escape and Tab close. Hovering an option makes it active, so
|
|
40
40
|
the mouse and the keyboard share one highlight, and clicking it does not take focus from the trigger.
|
|
41
41
|
|
|
42
42
|
## Inside KptFormField
|
|
43
43
|
There is no native field for the wrapper to read, so the select reports its filled state with
|
|
44
|
-
`useKptFormFieldFilled`
|
|
44
|
+
`useKptFormFieldFilled` - the float label then floats over the chosen value.
|
|
45
45
|
|
|
46
46
|
## i18n
|
|
47
47
|
`select.search` (the search placeholder), `select.noResults` (the empty list),
|
|
48
48
|
`select.removeChip` (the chip's remove button).
|
|
49
49
|
|
|
50
50
|
## Examples
|
|
51
|
-
<KptSelect options={roles} value={role} onValueChange={setRole} placeholder="Choose
|
|
51
|
+
<KptSelect options={roles} value={role} onValueChange={setRole} placeholder="Choose..." />
|
|
52
52
|
<KptSelect options={roles} value={role} onValueChange={setRole} filter />
|
|
53
53
|
<KptSelect options={tags} value={tags} onValueChange={setTags} multiple filter />
|
|
54
54
|
|
|
@@ -56,9 +56,16 @@ There is no native field for the wrapper to read, so the select reports its fill
|
|
|
56
56
|
`id` goes to the focusable element, not the host; without one it comes from `KptFormField` or is
|
|
57
57
|
generated. A `div` with a role is not named by `label[for]`, so inside `KptFormField` it gets
|
|
58
58
|
`aria-labelledby` pointing at the wrapper's label (unless `aria-label` is set), and the hint or
|
|
59
|
-
error is added to `aria-describedby`. New: `id` and `required` (
|
|
59
|
+
error is added to `aria-describedby`. New: `id` and `required` (-> `aria-required`); the list gets
|
|
60
60
|
the same name as the trigger.
|
|
61
61
|
|
|
62
|
+
## Motion
|
|
63
|
+
With `multiple`, a chip of a newly picked option pops in at its place (chips follow the order of
|
|
64
|
+
`options`), a removed one - by its "x", by unpicking it in the list or by `Backspace` - fades and shrinks in
|
|
65
|
+
place while the rest slide over on a spring. Several changes at once (e.g. a new value set from code) go
|
|
66
|
+
without motion. Follows `enter` from `KptMotionProvider` (`spring` / `fade` / `none`); `enabled: false` and the
|
|
67
|
+
system "reduce motion" setting always win.
|
|
68
|
+
|
|
62
69
|
## Tokens
|
|
63
70
|
`--kpt-form-field-{bg,text,placeholder,border,border-hover,border-focus,border-error,radius}`,
|
|
64
71
|
`--kpt-color-surface-raised` and `--kpt-elevation-3` for the panel, `--kpt-z-overlay` for the layer.
|
package/dist/select/select.d.ts
CHANGED
|
@@ -4,16 +4,16 @@ import type { KptOption } from '../shared/types.ts';
|
|
|
4
4
|
export interface KptSelectProps<T> extends Omit<ComponentPropsWithRef<'div'>, 'children' | 'onChange' | 'defaultValue'>, KptI18nOverrides {
|
|
5
5
|
options?: readonly KptOption<T>[];
|
|
6
6
|
placeholder?: string;
|
|
7
|
-
/** Wybór wielokrotny
|
|
7
|
+
/** Wybór wielokrotny - wartością jest tablica, a wybrane opcje pokazują się jako chipy. */
|
|
8
8
|
multiple?: boolean;
|
|
9
9
|
/** Pole wyszukiwania nad listą. */
|
|
10
10
|
filter?: boolean;
|
|
11
|
-
/** Id wyzwalacza; bez niego generowane, w `KptFormField`
|
|
11
|
+
/** Id wyzwalacza; bez niego generowane, w `KptFormField` - z wrappera. */
|
|
12
12
|
id?: string;
|
|
13
13
|
/** Oznacza pole jako wymagane atrybutem `aria-required`. */
|
|
14
14
|
required?: boolean;
|
|
15
15
|
disabled?: boolean;
|
|
16
|
-
/** Tylko do odczytu
|
|
16
|
+
/** Tylko do odczytu - wybór widać, panel się nie otwiera (`aria-readonly`). */
|
|
17
17
|
readOnly?: boolean;
|
|
18
18
|
invalid?: boolean;
|
|
19
19
|
touched?: boolean;
|
|
@@ -21,7 +21,7 @@ export interface KptSelectProps<T> extends Omit<ComponentPropsWithRef<'div'>, 'c
|
|
|
21
21
|
value?: T | T[] | null;
|
|
22
22
|
defaultValue?: T | T[] | null;
|
|
23
23
|
onValueChange?: (value: T | T[] | null) => void;
|
|
24
|
-
/** Stan panelu
|
|
24
|
+
/** Stan panelu - pozwala otworzyć listę z zewnątrz i wiedzieć, kiedy user skończył wybierać. */
|
|
25
25
|
open?: boolean;
|
|
26
26
|
defaultOpen?: boolean;
|
|
27
27
|
onOpenChange?: (open: boolean) => void;
|
|
@@ -32,19 +32,19 @@ export interface KptSelectProps<T> extends Omit<ComponentPropsWithRef<'div'>, 'c
|
|
|
32
32
|
* Lista wyboru (select) na własnym panelu. Warianty: pojedynczy, z wyszukiwarką (`filter`)
|
|
33
33
|
* i wielokrotny (`multiple`, chipy).
|
|
34
34
|
*
|
|
35
|
-
* Klawiatura według wzorca WAI-ARIA
|
|
36
|
-
* idzie przez `aria-activedescendant`.
|
|
35
|
+
* Klawiatura według wzorca WAI-ARIA "select-only combobox": fokus zostaje na polu, a aktywna opcja
|
|
36
|
+
* idzie przez `aria-activedescendant`. `ArrowDown`/`ArrowUp`/`Enter`/`Spacja` otwierają listę na wybranej opcji,
|
|
37
37
|
* strzałki, `Home`/`End`, `PageUp`/`PageDown` chodzą po opcjach (z pominięciem wyłączonych),
|
|
38
38
|
* wpisywane litery skaczą do pasującej opcji (bez polskich znaków), `Enter` wybiera, `Escape`
|
|
39
39
|
* zamyka. Z `filter` fokus przechodzi do pola wyszukiwania, które obsługuje te same klawisze.
|
|
40
40
|
* W trybie `multiple` `Backspace` na zamkniętym polu usuwa ostatni wybór.
|
|
41
41
|
*
|
|
42
42
|
* Wewnątrz `KptFormField` zgłasza wypełnienie hookiem `useKptFormFieldFilled`, więc etykieta
|
|
43
|
-
* Float Label unosi się nad wybraną wartością
|
|
43
|
+
* Float Label unosi się nad wybraną wartością - natywnego pola, z którego wrapper mógłby to
|
|
44
44
|
* odczytać, tu nie ma.
|
|
45
45
|
*
|
|
46
46
|
* @example
|
|
47
|
-
* <KptSelect options={roles} value={role} onValueChange={setRole} placeholder="Wybierz
|
|
47
|
+
* <KptSelect options={roles} value={role} onValueChange={setRole} placeholder="Wybierz..." />
|
|
48
48
|
* <KptSelect options={tags} multiple filter value={tags} onValueChange={setTags} />
|
|
49
49
|
*/
|
|
50
50
|
export declare function KptSelect<T>({ options, placeholder, multiple, filter, disabled, readOnly, invalid, touched, value, defaultValue, onValueChange, open, defaultOpen, onOpenChange, onTouch, locale, dictionary, className, onBlur, id, required, 'aria-label': ariaLabel, 'aria-describedby': ariaDescribedBy, ...rest }: Readonly<KptSelectProps<T>>): import("react").JSX.Element;
|