@orangelogic/design-system 3.47.0 → 3.48.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/library/chunks/{alert.C-yzkTnx.js → alert.CuW7fOVy.js} +2 -2
- package/library/chunks/{array-line-clamp.D17pOiME.js → array-line-clamp.VOjhwp2T.js} +2 -2
- package/library/chunks/{asset-link-format.eY9eXztL.js → asset-link-format.RxnH_rs9.js} +9 -9
- package/library/chunks/{audio.DILTfO5v.js → audio.D_O5ecXD.js} +2 -2
- package/library/chunks/{bicolor-picker.D_UcnmKA.js → bicolor-picker.D03k1yyx.js} +1 -1
- package/library/chunks/{block-width.CqI8DKGv.js → block-width.CqVLiUIp.js} +33 -33
- package/library/chunks/{border-input-group.Dft3PVHv.js → border-input-group.CEZXBhV6.js} +3 -3
- package/library/chunks/{breadcrumb.CtZqzMBY.js → breadcrumb.qggcceb5.js} +1 -1
- package/library/chunks/{button.BE-fTtOZ.js → button.Ccrk9fUD.js} +2 -2
- package/library/chunks/{color-picker.CRmQ0m9_.js → color-picker.BDko_QVl.js} +10 -10
- package/library/chunks/{color-swatch-group.DEejhH3V.js → color-swatch-group.GRM9PH0r.js} +17 -17
- package/library/chunks/{color-swatch.UEGHZZx2.js → color-swatch.sY1uNNSe.js} +3 -3
- package/library/chunks/{config-manager.BKcJUrun.js → config-manager.Bskq5Cxr.js} +27 -27
- package/library/chunks/{configs-controller.C9wMlr7Y.js → configs-controller.DdhZNSbu.js} +6 -6
- package/library/chunks/{confirm-popover.CO3IpiGV.js → confirm-popover.BjAGzV05.js} +4 -4
- package/library/chunks/{copy-button.DBhWr0mk.js → copy-button.BLHge7EN.js} +2 -2
- package/library/chunks/{corner-position-input-group.MBe9fFRv.js → corner-position-input-group.dK3EENR2.js} +4 -4
- package/library/chunks/{date-calendar.Dobpjwzs.js → date-calendar.UWxXkZCn.js} +1 -1
- package/library/chunks/{details.DRv08ocO.js → details.DLqFxjTf.js} +1 -1
- package/library/chunks/{dialog.BUEP_Yc3.js → dialog.Dw-WUyD8.js} +3 -3
- package/library/chunks/{document-viewer.DyohQ61p.js → document-viewer.B7_Adb8g.js} +13 -13
- package/library/chunks/{dot-pagination.D10yX9RB.js → dot-pagination.CSSalEx6.js} +2 -2
- package/library/chunks/{drawer.rdGcXxzU.js → drawer.tfa9-G6a.js} +2 -2
- package/library/chunks/{dropdown._AO9JH0m.js → dropdown.DUfiVpFI.js} +10 -12
- package/library/chunks/{dynamic-select.bmcldlUE.js → dynamic-select.BHa_Q600.js} +5 -5
- package/library/chunks/{e-chart.JrYFPEVr.js → e-chart.BopkVc04.js} +2 -2
- package/library/chunks/{element-clamp.DO-eDDRj.js → element-clamp.DzR3w7RX.js} +2 -2
- package/library/chunks/{file-on-demand._vAvELmv.js → file-on-demand.BEq7qWZd.js} +16 -16
- package/library/chunks/{folder-select.BlvnemXx.js → folder-select.BRJEfeyY.js} +7 -7
- package/library/chunks/{format-time.Dx24Hlhc.js → format-time.BO9Y72qk.js} +1 -1
- package/library/chunks/{header.DzQZMa38.js → header.qIpzHeNc.js} +2 -2
- package/library/chunks/{i18n.CpiuF-f4.js → i18n.BMXeDUpk.js} +1 -1
- package/library/chunks/{icon-button.8OdZOZsM.js → icon-button.CziUJUiX.js} +2 -2
- package/library/chunks/{iframe.C3N5F3yF.js → iframe.BnAR2-o2.js} +1 -1
- package/library/chunks/{image-comparer.Txi69uYU.js → image-comparer.DStatUUS.js} +1 -1
- package/library/chunks/{image.D1D8y17M.js → image.DzFSYcXq.js} +2 -2
- package/library/chunks/{input.HC75Gdv_.js → input.B3HfssSr.js} +1 -1
- package/library/chunks/{line-clamp.CnrGMrrC.js → line-clamp.DV3tlosD.js} +2 -2
- package/library/chunks/{markdown.CFxeg159.js → markdown.C-q35PEY.js} +2 -2
- package/library/chunks/{masonry.w1W1TERx.js → masonry.D7YK0FcU.js} +3 -3
- package/library/chunks/{menu-item.CyQdmKhm.js → menu-item.D-IE19Jn.js} +3 -3
- package/library/chunks/{menu.D9R--BnI.js → menu.3akay3Bh.js} +20 -18
- package/library/chunks/{option.CxsY_LQ-.js → option.9V-nTQp7.js} +1 -1
- package/library/chunks/{padding-input-group.DYHH1M0o.js → padding-input-group.DKIv6567.js} +1 -1
- package/library/chunks/{pagination.CanYvw0N.js → pagination.CJV7WdJj.js} +7 -7
- package/library/chunks/{popup.ALI72D04.js → popup.CxGrVXG-.js} +1 -1
- package/library/chunks/{position-picker.B3klGTsy.js → position-picker.CyXlSYCi.js} +1 -1
- package/library/chunks/{progress-bar.Br8Zi53n.js → progress-bar.Cp8jz3Cn.js} +1 -1
- package/library/chunks/{progress-ring.DjiHa9Bf.js → progress-ring.CMylJgKR.js} +1 -1
- package/library/chunks/{radio-card.DYSmJnTa.js → radio-card.D4B962Sg.js} +1 -1
- package/library/chunks/{range.JjDrbGgA.js → range.Dl85wEtv.js} +2 -2
- package/library/chunks/{rating.BqmvLuxp.js → rating.C-3rSMOT.js} +1 -1
- package/library/chunks/{relative-time.Tmj08T5g.js → relative-time.5fu63h4C.js} +1 -1
- package/library/chunks/{select.DGC0kysp.js → select.CM-1exjJ.js} +6 -6
- package/library/chunks/{shadow-input-group.CqJxTQGg.js → shadow-input-group.CpjriMC3.js} +2 -2
- package/library/chunks/{share-option-list.C7nOWbx0.js → share-option-list.BO50cnCs.js} +2 -2
- package/library/chunks/{sidebar.C7hLNDp-.js → sidebar.CDTaDQY_.js} +1 -1
- package/library/chunks/{size-input-group.DObavRHn.js → size-input-group.4NN5-92E.js} +5 -5
- package/library/chunks/{spinner.DXFJTymk.js → spinner.-79sJ3oo.js} +1 -1
- package/library/chunks/{split-panel.Bmfk4xJd.js → split-panel.DE2NmORY.js} +1 -1
- package/library/chunks/{src.0g5CasFQ.js → src.CQL20PqB.js} +47 -47
- package/library/chunks/{step.D_UKPog_.js → step.CIXS6vq7.js} +3 -3
- package/library/chunks/{stepper-wizard.BDezp3X-.js → stepper-wizard.Bydp0R7p.js} +2 -2
- package/library/chunks/{stepper.QkG9nzQk.js → stepper.DlYgTq-1.js} +1 -1
- package/library/chunks/{tab-group.DPFqybPz.js → tab-group.BVYwTGDS.js} +7 -7
- package/library/chunks/{tab.Bt9yrLEz.js → tab.BnFmdiPK.js} +3 -3
- package/library/chunks/{tag.CGDwKgUc.js → tag.ajqJVQQB.js} +3 -3
- package/library/chunks/{tooltip.Dxn_BH8D.js → tooltip.CGCOh4cQ.js} +2 -2
- package/library/chunks/{tree.B2qnckq5.js → tree.huEm605f.js} +3 -3
- package/library/chunks/{typeface.CcL21UKB.js → typeface.CtBzG7NU.js} +3 -3
- package/library/chunks/{video.uttqr317.js → video.Be2Oh_tS.js} +2 -2
- package/library/components/alert.js +1 -1
- package/library/components/array-line-clamp.js +1 -1
- package/library/components/asset-link-format.js +1 -1
- package/library/components/atoms.js +50 -50
- package/library/components/audio.js +1 -1
- package/library/components/bicolor-picker.js +1 -1
- package/library/components/border-input-group.js +1 -1
- package/library/components/breadcrumb.js +1 -1
- package/library/components/button.js +1 -1
- package/library/components/color-picker.js +1 -1
- package/library/components/color-swatch-group.js +1 -1
- package/library/components/color-swatch.js +1 -1
- package/library/components/confirm-popover.js +1 -1
- package/library/components/copy-button.js +1 -1
- package/library/components/corner-position-input-group.js +1 -1
- package/library/components/date-calendar.js +1 -1
- package/library/components/details.js +1 -1
- package/library/components/dialog.js +1 -1
- package/library/components/document-viewer.js +1 -1
- package/library/components/dot-pagination.js +1 -1
- package/library/components/drawer.js +1 -1
- package/library/components/dropdown.js +1 -1
- package/library/components/dynamic-select.js +1 -1
- package/library/components/e-chart.js +1 -1
- package/library/components/element-clamp.js +1 -1
- package/library/components/file-on-demand.js +1 -1
- package/library/components/folder-select.js +1 -1
- package/library/components/format-bytes.js +1 -1
- package/library/components/format-date.js +1 -1
- package/library/components/format-number.js +1 -1
- package/library/components/format-time.js +1 -1
- package/library/components/header.js +1 -1
- package/library/components/icon-button.js +1 -1
- package/library/components/iframe.js +1 -1
- package/library/components/image-comparer.js +1 -1
- package/library/components/image.js +1 -1
- package/library/components/input.js +1 -1
- package/library/components/line-clamp.js +1 -1
- package/library/components/markdown.js +1 -1
- package/library/components/masonry.js +1 -1
- package/library/components/menu-item.js +1 -1
- package/library/components/menu.js +1 -1
- package/library/components/molecules.js +16 -16
- package/library/components/option.js +1 -1
- package/library/components/organisms.js +3 -3
- package/library/components/padding-input-group.js +1 -1
- package/library/components/pagination.js +1 -1
- package/library/components/popup.js +1 -1
- package/library/components/position-picker.js +1 -1
- package/library/components/progress-bar.js +1 -1
- package/library/components/progress-ring.js +1 -1
- package/library/components/radio-card.js +1 -1
- package/library/components/range.js +1 -1
- package/library/components/rating.js +1 -1
- package/library/components/relative-time.js +1 -1
- package/library/components/select.js +1 -1
- package/library/components/shadow-input-group.js +1 -1
- package/library/components/share-option-list.js +1 -1
- package/library/components/sidebar.js +1 -1
- package/library/components/size-input-group.js +1 -1
- package/library/components/spinner.js +1 -1
- package/library/components/split-panel.js +1 -1
- package/library/components/step.js +1 -1
- package/library/components/stepper-wizard.js +1 -1
- package/library/components/stepper.js +1 -1
- package/library/components/tab-group.js +1 -1
- package/library/components/tab.js +1 -1
- package/library/components/tag.js +1 -1
- package/library/components/tooltip.js +1 -1
- package/library/components/tree-item.js +1 -1
- package/library/components/tree.js +1 -1
- package/library/components/typeface.js +1 -1
- package/library/components/types.js +11934 -11844
- package/library/components/video.js +1 -1
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/dropdown/dropdown.d.ts +0 -1
- package/library/packages/atoms/src/components/menu/menu.d.ts +4 -3
- package/library/packages/events/src/cx-capacity-week-bar.d.ts +2 -2
- package/library/packages/hybrid/rich-text/src/components/rich-text-toolbar/rich-text-toolbar.d.ts +4 -5
- package/library/packages/hybrid/rich-text/src/components/rich-text-toolbar/toolbar-list-actions.d.ts +45 -0
- package/library/packages/hybrid/rich-text/src/rich-text.d.ts +7 -0
- package/library/packages/organisms/src/capacity-planner/capacity-core.d.ts +16 -19
- package/library/packages/organisms/src/capacity-planner/capacity-planner.d.ts +50 -14
- package/library/packages/organisms/src/capacity-planner/components/capacity-week-bar/capacity-week-bar.d.ts +51 -26
- package/library/packages/react-web-component.d.ts +0 -4
- package/library/react-web-component.d.ts +1 -5
- package/library/utils.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../chunks/video.
|
|
1
|
+
import { n as e, t } from "../chunks/video.Be2Oh_tS.js";
|
|
2
2
|
export { t as VIDEO_BACKGROUND_SIZE_BY_OBJECT_FIT, e as default };
|
package/library/package.json
CHANGED
|
@@ -112,7 +112,6 @@ export default class CxDropdown extends CortexElement {
|
|
|
112
112
|
private handleKeyDown;
|
|
113
113
|
private handleDocumentKeyDown;
|
|
114
114
|
private handleDocumentMouseDown;
|
|
115
|
-
private handleDocumentFocusIn;
|
|
116
115
|
private handlePanelSelect;
|
|
117
116
|
handleTriggerClick(): Promise<void>;
|
|
118
117
|
handleTriggerKeyDown(event: KeyboardEvent): void;
|
|
@@ -23,6 +23,7 @@ export default class CxMenu extends CortexElement {
|
|
|
23
23
|
static styles: CSSResultGroup;
|
|
24
24
|
private readonly localize;
|
|
25
25
|
defaultSlot: HTMLSlotElement;
|
|
26
|
+
backSlot: HTMLSlotElement | null;
|
|
26
27
|
horizontal: boolean;
|
|
27
28
|
/** The menu's variant */
|
|
28
29
|
variant: MenuMode.Default | MenuMode.Multiple;
|
|
@@ -38,8 +39,6 @@ export default class CxMenu extends CortexElement {
|
|
|
38
39
|
bubbleKeyDown: boolean;
|
|
39
40
|
/** Override the default keydown navigation behavior of the dropdown menu. */
|
|
40
41
|
ignoredKeys: string[];
|
|
41
|
-
/** @deprecated Only stops ArrowUp/ArrowDown wrapping now; Tab is no longer intercepted. */
|
|
42
|
-
disabledTabLoop: boolean;
|
|
43
42
|
/** When true, checkbox items don't toggle off when already checked (same as each item's own `no-uncheck`). */
|
|
44
43
|
noUncheck: boolean;
|
|
45
44
|
resizeObserver: ResizeObserver | null;
|
|
@@ -57,7 +56,9 @@ export default class CxMenu extends CortexElement {
|
|
|
57
56
|
private setRovingTabIndex;
|
|
58
57
|
private isMenuSection;
|
|
59
58
|
private isMenuItem;
|
|
60
|
-
/**
|
|
59
|
+
/** Focuses a panel's tab stop, so focus doesn't stay behind in the panel that is being hidden. */
|
|
60
|
+
private focusPanelTabStop;
|
|
61
|
+
/** @internal Gets all menu items, back button first, ignoring dividers, headers, and other elements. */
|
|
61
62
|
getAllItems(): CxMenuItem[];
|
|
62
63
|
/** @internal Gets all slotted submenus, used for 'multiple' variant */
|
|
63
64
|
getAllSubMenus(): CxMenu[];
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* presentational — it forwards pointer/keyboard intent to its container via
|
|
5
5
|
* these events; all allocation math lives in the container.
|
|
6
6
|
*/
|
|
7
|
-
/** Fired when a resizable band is pressed (drag-to-
|
|
7
|
+
/** Fired when a resizable band is pressed (drag-to-resize start). */
|
|
8
8
|
export type CxCapacityWeekBarBandPointerDownEvent = CustomEvent<{
|
|
9
9
|
/** Measured pixel width of the bar element at press time (drift-proof). */
|
|
10
10
|
barWidth: number;
|
|
@@ -15,7 +15,7 @@ export type CxCapacityWeekBarBandPointerDownEvent = CustomEvent<{
|
|
|
15
15
|
/** Fired when a band is stepped via the keyboard (Arrow / Page keys). */
|
|
16
16
|
export type CxCapacityWeekBarBandStepEvent = CustomEvent<{
|
|
17
17
|
categoryId: string;
|
|
18
|
-
/** Signed hours to apply to the
|
|
18
|
+
/** Signed hours to apply to the stepped band only (the container clamps it). */
|
|
19
19
|
deltaHours: number;
|
|
20
20
|
}>;
|
|
21
21
|
declare global {
|
package/library/packages/hybrid/rich-text/src/components/rich-text-toolbar/rich-text-toolbar.d.ts
CHANGED
|
@@ -279,13 +279,12 @@ export default class CxRichTextToolbar extends CortexElement {
|
|
|
279
279
|
private getOrderedListStyleForToolbar;
|
|
280
280
|
private applyBulletListStyle;
|
|
281
281
|
private applyOrderedListStyle;
|
|
282
|
-
/**
|
|
282
|
+
/** The touched blocks of each list scope as one run, as a `setTextSelection` span. */
|
|
283
283
|
private collectSelectedBlockGroups;
|
|
284
|
-
/**
|
|
285
|
-
* Flattens each touched blank-line-separated section to paragraphs, then lets `applyToGroup`
|
|
286
|
-
* turn each one into its own list. Toggling off passes nothing, so off mirrors on.
|
|
287
|
-
*/
|
|
284
|
+
/** Flattens each touched run to paragraphs, then lets `applyToGroup` turn it into a list. */
|
|
288
285
|
private flattenSelectionGroups;
|
|
286
|
+
/** Unlists only the selected lines; lifting them splits the list around the selection. */
|
|
287
|
+
private unlistSelection;
|
|
289
288
|
/**
|
|
290
289
|
* Whether every touched block is already this list type — i.e. a click should remove
|
|
291
290
|
* (vs. add). Block-level on purpose: Tiptap's `isActive` is range-coverage based and
|
package/library/packages/hybrid/rich-text/src/components/rich-text-toolbar/toolbar-list-actions.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Command } from '@tiptap/core';
|
|
2
|
+
import { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
3
|
+
import { EditorState, Transaction } from '@tiptap/pm/state';
|
|
4
|
+
/** A block container the list toggles work inside, with the selection clipped to it. */
|
|
5
|
+
export type ListScope = {
|
|
6
|
+
from: number;
|
|
7
|
+
node: ProseMirrorNode;
|
|
8
|
+
/** Position of the container's first child. */
|
|
9
|
+
start: number;
|
|
10
|
+
to: number;
|
|
11
|
+
};
|
|
12
|
+
export type TouchedBlock = {
|
|
13
|
+
from: number;
|
|
14
|
+
node: ProseMirrorNode;
|
|
15
|
+
to: number;
|
|
16
|
+
};
|
|
17
|
+
export declare function isListNode(node: ProseMirrorNode): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The toggles work inside the nearest container around the selection that is not part of a list
|
|
20
|
+
* (a table cell, a blockquote, the document), with one scope per cell for a cell selection.
|
|
21
|
+
*/
|
|
22
|
+
export declare function listScopes(state: EditorState): ListScope[];
|
|
23
|
+
/** The direct children of the scopes that the selection touches, in document order. */
|
|
24
|
+
export declare function touchedBlocks(scopes: ListScope[]): TouchedBlock[];
|
|
25
|
+
/**
|
|
26
|
+
* clearNodes collapses the selection to a cursor; re-select [from, to] through the mapping, with
|
|
27
|
+
* `between` since a lifted boundary can map outside any text.
|
|
28
|
+
*/
|
|
29
|
+
export declare function reselectMappedRange(from: number, to: number): Command;
|
|
30
|
+
/**
|
|
31
|
+
* Takes the selected textblocks out of their lists. Replaces Tiptap's clearNodes, which resets
|
|
32
|
+
* their attributes (alignment, line height…), strips non-list wrappers such as a blockquote too,
|
|
33
|
+
* and walks a cached doc that goes stale once an earlier command in the chain changed an ancestor.
|
|
34
|
+
*/
|
|
35
|
+
export declare function clearNodesKeepingAttrs(): Command;
|
|
36
|
+
/** List items holding nothing but nested lists, within `ranges`. */
|
|
37
|
+
export declare function nestedOnlyItemPositions(doc: ProseMirrorNode, ranges: Array<{
|
|
38
|
+
from: number;
|
|
39
|
+
to: number;
|
|
40
|
+
}>): number[];
|
|
41
|
+
/**
|
|
42
|
+
* Lifting a parent item out of its list leaves its nested list in an item with no text of its own,
|
|
43
|
+
* which renders as a bare marker. Moves the nested items at `positions` up into the enclosing list.
|
|
44
|
+
*/
|
|
45
|
+
export declare function liftNestedOnlyItems(tr: Transaction, positions: number[]): void;
|
|
@@ -288,6 +288,13 @@ export default class CxRichText extends CortexElement {
|
|
|
288
288
|
private teardownEditor;
|
|
289
289
|
private initializeEditor;
|
|
290
290
|
private emitRichTextChange;
|
|
291
|
+
/** Hides the caret until the selection and placeholder have painted, so it does not jump. */
|
|
292
|
+
private revealCaretAfterPaint;
|
|
293
|
+
/**
|
|
294
|
+
* No blur() here: hosts save on cx-rich-text-blur. The DOM selection is collapsed by hand since
|
|
295
|
+
* it still spans the emptied <p>, which shadowRoot.getSelection() wrongly reports as collapsed.
|
|
296
|
+
*/
|
|
297
|
+
private resetEmptyCaret;
|
|
291
298
|
private shouldCheckForbiddenKeys;
|
|
292
299
|
private getLegacyKeyCodeFromKeyboardEvent;
|
|
293
300
|
private getLegacyKeyCodeFromBeforeInputEvent;
|
|
@@ -2,7 +2,7 @@ import { CapacityCategory } from '../../../types/src/capacity-planner';
|
|
|
2
2
|
import { clamp, quantizeLargestRemainder } from '../../../utils/src/custom-element/math';
|
|
3
3
|
import { isoWeekNumber } from '../../../utils/src/date';
|
|
4
4
|
export { clamp, isoWeekNumber, quantizeLargestRemainder };
|
|
5
|
-
/** Minimum hours
|
|
5
|
+
/** Minimum hours an active category bottoms out at when edited down. */
|
|
6
6
|
export declare const FLOOR = 0.2;
|
|
7
7
|
/**
|
|
8
8
|
* Reserved id for the synthetic "Unavailable" pseudo-category. It is never
|
|
@@ -29,12 +29,6 @@ export interface CapacityConstraints {
|
|
|
29
29
|
/** Optional per-category clamp (max hours a single REAL category may hold). */
|
|
30
30
|
maxHourPerCell?: number;
|
|
31
31
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Adjust the largest non-pinned band so the total is exactly C, correcting any
|
|
34
|
-
* accumulated float drift. `pinned` is the index that must not be touched
|
|
35
|
-
* (the grabbed band on a drag); pass `-1` to allow correcting any band.
|
|
36
|
-
*/
|
|
37
|
-
export declare function correctToCapacity(vals: number[], pinned: number, capacity: number): number[];
|
|
38
32
|
/**
|
|
39
33
|
* Per-band cap over the EFFECTIVE set (reals + Unavailable). The cap applies
|
|
40
34
|
* to REAL categories only — the synthetic Unavailable band (always the LAST
|
|
@@ -48,9 +42,8 @@ export declare function effectiveCapFor(index: number, n: number, maxHourPerCell
|
|
|
48
42
|
* across the bands at `indices`, proportional to `weightFor(j)`, writing the
|
|
49
43
|
* result into `vals[j]`. Implemented as a capped water-fill: whenever a band
|
|
50
44
|
* would exceed `capFor(j)`, it is pinned at its cap and its surplus spills onto
|
|
51
|
-
* the still-uncapped bands. Each band gets at least `floorFor(j)`.
|
|
52
|
-
*
|
|
53
|
-
* the cap behaviour cannot diverge between drag and copy.
|
|
45
|
+
* the still-uncapped bands. Each band gets at least `floorFor(j)`. Used by the
|
|
46
|
+
* copy/fill/paste normalize (`normalizeWeekToCapacity`) to enforce the cap.
|
|
54
47
|
*/
|
|
55
48
|
export declare function cappedWaterFill(vals: number[], indices: number[], pool: number, capFor: (index: number) => number, floorFor: (index: number) => number, weightFor: (index: number) => number): void;
|
|
56
49
|
/**
|
|
@@ -65,16 +58,20 @@ export declare function cappedWaterFill(vals: number[], indices: number[], pool:
|
|
|
65
58
|
*/
|
|
66
59
|
export declare function normalizeWeekToCapacity(allocations: Record<string, number>, categories: CapacityCategory[], { capacity, maxHourPerCell }: CapacityConstraints): Record<string, number>;
|
|
67
60
|
/**
|
|
68
|
-
*
|
|
69
|
-
* followed by the synthetic Unavailable band).
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
61
|
+
* Independent edit of ONE real category on EFFECTIVE band `catIndex` (the reals
|
|
62
|
+
* followed by the synthetic Unavailable band). Only the edited band and
|
|
63
|
+
* Unavailable change; every other band is returned exactly as it was in `snap`.
|
|
64
|
+
*
|
|
65
|
+
* - An increase takes only spare hours (what Unavailable holds), up to the
|
|
66
|
+
* band's cap (`maxHourPerCell`).
|
|
67
|
+
* - A decrease returns the hours to Unavailable. An active band (≥ FLOOR)
|
|
68
|
+
* bottoms at FLOOR, and a result in (0, FLOOR) snaps to 0.
|
|
69
|
+
* - Data already over the cap or over capacity can shrink but never grow.
|
|
70
|
+
* - Editing Unavailable itself returns the snapshot unchanged.
|
|
75
71
|
*
|
|
76
|
-
* `snap` is the FULL effective snapshot (reals + Unavailable, Unavailable last)
|
|
72
|
+
* `snap` is the FULL effective snapshot (reals + Unavailable, Unavailable last);
|
|
73
|
+
* its values are ≥ 0.
|
|
77
74
|
*/
|
|
78
|
-
export declare function
|
|
75
|
+
export declare function adjustBand(snap: number[], catIndex: number, deltaHours: number, { capacity, maxHourPerCell }: CapacityConstraints): number[];
|
|
79
76
|
/** Stable deterministic palette color for a category with no explicit color. */
|
|
80
77
|
export declare function colorForCategory(id: string, index: number): string;
|
|
@@ -13,17 +13,19 @@ export type CapacityEditMode = 'adjust' | 'copy';
|
|
|
13
13
|
/**
|
|
14
14
|
* @summary Individual weekly capacity planner. Each week distributes a fixed
|
|
15
15
|
* weekly capacity across work categories as a horizontal bar of colored bands.
|
|
16
|
-
* Users either drag a band to
|
|
17
|
-
* range. A reserved, component-synthesized "Unavailable"
|
|
18
|
-
* each week up to the weekly capacity, so the UI total is
|
|
19
|
-
* capacity while the REAL categories may sum to LESS.
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
16
|
+
* Users either drag (or arrow-key) a category band to change its hours or copy
|
|
17
|
+
* whole weeks across a range. A reserved, component-synthesized "Unavailable"
|
|
18
|
+
* (grey) band fills each week up to the weekly capacity, so the UI total is
|
|
19
|
+
* ALWAYS exactly the capacity while the REAL categories may sum to LESS.
|
|
20
|
+
* Editing one category only moves that category and Unavailable, which is
|
|
21
|
+
* derived and cannot be edited. Hours are rounded for display/save. The
|
|
22
|
+
* Unavailable band is NEVER saved: edits emit a debounced `cx-capacity-change`
|
|
23
|
+
* carrying ONLY the real categories for each edited week, with integer hours
|
|
24
|
+
* (largest-remainder) that sum to round(capacity) − round(unavailable) and
|
|
25
|
+
* match the visible labels. Read `currentWeeks` to save the complete live
|
|
26
|
+
* allocation snapshot immediately, including edits whose change event has not
|
|
27
|
+
* emitted yet. Untouched weeks keep their original fractional hours; edited
|
|
28
|
+
* weeks match the integer labels.
|
|
27
29
|
*
|
|
28
30
|
* @event {{ weeks: Array<{ weekStart: string, allocations: Array<{ categoryId: string, hours: number }> }> }} cx-capacity-change - Debounced (~1000ms) emit of every edited week's REAL category allocations (integer hours; the unallocated remainder is implicit and the synthetic Unavailable band is never included).
|
|
29
31
|
*/
|
|
@@ -61,8 +63,11 @@ export default class CxCapacityPlanner extends CortexElement {
|
|
|
61
63
|
private filling;
|
|
62
64
|
private fillToW;
|
|
63
65
|
private copyMsg;
|
|
66
|
+
/** Measured width of a week bar (px); a fallback for the bars' own sizing. */
|
|
64
67
|
private barWidth;
|
|
65
68
|
private readonly scrollEl;
|
|
69
|
+
/** The first week bar; every week bar has the same width. */
|
|
70
|
+
private readonly rowBarEl;
|
|
66
71
|
/**
|
|
67
72
|
* Live plan: plan[weekIndex] = { categoryId -> hours } as floats. This is a
|
|
68
73
|
* plain field (not reactive) because it mutates many times per drag frame; we
|
|
@@ -71,6 +76,10 @@ export default class CxCapacityPlanner extends CortexElement {
|
|
|
71
76
|
private plan;
|
|
72
77
|
/** Indices of weeks edited since the last debounced emit. */
|
|
73
78
|
private readonly dirtyWeeks;
|
|
79
|
+
/** Edits must remain visible to synchronous saves after the debounced emit. */
|
|
80
|
+
private readonly editedWeeks;
|
|
81
|
+
private planWeeks?;
|
|
82
|
+
private planCategories?;
|
|
74
83
|
private interaction;
|
|
75
84
|
private rafId;
|
|
76
85
|
private flashTimer;
|
|
@@ -79,6 +88,14 @@ export default class CxCapacityPlanner extends CortexElement {
|
|
|
79
88
|
constructor();
|
|
80
89
|
runConnectedCallback(): void;
|
|
81
90
|
disconnectedCallback(): void;
|
|
91
|
+
runFirstUpdated(): void;
|
|
92
|
+
/**
|
|
93
|
+
* Detached snapshot of all weeks, available synchronously before and after
|
|
94
|
+
* `cx-capacity-change`. Edited weeks use the same integer hours as that event;
|
|
95
|
+
* untouched weeks retain their input allocations. Never includes Unavailable.
|
|
96
|
+
* Replacing `weeks` or `categories` discards the previous input's edits.
|
|
97
|
+
*/
|
|
98
|
+
get currentWeeks(): CapacityWeek[];
|
|
82
99
|
/**
|
|
83
100
|
* The synthetic Unavailable pseudo-category. NOT part of the
|
|
84
101
|
* server-provided `categories` prop — appended internally as the LAST band so
|
|
@@ -126,17 +143,31 @@ export default class CxCapacityPlanner extends CortexElement {
|
|
|
126
143
|
*/
|
|
127
144
|
private get capacityConstraints();
|
|
128
145
|
private clamp;
|
|
129
|
-
private correctToCapacity;
|
|
130
146
|
private effectiveCapFor;
|
|
131
147
|
private cappedWaterFill;
|
|
132
148
|
private normalizeWeekToCapacity;
|
|
133
|
-
private
|
|
149
|
+
private adjustBand;
|
|
150
|
+
/** Live float hours of a week over the effective set (reals + Unavailable). */
|
|
151
|
+
private weekValues;
|
|
152
|
+
/**
|
|
153
|
+
* Starting point for a band edit: the week snapped to its DISPLAYED integers
|
|
154
|
+
* (reals = the largest-remainder labels, Unavailable = C − Σreals). Editing
|
|
155
|
+
* one category then only moves that category and Unavailable, so leftover
|
|
156
|
+
* fractions in legacy data cannot flip the label of another category.
|
|
157
|
+
*/
|
|
158
|
+
private editSnapshot;
|
|
134
159
|
private writeWeek;
|
|
135
160
|
private copyWeek;
|
|
136
161
|
private markDirty;
|
|
137
162
|
private scheduleEmit;
|
|
138
163
|
private emitChange;
|
|
139
164
|
private scheduleRender;
|
|
165
|
+
/**
|
|
166
|
+
* Cache the real width of a week bar as the `bar-width` fallback. The bars
|
|
167
|
+
* size their bands in CSS and measure themselves, and a drag snapshots the
|
|
168
|
+
* live bar width on pointer-down, so this value only matters before a bar
|
|
169
|
+
* has measured itself.
|
|
170
|
+
*/
|
|
140
171
|
private measure;
|
|
141
172
|
private handleResize;
|
|
142
173
|
private bandsForWeek;
|
|
@@ -144,10 +175,15 @@ export default class CxCapacityPlanner extends CortexElement {
|
|
|
144
175
|
/** Read the week index from the `data-week-index` attr on the event target. */
|
|
145
176
|
private weekIndexFromEvent;
|
|
146
177
|
private handleBandPointerDown;
|
|
147
|
-
/** Keyboard step on a band — routed through the SAME
|
|
178
|
+
/** Keyboard step on a band — routed through the SAME adjustBand + emit. */
|
|
148
179
|
private handleBandStep;
|
|
149
180
|
private handlePointerMove;
|
|
150
181
|
private handlePointerUp;
|
|
182
|
+
/**
|
|
183
|
+
* Snap a dragged week to the whole hours its labels show; keyboard edits
|
|
184
|
+
* already are.
|
|
185
|
+
*/
|
|
186
|
+
private snapWeekToLabels;
|
|
151
187
|
private weekFromY;
|
|
152
188
|
private handleScrollPointerDown;
|
|
153
189
|
private handleFillPointerDown;
|
|
@@ -12,7 +12,12 @@ export interface CapacityBand {
|
|
|
12
12
|
categoryName: string;
|
|
13
13
|
/** Background color (already resolved to a concrete CSS color). */
|
|
14
14
|
color: string;
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Hours derived from the other bands (the synthetic "Unavailable" band): never
|
|
17
|
+
* a slider, even on a `resizable` bar, and it fills whatever the others leave.
|
|
18
|
+
*/
|
|
19
|
+
derived?: boolean;
|
|
20
|
+
/** Hours for this band; a real band is `hours / capacity` of the bar wide. */
|
|
16
21
|
hours: number;
|
|
17
22
|
/** Full label text, e.g. "12h · Reviews". */
|
|
18
23
|
label: string;
|
|
@@ -20,21 +25,24 @@ export interface CapacityBand {
|
|
|
20
25
|
shortLabel: string;
|
|
21
26
|
/** Tooltip text, e.g. "Reviews · 12h" (set when no inline label fits). */
|
|
22
27
|
tip: string;
|
|
23
|
-
/**
|
|
24
|
-
* When true the band ignores `maxHourPerCell` for its slider ceiling (used by
|
|
25
|
-
* the synthetic "Unavailable" band, which is uncapped). Optional; defaults
|
|
26
|
-
* to capped behaviour.
|
|
27
|
-
*/
|
|
28
|
-
uncapped?: boolean;
|
|
29
28
|
}
|
|
30
29
|
/**
|
|
31
|
-
* @summary Presentational capacity bar: a
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
30
|
+
* @summary Presentational capacity bar: a row of category bands on a FIXED
|
|
31
|
+
* scale. A real band is exactly `hours / capacity` of the bar wide, so the same
|
|
32
|
+
* hours give the same length in every week and at every position; a `derived`
|
|
33
|
+
* band (the grey "Unavailable" band the container synthesizes) fills the rest
|
|
34
|
+
* and shrinks to nothing when the week is full. All mutation/allocation logic
|
|
35
|
+
* lives in the `cx-capacity-planner` container — this component only renders
|
|
36
|
+
* bands and forwards pointer/keyboard intent. When `resizable`, real bands are
|
|
37
|
+
* exposed as ARIA sliders (mirroring `cx-range`); a 0-hour one stays focusable
|
|
38
|
+
* and is grabbed through a small handle outside the flow. Data over the
|
|
39
|
+
* capacity is clipped at the right edge, marked with a thin danger-coloured
|
|
40
|
+
* line.
|
|
41
|
+
*
|
|
42
|
+
* @cssproperty [--cx-capacity-bar-height=22px] - Height of the bar.
|
|
43
|
+
* @cssproperty [--cx-capacity-bar-radius=6px] - Corner radius of the bar.
|
|
44
|
+
* @cssproperty --cx-capacity-track-bg - Background of the track behind the bands.
|
|
45
|
+
* @cssproperty [--cx-capacity-zero-handle-width=10px] - Width of the grab handle shown for a 0-hour band.
|
|
38
46
|
*
|
|
39
47
|
* @event {{ barWidth: number, categoryId: string, pointerEvent: PointerEvent }} cx-capacity-week-bar-band-pointer-down - Fired when a resizable band is pressed.
|
|
40
48
|
* @event {{ categoryId: string, deltaHours: number }} cx-capacity-week-bar-band-step - Fired when a band is stepped via the keyboard.
|
|
@@ -50,18 +58,22 @@ export default class CxCapacityWeekBar extends CortexElement {
|
|
|
50
58
|
barWidth: number;
|
|
51
59
|
/** Total weekly capacity (C). The bands always sum to it (incl. Unavailable). */
|
|
52
60
|
capacity: number;
|
|
53
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* Kept for backward compatibility; it no longer affects layout. Band widths
|
|
63
|
+
* follow the fixed `hours / capacity` scale, and a 0-hour band on a resizable
|
|
64
|
+
* bar is grabbed through its handle rather than a floor-width sliver.
|
|
65
|
+
*/
|
|
54
66
|
floor: number;
|
|
55
67
|
/** Optional per-band slider ceiling (max hours a single band may hold). */
|
|
56
68
|
maxHourPerCell?: number;
|
|
57
|
-
/** Whether bands are resizable (
|
|
69
|
+
/** Whether non-derived bands are resizable (draggable / keyboard steppable). */
|
|
58
70
|
resizable: boolean;
|
|
59
71
|
/**
|
|
60
|
-
* When true, a band with 0 hours
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
72
|
+
* When true, a band with 0 hours is removed from the accessibility tree and
|
|
73
|
+
* gets no grab handle, so a 0-hours category simply does not show — for
|
|
74
|
+
* read-only displays (e.g. mini-bars) where there is nothing to drag. Every
|
|
75
|
+
* 0-hour band is 0px wide either way; defaults false, so on a resizable bar a
|
|
76
|
+
* 0-hours category keeps its handle and stays grabbable to grow back.
|
|
65
77
|
*/
|
|
66
78
|
collapseZeroBands: boolean;
|
|
67
79
|
/** Px width threshold above which the full "{h}h · {name}" label is shown. */
|
|
@@ -70,6 +82,11 @@ export default class CxCapacityWeekBar extends CortexElement {
|
|
|
70
82
|
shortLabelThreshold: number;
|
|
71
83
|
private readonly barEl;
|
|
72
84
|
private summary;
|
|
85
|
+
/** Hours not held by an editable band: capacity − Σ non-derived hours (≥ 0). */
|
|
86
|
+
private spareHours;
|
|
87
|
+
/** True when the editable bands hold more than the capacity (clipped data). */
|
|
88
|
+
private overCapacity;
|
|
89
|
+
/** Display geometry of each band, parallel to `bands`. */
|
|
73
90
|
private geometries;
|
|
74
91
|
/** Actual rendered width of the bar element, updated by ResizeObserver. */
|
|
75
92
|
renderedBarWidth: number;
|
|
@@ -89,13 +106,21 @@ export default class CxCapacityWeekBar extends CortexElement {
|
|
|
89
106
|
* `render` so the tip shows/hides in exact sync with the inline label (and so
|
|
90
107
|
* the tip text tracks a band being resized under a captured pointer).
|
|
91
108
|
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* (quantized) hours.
|
|
109
|
+
* Every band is on the same fixed scale, so the label thresholds see the
|
|
110
|
+
* band's real width. A real 0-hour band on a resizable bar is `zero` (0px,
|
|
111
|
+
* grabbed through its handle); in `collapseZeroBands` mode a 0-hour band is
|
|
112
|
+
* `collapsed` instead.
|
|
97
113
|
*/
|
|
98
114
|
private bandGeometry;
|
|
115
|
+
/**
|
|
116
|
+
* Place the handle of every `zero` band, writing `zeroIndex` / `zeroAtEnd`
|
|
117
|
+
* into `geometries`. Consecutive 0-hour handles would all sit on the same
|
|
118
|
+
* spot, so each run of them gets increasing indices and the handles are laid
|
|
119
|
+
* side by side. A run that starts at (or past) the right edge of the bar is
|
|
120
|
+
* drawn leftwards instead, so the edge does not clip it. Bands that take no
|
|
121
|
+
* width (other 0-hour bands) do not break a run.
|
|
122
|
+
*/
|
|
123
|
+
private placeZeroHandles;
|
|
99
124
|
private renderBand;
|
|
100
125
|
render(): TemplateResult;
|
|
101
126
|
}
|
|
@@ -5004,10 +5004,6 @@ interface CxMenuAttributes extends HTMLAttributes<CxMenu> {
|
|
|
5004
5004
|
* Override the default keydown navigation behavior of the dropdown menu.
|
|
5005
5005
|
*/
|
|
5006
5006
|
ignoredKeys?: string[];
|
|
5007
|
-
/**
|
|
5008
|
-
*
|
|
5009
|
-
*/
|
|
5010
|
-
disabledTabLoop?: boolean;
|
|
5011
5007
|
/**
|
|
5012
5008
|
* When true, checkbox items in this menu do not toggle off when already activated while checked—the same behavior as setting `no-uncheck` on each checkbox item.
|
|
5013
5009
|
*/
|
|
@@ -884,10 +884,6 @@
|
|
|
884
884
|
* Override the default keydown navigation behavior of the dropdown menu.
|
|
885
885
|
*/
|
|
886
886
|
ignoredKeys?: string[];
|
|
887
|
-
/**
|
|
888
|
-
* @deprecated Only stops ArrowUp/ArrowDown wrapping now; Tab is no longer intercepted.
|
|
889
|
-
*/
|
|
890
|
-
disabledTabLoop?: boolean;
|
|
891
887
|
/**
|
|
892
888
|
* When true, checkbox items don't toggle off when already checked (same as each item's own `no-uncheck`).
|
|
893
889
|
*/
|
|
@@ -8434,7 +8430,7 @@
|
|
|
8434
8430
|
preRender?: boolean;
|
|
8435
8431
|
}
|
|
8436
8432
|
/**
|
|
8437
|
-
* Individual weekly capacity planner. Each week distributes a fixed weekly capacity across work categories as a horizontal bar of colored bands. Users either drag a band to
|
|
8433
|
+
* Individual weekly capacity planner. Each week distributes a fixed weekly capacity across work categories as a horizontal bar of colored bands. Users either drag (or arrow-key) a category band to change its hours or copy whole weeks across a range. A reserved, component-synthesized "Unavailable" (grey) band fills each week up to the weekly capacity, so the UI total is ALWAYS exactly the capacity while the REAL categories may sum to LESS. Editing one category only moves that category and Unavailable, which is derived and cannot be edited. Hours are rounded for display/save. The Unavailable band is NEVER saved: edits emit a debounced `cx-capacity-change` carrying ONLY the real categories for each edited week, with integer hours (largest-remainder) that sum to round(capacity) − round(unavailable) and match the visible labels. Read `currentWeeks` to save the complete live allocation snapshot immediately, including edits whose change event has not emitted yet. Untouched weeks keep their original fractional hours; edited weeks match the integer labels.
|
|
8438
8434
|
*/
|
|
8439
8435
|
interface CxCapacityPlannerAttributes extends HTMLAttributes<CxCapacityPlanner> {
|
|
8440
8436
|
|
package/library/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as e, i as t, n, o as r, r as i, t as a } from "./chunks/event.C11S4obG.js";
|
|
2
2
|
import { t as o } from "./chunks/custom-element.BEMYNDK1.js";
|
|
3
|
-
import { r as s, t as c } from "./chunks/i18n.
|
|
3
|
+
import { r as s, t as c } from "./chunks/i18n.BMXeDUpk.js";
|
|
4
4
|
import { n as l, r as u, t as d } from "./chunks/slot.CZUlACxT.js";
|
|
5
5
|
import { t as f } from "./chunks/watch.Ub5r8btz.js";
|
|
6
6
|
import { C as p, S as m, _ as h, a as g, b as _, c as ee, d as te, f as ne, g as re, h as ie, i as ae, l as oe, m as se, n as ce, o as le, p as ue, r as de, s as fe, t as pe, u as me, v as he, w as ge, x as _e, y as ve } from "./chunks/string.DamEXDH2.js";
|