@blackcube/aurelia-kit 1.0.0-rc6 → 1.0.0-rc7

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.
@@ -1,12 +1,16 @@
1
1
  import { IEventAggregator, ILogger, IPlatform } from "aurelia";
2
2
  import { ITransitionService } from '../services/transition-service';
3
3
  import { IStorageService } from '../services/storage-service';
4
+ import { ITrapFocusService } from '../services/trap-focus-service';
4
5
  /**
5
6
  * Side menu rendered by the PHP Sidebar widget: opened and closed through Channels.Menu with
6
7
  * the data-menu-show / data-menu-hide classes of the element; [data-menu=toggle-button-ID]
7
8
  * shows or hides [data-menu=toggle-list-ID] (hidden attribute, accordion: opening one closes the others) and sets
8
9
  * the data-menu-show / data-menu-hide classes of its svg[data-menu=icon]. The open sublists are kept in storage; a
9
10
  * button added after attaching is linked on its first click.
11
+ * Open, the focus is trapped in the menu (ITrapFocusService), on [data-menu=close] first, and the page (body) takes the
12
+ * data-menu-page-show classes of the element (data-menu-page-hide once closed). The close button, the overlay, Escape
13
+ * and a click on a link of the menu close it; the focus goes back to what opened it.
10
14
  */
11
15
  export declare class BleetMenuCustomAttribute {
12
16
  private readonly logger;
@@ -15,20 +19,38 @@ export declare class BleetMenuCustomAttribute {
15
19
  private readonly p;
16
20
  private readonly transitionService;
17
21
  private readonly storageService;
22
+ private readonly trapFocusService;
18
23
  private disposable?;
19
24
  private disposableOverlay?;
20
25
  private closeButton?;
21
26
  private toggleButtons?;
22
27
  private sublists;
23
28
  private isOpen;
24
- constructor(logger?: ILogger, ea?: IEventAggregator, element?: HTMLElement, p?: IPlatform, transitionService?: ITransitionService, storageService?: IStorageService);
29
+ private closingFromOverlay;
30
+ constructor(logger?: ILogger, ea?: IEventAggregator, element?: HTMLElement, p?: IPlatform, transitionService?: ITransitionService, storageService?: IStorageService, trapFocusService?: ITrapFocusService);
25
31
  attaching(): void;
26
32
  attached(): void;
27
33
  detaching(): void;
28
34
  dispose(): void;
35
+ /**
36
+ * The focus is trapped from what has it (the burger): it goes back there once the menu is closed. The trap starts
37
+ * once the show classes are set — the menu must be visible to take the focus. Its "outside" is the page: the
38
+ * click that opens the menu — outside the menu — would close it at once; the overlay, which covers the outside,
39
+ * closes it on a click.
40
+ */
29
41
  private open;
42
+ /**
43
+ * Every close stops the focus trap, which hides the menu (onStopTrapFocus): Escape stops it too. Closed in the
44
+ * frame it opens, the trap is not started yet: the menu is hidden at once.
45
+ */
30
46
  private close;
47
+ private hide;
48
+ private onStopTrapFocus;
31
49
  private onClickClose;
50
+ /**
51
+ * A link followed from the open menu closes it; the link is followed.
52
+ */
53
+ private onClickLink;
32
54
  private onClickToggleButtons;
33
55
  private initMenuButtons;
34
56
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../src/attributes/menu.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,gBAAgB,EAAE,OAAO,EAAS,SAAS,EAAU,MAAM,SAAS,CAAC;AAG3G,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAC;AAG5D;;;;;;GAMG;AACH,qBACa,wBAAwB;IAS7B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,EAAE;IACnB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAZnC,OAAO,CAAC,UAAU,CAAC,CAAc;IACjC,OAAO,CAAC,iBAAiB,CAAC,CAAc;IACxC,OAAO,CAAC,WAAW,CAAC,CAAoB;IACxC,OAAO,CAAC,aAAa,CAAC,CAAgC;IACtD,OAAO,CAAC,QAAQ,CAA4E;IAC5F,OAAO,CAAC,MAAM,CAAkB;gBAEX,MAAM,GAAE,OAAgD,EACxD,EAA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C,CAAoB;IACxC,OAAO,CAAC,aAAa,CAAC,CAAgC;IACtD,OAAO,CAAC,QAAQ,CAA4E;IAC5F,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,kBAAkB,CAAkB;gBAEvB,MAAM,GAAE,OAAgD,EACxD,EAAE,GAAC,gBAA4C,EAC/C,OAAO,GAAE,WAA2C,EACpD,CAAC,GAAE,SAA8B,EACjC,iBAAiB,GAAE,kBAAgD,EACnE,cAAc,GAAE,eAA0C,EAC1D,gBAAgB,GAAE,iBAA8C;IAK9E,SAAS;IAOT,QAAQ;IAUR,SAAS;IAcT,OAAO;IAMd;;;;;OAKG;IACH,OAAO,CAAC,IAAI;IAsBZ;;;OAGG;IACH,OAAO,CAAC,KAAK;IAWb,OAAO,CAAC,IAAI;IAkBZ,OAAO,CAAC,eAAe,CAItB;IAED,OAAO,CAAC,YAAY,CAInB;IAED;;OAEG;IACH,OAAO,CAAC,WAAW,CAMlB;IAED,OAAO,CAAC,oBAAoB,CAO3B;IAED,OAAO,CAAC,eAAe;IAOvB;;;OAGG;IACH,OAAO,CAAC,UAAU;IAYlB;;OAEG;IACH,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,WAAW,CAgBlB;IACD,OAAO,CAAC,eAAe,CAOtB;CACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blackcube/aurelia-kit",
3
- "version": "1.0.0-rc6",
3
+ "version": "1.0.0-rc7",
4
4
  "description": "Blackcube Aurelia 2 kit: custom attributes and services driven by the Bleet PHP widgets",
5
5
  "author": "Philippe Gaultier <philippe@blackcube.io>",
6
6
  "license": "BSD-3-Clause",