@limetech/lime-elements 40.4.1 → 40.5.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.
Files changed (134) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/component-UyqdiWGc.js +1576 -0
  3. package/dist/cjs/lime-elements.cjs.js +1 -1
  4. package/dist/cjs/limel-action-bar_3.cjs.entry.js +1 -1
  5. package/dist/cjs/limel-ai-avatar.cjs.entry.js +1 -1
  6. package/dist/cjs/{limel-breadcrumbs_8.cjs.entry.js → limel-breadcrumbs_6.cjs.entry.js} +221 -2175
  7. package/dist/cjs/limel-callout.cjs.entry.js +1 -1
  8. package/dist/cjs/limel-chart.cjs.entry.js +1 -1
  9. package/dist/cjs/limel-chip-set.cjs.entry.js +1 -1
  10. package/dist/cjs/limel-chip_2.cjs.entry.js +1 -1
  11. package/dist/cjs/limel-code-diff.cjs.entry.js +1 -1
  12. package/dist/cjs/limel-code-editor.cjs.entry.js +1 -1
  13. package/dist/cjs/limel-collapsible-section.cjs.entry.js +1 -1
  14. package/dist/cjs/limel-drag-handle.cjs.entry.js +1 -1
  15. package/dist/cjs/limel-email-viewer.cjs.entry.js +1 -1
  16. package/dist/cjs/limel-file-viewer.cjs.entry.js +1 -1
  17. package/dist/cjs/limel-file.cjs.entry.js +1 -1
  18. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +1 -1
  19. package/dist/cjs/limel-helper-line_3.cjs.entry.js +454 -0
  20. package/dist/cjs/limel-list-item.cjs.entry.js +1 -1
  21. package/dist/cjs/limel-pagination-jump.cjs.entry.js +182 -0
  22. package/dist/cjs/limel-pagination.cjs.entry.js +165 -126
  23. package/dist/cjs/limel-picker.cjs.entry.js +1 -1
  24. package/dist/cjs/limel-popover_2.cjs.entry.js +33 -25
  25. package/dist/cjs/limel-profile-picture.cjs.entry.js +1 -1
  26. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
  27. package/dist/cjs/limel-slider.cjs.entry.js +1 -1
  28. package/dist/cjs/limel-snackbar.cjs.entry.js +1 -1
  29. package/dist/cjs/limel-table.cjs.entry.js +1 -1
  30. package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +1 -1
  31. package/dist/cjs/loader.cjs.js +1 -1
  32. package/dist/cjs/pagination.util-B5zzH8vg.js +135 -0
  33. package/dist/cjs/{translations-C5T2-_rH.js → translations-DFFpR6AZ.js} +32 -0
  34. package/dist/collection/collection-manifest.json +1 -0
  35. package/dist/collection/components/menu/menu.js +44 -22
  36. package/dist/collection/components/pagination/jump/pagination-jump.css +11 -0
  37. package/dist/collection/components/pagination/jump/pagination-jump.js +331 -0
  38. package/dist/collection/components/pagination/pagination.css +8 -4
  39. package/dist/collection/components/pagination/pagination.js +167 -10
  40. package/dist/collection/components/pagination/pagination.util.js +25 -8
  41. package/dist/collection/components/popover/popover.js +33 -25
  42. package/dist/collection/translations/da.js +4 -0
  43. package/dist/collection/translations/de.js +4 -0
  44. package/dist/collection/translations/en.js +4 -0
  45. package/dist/collection/translations/fi.js +4 -0
  46. package/dist/collection/translations/fr.js +4 -0
  47. package/dist/collection/translations/nl.js +4 -0
  48. package/dist/collection/translations/no.js +4 -0
  49. package/dist/collection/translations/sv.js +4 -0
  50. package/dist/esm/component-B2Vy44Z3.js +1570 -0
  51. package/dist/esm/lime-elements.js +1 -1
  52. package/dist/esm/limel-action-bar_3.entry.js +1 -1
  53. package/dist/esm/limel-ai-avatar.entry.js +1 -1
  54. package/dist/esm/{limel-breadcrumbs_8.entry.js → limel-breadcrumbs_6.entry.js} +47 -1999
  55. package/dist/esm/limel-callout.entry.js +1 -1
  56. package/dist/esm/limel-chart.entry.js +1 -1
  57. package/dist/esm/limel-chip-set.entry.js +1 -1
  58. package/dist/esm/limel-chip_2.entry.js +1 -1
  59. package/dist/esm/limel-code-diff.entry.js +1 -1
  60. package/dist/esm/limel-code-editor.entry.js +1 -1
  61. package/dist/esm/limel-collapsible-section.entry.js +1 -1
  62. package/dist/esm/limel-drag-handle.entry.js +1 -1
  63. package/dist/esm/limel-email-viewer.entry.js +1 -1
  64. package/dist/esm/limel-file-viewer.entry.js +1 -1
  65. package/dist/esm/limel-file.entry.js +1 -1
  66. package/dist/esm/limel-flatpickr-adapter.entry.js +1 -1
  67. package/dist/esm/limel-helper-line_3.entry.js +450 -0
  68. package/dist/esm/limel-list-item.entry.js +1 -1
  69. package/dist/esm/limel-pagination-jump.entry.js +180 -0
  70. package/dist/esm/limel-pagination.entry.js +165 -126
  71. package/dist/esm/limel-picker.entry.js +1 -1
  72. package/dist/esm/limel-popover_2.entry.js +33 -25
  73. package/dist/esm/limel-profile-picture.entry.js +1 -1
  74. package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
  75. package/dist/esm/limel-slider.entry.js +1 -1
  76. package/dist/esm/limel-snackbar.entry.js +1 -1
  77. package/dist/esm/limel-table.entry.js +1 -1
  78. package/dist/esm/limel-text-editor-link-menu.entry.js +1 -1
  79. package/dist/esm/loader.js +1 -1
  80. package/dist/esm/pagination.util-CSC2LJ7P.js +132 -0
  81. package/dist/esm/{translations-Bwm2y2E4.js → translations-DMtX4tTX.js} +32 -0
  82. package/dist/lime-elements/lime-elements.esm.js +1 -1
  83. package/dist/lime-elements/{p-2bbdac10.entry.js → p-11a96a8c.entry.js} +1 -1
  84. package/dist/lime-elements/p-1dd86ad4.entry.js +1 -0
  85. package/dist/lime-elements/p-1e93473a.entry.js +1 -0
  86. package/dist/lime-elements/{p-a41b5ff3.entry.js → p-2e568c56.entry.js} +1 -1
  87. package/dist/lime-elements/{p-de631fc3.entry.js → p-2f57c3fa.entry.js} +1 -1
  88. package/dist/lime-elements/p-3735111e.entry.js +1 -0
  89. package/dist/lime-elements/{p-c823054d.entry.js → p-452b9b01.entry.js} +1 -1
  90. package/dist/lime-elements/{p-f333f12d.entry.js → p-4855dc9b.entry.js} +1 -1
  91. package/dist/lime-elements/{p-a462aeb7.entry.js → p-4902fb3f.entry.js} +1 -1
  92. package/dist/lime-elements/p-507cc8a1.entry.js +159 -0
  93. package/dist/lime-elements/{p-dadd2e17.entry.js → p-531b6a64.entry.js} +1 -1
  94. package/dist/lime-elements/{p-b194a212.entry.js → p-5698e493.entry.js} +1 -1
  95. package/dist/lime-elements/{p-65a9adfc.entry.js → p-67f02b69.entry.js} +1 -1
  96. package/dist/lime-elements/{p-1162dd39.entry.js → p-867681aa.entry.js} +1 -1
  97. package/dist/lime-elements/{p-f72ee01b.entry.js → p-90df3e1b.entry.js} +1 -1
  98. package/dist/lime-elements/{p-22f85b99.entry.js → p-955292eb.entry.js} +1 -1
  99. package/dist/lime-elements/{p-c2ff132c.entry.js → p-9b631363.entry.js} +1 -1
  100. package/dist/lime-elements/{p-8af3e4a1.entry.js → p-9d3437ac.entry.js} +1 -1
  101. package/dist/lime-elements/p-B8hoCfhT.js +1 -0
  102. package/dist/lime-elements/p-BwJGg-WI.js +89 -0
  103. package/dist/lime-elements/p-CSC2LJ7P.js +1 -0
  104. package/dist/lime-elements/p-a1de9bbe.entry.js +1 -0
  105. package/dist/lime-elements/{p-b5484494.entry.js → p-acba5700.entry.js} +1 -1
  106. package/dist/lime-elements/{p-f6361b03.entry.js → p-b8c76487.entry.js} +1 -1
  107. package/dist/lime-elements/{p-ac9c5c88.entry.js → p-cafec335.entry.js} +1 -1
  108. package/dist/lime-elements/{p-48928b4f.entry.js → p-d146feda.entry.js} +1 -1
  109. package/dist/lime-elements/{p-532ea234.entry.js → p-deceda00.entry.js} +1 -1
  110. package/dist/lime-elements/{p-e508771f.entry.js → p-f04f7c8e.entry.js} +1 -1
  111. package/dist/lime-elements/{p-51dc5f0b.entry.js → p-f3c108c9.entry.js} +1 -1
  112. package/dist/lime-elements/{p-24041bbb.entry.js → p-fbcd99a3.entry.js} +1 -1
  113. package/dist/types/components/menu/menu.d.ts +11 -0
  114. package/dist/types/components/pagination/jump/pagination-jump.d.ts +102 -0
  115. package/dist/types/components/pagination/pagination.d.ts +81 -0
  116. package/dist/types/components/pagination/pagination.util.d.ts +12 -2
  117. package/dist/types/components/popover/popover.d.ts +8 -1
  118. package/dist/types/components.d.ts +145 -0
  119. package/dist/types/translations/da.d.ts +4 -0
  120. package/dist/types/translations/de.d.ts +4 -0
  121. package/dist/types/translations/en.d.ts +4 -0
  122. package/dist/types/translations/fi.d.ts +4 -0
  123. package/dist/types/translations/fr.d.ts +4 -0
  124. package/dist/types/translations/nl.d.ts +4 -0
  125. package/dist/types/translations/no.d.ts +4 -0
  126. package/dist/types/translations/sv.d.ts +4 -0
  127. package/package.json +1 -1
  128. package/dist/cjs/limel-helper-line.cjs.entry.js +0 -42
  129. package/dist/esm/limel-helper-line.entry.js +0 -40
  130. package/dist/lime-elements/p-1a478498.entry.js +0 -248
  131. package/dist/lime-elements/p-4c65dee7.entry.js +0 -1
  132. package/dist/lime-elements/p-DAFuhe5e.js +0 -1
  133. package/dist/lime-elements/p-b4988a9b.entry.js +0 -1
  134. package/dist/lime-elements/p-f81dc23a.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as o,h as r,H as t}from"./p-Bnc9lzk2.js";import{t as e}from"./p-DAFuhe5e.js";import"./p-C3hECvXE.js";const l={note:"info",important:"exclamation_mark",tip:"idea",caution:"high_priority",warning:"error"};function a(o,r="note"){var t;return o||(null!==(t=l[r])&&void 0!==t?t:l.note)}const i=class{constructor(r){o(this,r),this.type="note",this.language="en"}render(){return r(t,{key:"1fad868509e50ce5001ab34c5a24d8859a7de622"},r("div",{key:"8b00e3ca008d783da77658d7e5c40c98b8fe6097",class:"side",role:"presentation"},r("limel-icon",{key:"382bf738b6b93cc43d03aa81311e026f26df77fb",name:a(this.icon,this.type)})),r("div",{key:"95a17ed73ffd18f4b17b5f9b0059bc92eb79f02f",class:"main"},r("h1",{key:"c3e5fc2c4475f1d708be437119eaf417d4bd40fe",class:"heading"},function(o,r="note",t="en"){if(o)return o;const l=`callout.${r}`;try{return e.get(l,t)}catch(o){return e.get(l,"en")}}(this.heading,this.type,this.language)),r("slot",{key:"eefb5b4c640286a31c1ce7897c455b813c22c5fc"})))}};i.style='*,*::before,*::after{box-sizing:border-box;min-height:0;min-width:0}:host(limel-callout){box-sizing:border-box;display:flex;border-radius:0.5rem;overflow:hidden;--limel-callout-tint-color:var( --callout-color, rgb(var(--color-contrast-100)) );color:var(--callout-text-color, rgb(var(--contrast-1100)));font-size:var(--limel-theme-default-font-size)}:host([type=note]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-gray-default)) )}:host([type=important]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-sky-default)) )}:host([type=tip]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-green-default)) )}:host([type=caution]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-orange-light)) )}:host([type=warning]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-red-dark)) )}.side{padding:0.25rem;position:relative}.side:before{content:"";position:absolute;inset:0;opacity:0.2;background-color:var(--limel-callout-tint-color)}.side limel-icon{width:1.5rem;color:var(--limel-callout-tint-color);margin-top:0.0625rem}.main{display:flex;flex:1;flex-direction:column;gap:0.5rem;padding:0.25rem 0.5rem 0.5rem 0.5rem;background-color:var(--callout-background-color, rgb(var(--contrast-300)))}.heading{margin:0;font-size:1rem;font-weight:600}';export{i as limel_callout}
1
+ import{r as o,h as r,H as t}from"./p-Bnc9lzk2.js";import{t as e}from"./p-B8hoCfhT.js";import"./p-C3hECvXE.js";const l={note:"info",important:"exclamation_mark",tip:"idea",caution:"high_priority",warning:"error"};function a(o,r="note"){var t;return o||(null!==(t=l[r])&&void 0!==t?t:l.note)}const i=class{constructor(r){o(this,r),this.type="note",this.language="en"}render(){return r(t,{key:"1fad868509e50ce5001ab34c5a24d8859a7de622"},r("div",{key:"8b00e3ca008d783da77658d7e5c40c98b8fe6097",class:"side",role:"presentation"},r("limel-icon",{key:"382bf738b6b93cc43d03aa81311e026f26df77fb",name:a(this.icon,this.type)})),r("div",{key:"95a17ed73ffd18f4b17b5f9b0059bc92eb79f02f",class:"main"},r("h1",{key:"c3e5fc2c4475f1d708be437119eaf417d4bd40fe",class:"heading"},function(o,r="note",t="en"){if(o)return o;const l=`callout.${r}`;try{return e.get(l,t)}catch(o){return e.get(l,"en")}}(this.heading,this.type,this.language)),r("slot",{key:"eefb5b4c640286a31c1ce7897c455b813c22c5fc"})))}};i.style='*,*::before,*::after{box-sizing:border-box;min-height:0;min-width:0}:host(limel-callout){box-sizing:border-box;display:flex;border-radius:0.5rem;overflow:hidden;--limel-callout-tint-color:var( --callout-color, rgb(var(--color-contrast-100)) );color:var(--callout-text-color, rgb(var(--contrast-1100)));font-size:var(--limel-theme-default-font-size)}:host([type=note]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-gray-default)) )}:host([type=important]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-sky-default)) )}:host([type=tip]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-green-default)) )}:host([type=caution]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-orange-light)) )}:host([type=warning]){--limel-callout-tint-color:var( --callout-color, rgb(var(--color-red-dark)) )}.side{padding:0.25rem;position:relative}.side:before{content:"";position:absolute;inset:0;opacity:0.2;background-color:var(--limel-callout-tint-color)}.side limel-icon{width:1.5rem;color:var(--limel-callout-tint-color);margin-top:0.0625rem}.main{display:flex;flex:1;flex-direction:column;gap:0.5rem;padding:0.25rem 0.5rem 0.5rem 0.5rem;background-color:var(--callout-background-color, rgb(var(--contrast-300)))}.heading{margin:0;font-size:1rem;font-weight:600}';export{i as limel_callout}
@@ -124,6 +124,7 @@ export declare class Menu {
124
124
  private selectedMenuItem?;
125
125
  private shouldRestoreFocusOnClose;
126
126
  private readonly normalizedHotkeyCache;
127
+ private readonly triggersDisabledByMenu;
127
128
  private cachedSubMenuSource;
128
129
  private cachedSubMenuItems;
129
130
  constructor();
@@ -133,6 +134,8 @@ export declare class Menu {
133
134
  connectedCallback(): void;
134
135
  disconnectedCallback(): void;
135
136
  protected openWatcher(newValue: boolean): void;
137
+ private setupGlobalHandlers;
138
+ private teardownGlobalHandlers;
136
139
  private readonly handleDocumentKeyDown;
137
140
  private isFromTextInput;
138
141
  private hasModifier;
@@ -157,6 +160,14 @@ export declare class Menu {
157
160
  private readonly goForward;
158
161
  private readonly goBack;
159
162
  private readonly setTriggerAttributes;
163
+ /**
164
+ * `disabled` has to be removed rather than set to `false`, because the
165
+ * presence of the attribute is what disables the element. Only the one the
166
+ * menu put there may go: a consumer can disable their own trigger, and
167
+ * stripping that attribute would re-enable it on every render.
168
+ * @param element - the slotted trigger element
169
+ */
170
+ private readonly setTriggerDisabled;
160
171
  private readonly onClose;
161
172
  private readonly onTriggerClick;
162
173
  private readonly handleSelect;
@@ -0,0 +1,102 @@
1
+ import { EventEmitter } from '../../../stencil-public-runtime';
2
+ import { Languages } from '../../date-picker/date.types';
3
+ /**
4
+ * A field for going straight to a page, which `limel-pagination` puts inside
5
+ * the popover its `···` opens.
6
+ *
7
+ * It draws nothing until it is opened, so a pagination that is merely on
8
+ * screen pays for an empty element rather than a form. It lives in a
9
+ * component of its own because the popover carries its content into a shadow
10
+ * root elsewhere on the page, where a parent's stylesheet cannot reach it —
11
+ * a component brings its own.
12
+ *
13
+ * @private
14
+ * @exampleComponent limel-example-pagination-jump-basic
15
+ */
16
+ export declare class PaginationJump {
17
+ /**
18
+ * Whether the field is being shown.
19
+ */
20
+ open: boolean;
21
+ /**
22
+ * The page to start from, which is the one the user is on.
23
+ */
24
+ page: number;
25
+ /**
26
+ * How many pages there are, which is as far as a jump can go.
27
+ */
28
+ pageCount: number;
29
+ /**
30
+ * Set while a page is being fetched, so that another cannot be asked for.
31
+ */
32
+ loading: boolean;
33
+ /**
34
+ * The language used for the labels and for the way numbers are written.
35
+ */
36
+ language: Languages;
37
+ /**
38
+ * Asks for the page that was typed, already brought within the set.
39
+ */
40
+ jump: EventEmitter<number>;
41
+ /** What the field shows: the page it opened with, then what is typed. */
42
+ private value;
43
+ private field?;
44
+ private shouldFocusField;
45
+ private numberFormat?;
46
+ componentWillLoad(): void;
47
+ protected handleLanguageChange(): void;
48
+ /**
49
+ * Opening starts the field again rather than leaving what was last typed,
50
+ * so it always offers the page the user is on now.
51
+ */
52
+ protected handleOpenChange(): void;
53
+ componentDidRender(): void;
54
+ render(): any;
55
+ /**
56
+ * Only to keep what is on screen honest. `limel-input-field` draws an
57
+ * unfocused number through its `value` prop, so a field left pinned to
58
+ * the page it opened with would show that again the moment the keyboard
59
+ * moved to the button, while the button submitted something else.
60
+ *
61
+ * @param event - the field reporting what it now holds
62
+ */
63
+ private readonly handleChange;
64
+ private readonly handleKeyDown;
65
+ private readonly commit;
66
+ /**
67
+ * The page that is in the field now, or `null` when it holds none.
68
+ *
69
+ * Read from the field itself rather than from its `change` event, which
70
+ * arrives on a debounce: a page typed and submitted inside that window
71
+ * would otherwise be submitted as whatever preceded it.
72
+ */
73
+ private get target();
74
+ /** `1–492`, so that being moved to 492 is a stated bound, not a surprise. */
75
+ private get pageRange();
76
+ private readonly setField;
77
+ /** `limel-input-field` wraps a native field but does not expose it. */
78
+ private get nativeField();
79
+ /**
80
+ * The field delegates focus to the input it wraps, so focusing the host
81
+ * is enough. Selecting as well, so the page the user is on is both the
82
+ * starting value and out of the way of the first keystroke.
83
+ */
84
+ private focusField;
85
+ /**
86
+ * The parent warns about a language it cannot use, so this one only has
87
+ * to keep drawing.
88
+ *
89
+ * @param value - the number to write out
90
+ * @returns the number in the current language
91
+ */
92
+ private formatNumber;
93
+ /**
94
+ * The pagination hands down the language it settled on, so this only has
95
+ * to survive being handed one directly, as the example page does.
96
+ *
97
+ * @returns a formatter, in that language where it can be used
98
+ */
99
+ private createNumberFormat;
100
+ private readonly translate;
101
+ }
102
+ //# sourceMappingURL=pagination-jump.d.ts.map
@@ -9,6 +9,10 @@ import { GoToPageEvent } from './pagination.types';
9
9
  * looking at, and how far into it they have got; and hovering a page shows
10
10
  * exactly which items it holds.
11
11
  *
12
+ * Where there are more pages than fit, the ones left out are stood for by a
13
+ * `···`. That is a button: it opens a field for going straight to any page in
14
+ * the set, so no page is more than one move away however long the set is.
15
+ *
12
16
  * @exampleComponent limel-example-pagination-basic
13
17
  * @exampleComponent limel-example-pagination-single-page
14
18
  * @exampleComponent limel-example-pagination-page-size
@@ -58,6 +62,7 @@ export declare class Pagination {
58
62
  * you can catch up.
59
63
  */
60
64
  goToPage: EventEmitter<GoToPageEvent>;
65
+ private host;
61
66
  /**
62
67
  * The count from the last time we had one, so the control can hold its
63
68
  * shape while a new one is on its way. The count rather than the page count
@@ -70,6 +75,8 @@ export declare class Pagination {
70
75
  /** The value each prop was last complained about with. */
71
76
  private readonly warnedAbout;
72
77
  private numberFormat?;
78
+ /** The language `numberFormat` settled on, which may not be the prop. */
79
+ private settledLanguage;
73
80
  /** Settled once per render, and the only thing `render` reads. */
74
81
  private view;
75
82
  /** The page the previous render showed. */
@@ -80,6 +87,14 @@ export declare class Pagination {
80
87
  private reportedAsk?;
81
88
  /** A correction the consumer has not been told about. */
82
89
  private pendingCorrection?;
90
+ /** Which gap has its jump field open, by slot index. */
91
+ private openGap?;
92
+ /** The page a jump asked for, until the control arrives there. */
93
+ private awaitedJump?;
94
+ /** The page it was asked from, which is what still waiting looks like. */
95
+ private jumpedFrom?;
96
+ /** Where a commit left the keyboard, so we can tell it has not moved. */
97
+ private jumpFocus?;
83
98
  /**
84
99
  * Settling here rather than in a `@Watch` keeps the result the same
85
100
  * however the consumer assigns the props. A watcher runs the moment one
@@ -94,6 +109,7 @@ export declare class Pagination {
94
109
  */
95
110
  private countPages;
96
111
  componentDidRender(): void;
112
+ private reportCorrection;
97
113
  /**
98
114
  * Read out the page whenever what it holds changes — not only when its
99
115
  * number does. A page size that doubles leaves the user on page 3 of a
@@ -143,6 +159,14 @@ export declare class Pagination {
143
159
  */
144
160
  private reconcile;
145
161
  protected handleLanguageChange(): void;
162
+ /**
163
+ * A gap is remembered by the position it sits in, and the positions are
164
+ * worked out afresh every render. A page set from outside can put a page
165
+ * number where the open gap was, taking the popover down without it ever
166
+ * closing — and leaving it to spring open by itself the next time a gap
167
+ * lands there.
168
+ */
169
+ private closeJumpWithoutAGap;
146
170
  render(): any;
147
171
  /**
148
172
  * Without a count we know where the user is but not how far the set goes,
@@ -162,6 +186,52 @@ export declare class Pagination {
162
186
  * @returns the rendered slot
163
187
  */
164
188
  private readonly renderSlot;
189
+ /**
190
+ * A gap is a button, not a marker: the pages it stands for are still
191
+ * reachable, and typing one is the only way to reach any of them in a
192
+ * single move.
193
+ *
194
+ * Both gaps open the same field, and it accepts any page in the set.
195
+ * Scoping each one to the pages it happens to hide would make two
196
+ * identical markers behave differently, with nothing on screen to say
197
+ * which is which.
198
+ *
199
+ * @param index - where the gap sits in the window
200
+ * @returns the rendered gap
201
+ */
202
+ private renderGap;
203
+ private readonly openJump;
204
+ private readonly closeJump;
205
+ /**
206
+ * The control is told what to show, so a jump only asks. Focus goes back
207
+ * to the marker the field came out of, which is still on screen and will
208
+ * still be somewhere sensible if the consumer declines.
209
+ *
210
+ * @param event - the page the field asks for
211
+ */
212
+ private readonly handleJump;
213
+ private focusGap;
214
+ /**
215
+ * Put the keyboard on the page a jump asked for, once the consumer has
216
+ * shown it.
217
+ *
218
+ * Committing tears down the popover the field was in, so between asking
219
+ * and arriving focus is on nothing. If the user has since put it somewhere
220
+ * of their own, arriving is no longer ours to report.
221
+ */
222
+ private followJumpedPage;
223
+ private forgetJump;
224
+ /**
225
+ * Whether the keyboard is still where the jump put it. Somewhere else
226
+ * inside this component means the user moved it and it is theirs.
227
+ *
228
+ * The marker itself can also go: jumping from the left gap to page 3
229
+ * turns that slot into a page number, and the button holding focus is
230
+ * taken away with it. A browser answers that by focusing the body rather
231
+ * than nothing, so the marker having left the page is what we look for.
232
+ */
233
+ private ownsFocus;
234
+ private focusCurrentPage;
165
235
  /**
166
236
  * A spinner around the page the user is heading for, while it loads.
167
237
  *
@@ -197,7 +267,11 @@ export declare class Pagination {
197
267
  private readonly step;
198
268
  private readonly selectPage;
199
269
  /**
270
+ * The one path every move the user asks for goes through, and so the one
271
+ * place that refuses while a page is still being fetched.
272
+ *
200
273
  * @param page - the page to ask for, 1-based
274
+ * @returns whether it was asked for
201
275
  */
202
276
  private goTo;
203
277
  /** The page on screen: the one asked for, within the range that exists. */
@@ -269,6 +343,13 @@ export declare class Pagination {
269
343
  * @returns the number in the current language
270
344
  */
271
345
  private formatNumber;
346
+ /**
347
+ * What the jump form is given, so that the one warning about a language
348
+ * this browser cannot write numbers in describes both of us. A tag it
349
+ * accepts but does not support, `zz`, resolves to the viewer's own locale
350
+ * rather than throwing, so asking the formatter is the only way to know.
351
+ */
352
+ private get languageForNumbers();
272
353
  /**
273
354
  * `Intl.NumberFormat` throws on a language it cannot parse, and this is
274
355
  * called from `render`, so an unusable one would leave the control drawing
@@ -8,8 +8,6 @@ export type PageSlot = {
8
8
  page: number;
9
9
  } | {
10
10
  kind: 'gap';
11
- from: number;
12
- to: number;
13
11
  };
14
12
  /**
15
13
  * How many positions are rendered at once, counting both page numbers and gap
@@ -18,6 +16,18 @@ export type PageSlot = {
18
16
  * how many positions there are, not how many of them are numbers.
19
17
  */
20
18
  export declare const VISIBLE_SLOTS = 7;
19
+ /**
20
+ * The page a typed value asks for, or `null` when it asks for nothing.
21
+ *
22
+ * Out of range is not an error. The set has a first and a last page, both
23
+ * written under the field, and the nearer of them is what someone typing past
24
+ * the end meant.
25
+ *
26
+ * @param value - what was typed into the field
27
+ * @param pageCount - how many pages there are, or `null` when not yet known
28
+ * @returns a page within the set, or `null` when there is no number to use
29
+ */
30
+ export declare function pageFromInput(value: string, pageCount: number | null): number | null;
21
31
  /**
22
32
  * Build the list of positions to render for a given page count.
23
33
  *
@@ -63,9 +63,16 @@ export declare class Popover {
63
63
  private shouldRestoreFocusOnClose;
64
64
  constructor();
65
65
  protected watchOpen(): void;
66
- componentWillLoad(): void;
66
+ connectedCallback(): void;
67
+ disconnectedCallback(): void;
67
68
  componentDidRender(): void;
68
69
  private setupGlobalHandlers;
70
+ /**
71
+ * The capture flag has to be given again: `removeEventListener` only
72
+ * matches a listener registered with the same one, so leaving it out here
73
+ * left the click listener on `document` for good.
74
+ */
75
+ private teardownGlobalHandlers;
69
76
  render(): any;
70
77
  private globalClickListener;
71
78
  private getCssProperties;
@@ -2834,6 +2834,9 @@ export namespace Components {
2834
2834
  * A page number and a total tells users how much there is in the list that they are
2835
2835
  * looking at, and how far into it they have got; and hovering a page shows
2836
2836
  * exactly which items it holds.
2837
+ * Where there are more pages than fit, the ones left out are stood for by a
2838
+ * `···`. That is a button: it opens a field for going straight to any page in
2839
+ * the set, so no page is more than one move away however long the set is.
2837
2840
  * @exampleComponent limel-example-pagination-basic
2838
2841
  * @exampleComponent limel-example-pagination-single-page
2839
2842
  * @exampleComponent limel-example-pagination-page-size
@@ -2870,6 +2873,44 @@ export namespace Components {
2870
2873
  */
2871
2874
  "totalItems": number | null;
2872
2875
  }
2876
+ /**
2877
+ * A field for going straight to a page, which `limel-pagination` puts inside
2878
+ * the popover its `···` opens.
2879
+ * It draws nothing until it is opened, so a pagination that is merely on
2880
+ * screen pays for an empty element rather than a form. It lives in a
2881
+ * component of its own because the popover carries its content into a shadow
2882
+ * root elsewhere on the page, where a parent's stylesheet cannot reach it —
2883
+ * a component brings its own.
2884
+ * @private
2885
+ * @exampleComponent limel-example-pagination-jump-basic
2886
+ */
2887
+ interface LimelPaginationJump {
2888
+ /**
2889
+ * The language used for the labels and for the way numbers are written.
2890
+ * @default 'en'
2891
+ */
2892
+ "language": Languages;
2893
+ /**
2894
+ * Set while a page is being fetched, so that another cannot be asked for.
2895
+ * @default false
2896
+ */
2897
+ "loading": boolean;
2898
+ /**
2899
+ * Whether the field is being shown.
2900
+ * @default false
2901
+ */
2902
+ "open": boolean;
2903
+ /**
2904
+ * The page to start from, which is the one the user is on.
2905
+ * @default 1
2906
+ */
2907
+ "page": number;
2908
+ /**
2909
+ * How many pages there are, which is as far as a jump can go.
2910
+ * @default 1
2911
+ */
2912
+ "pageCount": number;
2913
+ }
2873
2914
  /**
2874
2915
  * @exampleComponent limel-example-picker-basic
2875
2916
  * @exampleComponent limel-example-picker-multiple
@@ -4222,6 +4263,10 @@ export interface LimelPaginationCustomEvent<T> extends CustomEvent<T> {
4222
4263
  detail: T;
4223
4264
  target: HTMLLimelPaginationElement;
4224
4265
  }
4266
+ export interface LimelPaginationJumpCustomEvent<T> extends CustomEvent<T> {
4267
+ detail: T;
4268
+ target: HTMLLimelPaginationJumpElement;
4269
+ }
4225
4270
  export interface LimelPickerCustomEvent<T> extends CustomEvent<T> {
4226
4271
  detail: T;
4227
4272
  target: HTMLLimelPickerElement;
@@ -5912,6 +5957,9 @@ declare global {
5912
5957
  * A page number and a total tells users how much there is in the list that they are
5913
5958
  * looking at, and how far into it they have got; and hovering a page shows
5914
5959
  * exactly which items it holds.
5960
+ * Where there are more pages than fit, the ones left out are stood for by a
5961
+ * `···`. That is a button: it opens a field for going straight to any page in
5962
+ * the set, so no page is more than one move away however long the set is.
5915
5963
  * @exampleComponent limel-example-pagination-basic
5916
5964
  * @exampleComponent limel-example-pagination-single-page
5917
5965
  * @exampleComponent limel-example-pagination-page-size
@@ -5935,6 +5983,34 @@ declare global {
5935
5983
  prototype: HTMLLimelPaginationElement;
5936
5984
  new (): HTMLLimelPaginationElement;
5937
5985
  };
5986
+ interface HTMLLimelPaginationJumpElementEventMap {
5987
+ "jump": number;
5988
+ }
5989
+ /**
5990
+ * A field for going straight to a page, which `limel-pagination` puts inside
5991
+ * the popover its `···` opens.
5992
+ * It draws nothing until it is opened, so a pagination that is merely on
5993
+ * screen pays for an empty element rather than a form. It lives in a
5994
+ * component of its own because the popover carries its content into a shadow
5995
+ * root elsewhere on the page, where a parent's stylesheet cannot reach it —
5996
+ * a component brings its own.
5997
+ * @private
5998
+ * @exampleComponent limel-example-pagination-jump-basic
5999
+ */
6000
+ interface HTMLLimelPaginationJumpElement extends Components.LimelPaginationJump, HTMLStencilElement {
6001
+ addEventListener<K extends keyof HTMLLimelPaginationJumpElementEventMap>(type: K, listener: (this: HTMLLimelPaginationJumpElement, ev: LimelPaginationJumpCustomEvent<HTMLLimelPaginationJumpElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
6002
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
6003
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
6004
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
6005
+ removeEventListener<K extends keyof HTMLLimelPaginationJumpElementEventMap>(type: K, listener: (this: HTMLLimelPaginationJumpElement, ev: LimelPaginationJumpCustomEvent<HTMLLimelPaginationJumpElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
6006
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
6007
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
6008
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
6009
+ }
6010
+ var HTMLLimelPaginationJumpElement: {
6011
+ prototype: HTMLLimelPaginationJumpElement;
6012
+ new (): HTMLLimelPaginationJumpElement;
6013
+ };
5938
6014
  interface HTMLLimelPickerElementEventMap {
5939
6015
  "change": PickerItem | PickerItem[];
5940
6016
  "interact": PickerItem;
@@ -6725,6 +6801,7 @@ declare global {
6725
6801
  "limel-menu-surface": HTMLLimelMenuSurfaceElement;
6726
6802
  "limel-notched-outline": HTMLLimelNotchedOutlineElement;
6727
6803
  "limel-pagination": HTMLLimelPaginationElement;
6804
+ "limel-pagination-jump": HTMLLimelPaginationJumpElement;
6728
6805
  "limel-picker": HTMLLimelPickerElement;
6729
6806
  "limel-popover": HTMLLimelPopoverElement;
6730
6807
  "limel-popover-surface": HTMLLimelPopoverSurfaceElement;
@@ -9647,6 +9724,9 @@ declare namespace LocalJSX {
9647
9724
  * A page number and a total tells users how much there is in the list that they are
9648
9725
  * looking at, and how far into it they have got; and hovering a page shows
9649
9726
  * exactly which items it holds.
9727
+ * Where there are more pages than fit, the ones left out are stood for by a
9728
+ * `···`. That is a button: it opens a field for going straight to any page in
9729
+ * the set, so no page is more than one move away however long the set is.
9650
9730
  * @exampleComponent limel-example-pagination-basic
9651
9731
  * @exampleComponent limel-example-pagination-single-page
9652
9732
  * @exampleComponent limel-example-pagination-page-size
@@ -9687,6 +9767,48 @@ declare namespace LocalJSX {
9687
9767
  */
9688
9768
  "totalItems"?: number | null;
9689
9769
  }
9770
+ /**
9771
+ * A field for going straight to a page, which `limel-pagination` puts inside
9772
+ * the popover its `···` opens.
9773
+ * It draws nothing until it is opened, so a pagination that is merely on
9774
+ * screen pays for an empty element rather than a form. It lives in a
9775
+ * component of its own because the popover carries its content into a shadow
9776
+ * root elsewhere on the page, where a parent's stylesheet cannot reach it —
9777
+ * a component brings its own.
9778
+ * @private
9779
+ * @exampleComponent limel-example-pagination-jump-basic
9780
+ */
9781
+ interface LimelPaginationJump {
9782
+ /**
9783
+ * The language used for the labels and for the way numbers are written.
9784
+ * @default 'en'
9785
+ */
9786
+ "language"?: Languages;
9787
+ /**
9788
+ * Set while a page is being fetched, so that another cannot be asked for.
9789
+ * @default false
9790
+ */
9791
+ "loading"?: boolean;
9792
+ /**
9793
+ * Asks for the page that was typed, already brought within the set.
9794
+ */
9795
+ "onJump"?: (event: LimelPaginationJumpCustomEvent<number>) => void;
9796
+ /**
9797
+ * Whether the field is being shown.
9798
+ * @default false
9799
+ */
9800
+ "open"?: boolean;
9801
+ /**
9802
+ * The page to start from, which is the one the user is on.
9803
+ * @default 1
9804
+ */
9805
+ "page"?: number;
9806
+ /**
9807
+ * How many pages there are, which is as far as a jump can go.
9808
+ * @default 1
9809
+ */
9810
+ "pageCount"?: number;
9811
+ }
9690
9812
  /**
9691
9813
  * @exampleComponent limel-example-picker-basic
9692
9814
  * @exampleComponent limel-example-picker-multiple
@@ -11503,6 +11625,13 @@ declare namespace LocalJSX {
11503
11625
  "loading": boolean;
11504
11626
  "language": Languages;
11505
11627
  }
11628
+ interface LimelPaginationJumpAttributes {
11629
+ "open": boolean;
11630
+ "page": number;
11631
+ "pageCount": number;
11632
+ "loading": boolean;
11633
+ "language": Languages;
11634
+ }
11506
11635
  interface LimelPickerAttributes {
11507
11636
  "disabled": boolean;
11508
11637
  "readonly": boolean;
@@ -11739,6 +11868,7 @@ declare namespace LocalJSX {
11739
11868
  "limel-menu-surface": Omit<LimelMenuSurface, keyof LimelMenuSurfaceAttributes> & { [K in keyof LimelMenuSurface & keyof LimelMenuSurfaceAttributes]?: LimelMenuSurface[K] } & { [K in keyof LimelMenuSurface & keyof LimelMenuSurfaceAttributes as `attr:${K}`]?: LimelMenuSurfaceAttributes[K] } & { [K in keyof LimelMenuSurface & keyof LimelMenuSurfaceAttributes as `prop:${K}`]?: LimelMenuSurface[K] };
11740
11869
  "limel-notched-outline": Omit<LimelNotchedOutline, keyof LimelNotchedOutlineAttributes> & { [K in keyof LimelNotchedOutline & keyof LimelNotchedOutlineAttributes]?: LimelNotchedOutline[K] } & { [K in keyof LimelNotchedOutline & keyof LimelNotchedOutlineAttributes as `attr:${K}`]?: LimelNotchedOutlineAttributes[K] } & { [K in keyof LimelNotchedOutline & keyof LimelNotchedOutlineAttributes as `prop:${K}`]?: LimelNotchedOutline[K] };
11741
11870
  "limel-pagination": Omit<LimelPagination, keyof LimelPaginationAttributes> & { [K in keyof LimelPagination & keyof LimelPaginationAttributes]?: LimelPagination[K] } & { [K in keyof LimelPagination & keyof LimelPaginationAttributes as `attr:${K}`]?: LimelPaginationAttributes[K] } & { [K in keyof LimelPagination & keyof LimelPaginationAttributes as `prop:${K}`]?: LimelPagination[K] };
11871
+ "limel-pagination-jump": Omit<LimelPaginationJump, keyof LimelPaginationJumpAttributes> & { [K in keyof LimelPaginationJump & keyof LimelPaginationJumpAttributes]?: LimelPaginationJump[K] } & { [K in keyof LimelPaginationJump & keyof LimelPaginationJumpAttributes as `attr:${K}`]?: LimelPaginationJumpAttributes[K] } & { [K in keyof LimelPaginationJump & keyof LimelPaginationJumpAttributes as `prop:${K}`]?: LimelPaginationJump[K] };
11742
11872
  "limel-picker": Omit<LimelPicker, keyof LimelPickerAttributes> & { [K in keyof LimelPicker & keyof LimelPickerAttributes]?: LimelPicker[K] } & { [K in keyof LimelPicker & keyof LimelPickerAttributes as `attr:${K}`]?: LimelPickerAttributes[K] } & { [K in keyof LimelPicker & keyof LimelPickerAttributes as `prop:${K}`]?: LimelPicker[K] };
11743
11873
  "limel-popover": Omit<LimelPopover, keyof LimelPopoverAttributes> & { [K in keyof LimelPopover & keyof LimelPopoverAttributes]?: LimelPopover[K] } & { [K in keyof LimelPopover & keyof LimelPopoverAttributes as `attr:${K}`]?: LimelPopoverAttributes[K] } & { [K in keyof LimelPopover & keyof LimelPopoverAttributes as `prop:${K}`]?: LimelPopover[K] };
11744
11874
  "limel-popover-surface": LimelPopoverSurface;
@@ -12750,6 +12880,9 @@ declare module "@stencil/core" {
12750
12880
  * A page number and a total tells users how much there is in the list that they are
12751
12881
  * looking at, and how far into it they have got; and hovering a page shows
12752
12882
  * exactly which items it holds.
12883
+ * Where there are more pages than fit, the ones left out are stood for by a
12884
+ * `···`. That is a button: it opens a field for going straight to any page in
12885
+ * the set, so no page is more than one move away however long the set is.
12753
12886
  * @exampleComponent limel-example-pagination-basic
12754
12887
  * @exampleComponent limel-example-pagination-single-page
12755
12888
  * @exampleComponent limel-example-pagination-page-size
@@ -12760,6 +12893,18 @@ declare module "@stencil/core" {
12760
12893
  * @beta
12761
12894
  */
12762
12895
  "limel-pagination": LocalJSX.IntrinsicElements["limel-pagination"] & JSXBase.HTMLAttributes<HTMLLimelPaginationElement>;
12896
+ /**
12897
+ * A field for going straight to a page, which `limel-pagination` puts inside
12898
+ * the popover its `···` opens.
12899
+ * It draws nothing until it is opened, so a pagination that is merely on
12900
+ * screen pays for an empty element rather than a form. It lives in a
12901
+ * component of its own because the popover carries its content into a shadow
12902
+ * root elsewhere on the page, where a parent's stylesheet cannot reach it —
12903
+ * a component brings its own.
12904
+ * @private
12905
+ * @exampleComponent limel-example-pagination-jump-basic
12906
+ */
12907
+ "limel-pagination-jump": LocalJSX.IntrinsicElements["limel-pagination-jump"] & JSXBase.HTMLAttributes<HTMLLimelPaginationJumpElement>;
12763
12908
  /**
12764
12909
  * @exampleComponent limel-example-picker-basic
12765
12910
  * @exampleComponent limel-example-picker-multiple
@@ -123,6 +123,10 @@ declare const _default: {
123
123
  'pagination.go-to-page': string;
124
124
  'pagination.current-page': string;
125
125
  'pagination.items-range': string;
126
+ 'pagination.jump-to-a-page': string;
127
+ 'pagination.page-number': string;
128
+ 'pagination.page-range': string;
129
+ 'pagination.go': string;
126
130
  };
127
131
  export default _default;
128
132
  //# sourceMappingURL=da.d.ts.map
@@ -123,6 +123,10 @@ declare const _default: {
123
123
  'pagination.go-to-page': string;
124
124
  'pagination.current-page': string;
125
125
  'pagination.items-range': string;
126
+ 'pagination.jump-to-a-page': string;
127
+ 'pagination.page-number': string;
128
+ 'pagination.page-range': string;
129
+ 'pagination.go': string;
126
130
  };
127
131
  export default _default;
128
132
  //# sourceMappingURL=de.d.ts.map
@@ -123,6 +123,10 @@ declare const _default: {
123
123
  'pagination.go-to-page': string;
124
124
  'pagination.current-page': string;
125
125
  'pagination.items-range': string;
126
+ 'pagination.jump-to-a-page': string;
127
+ 'pagination.page-number': string;
128
+ 'pagination.page-range': string;
129
+ 'pagination.go': string;
126
130
  };
127
131
  export default _default;
128
132
  //# sourceMappingURL=en.d.ts.map
@@ -123,6 +123,10 @@ declare const _default: {
123
123
  'pagination.go-to-page': string;
124
124
  'pagination.current-page': string;
125
125
  'pagination.items-range': string;
126
+ 'pagination.jump-to-a-page': string;
127
+ 'pagination.page-number': string;
128
+ 'pagination.page-range': string;
129
+ 'pagination.go': string;
126
130
  };
127
131
  export default _default;
128
132
  //# sourceMappingURL=fi.d.ts.map
@@ -123,6 +123,10 @@ declare const _default: {
123
123
  'pagination.go-to-page': string;
124
124
  'pagination.current-page': string;
125
125
  'pagination.items-range': string;
126
+ 'pagination.jump-to-a-page': string;
127
+ 'pagination.page-number': string;
128
+ 'pagination.page-range': string;
129
+ 'pagination.go': string;
126
130
  };
127
131
  export default _default;
128
132
  //# sourceMappingURL=fr.d.ts.map
@@ -123,6 +123,10 @@ declare const _default: {
123
123
  'pagination.go-to-page': string;
124
124
  'pagination.current-page': string;
125
125
  'pagination.items-range': string;
126
+ 'pagination.jump-to-a-page': string;
127
+ 'pagination.page-number': string;
128
+ 'pagination.page-range': string;
129
+ 'pagination.go': string;
126
130
  };
127
131
  export default _default;
128
132
  //# sourceMappingURL=nl.d.ts.map
@@ -123,6 +123,10 @@ declare const _default: {
123
123
  'pagination.go-to-page': string;
124
124
  'pagination.current-page': string;
125
125
  'pagination.items-range': string;
126
+ 'pagination.jump-to-a-page': string;
127
+ 'pagination.page-number': string;
128
+ 'pagination.page-range': string;
129
+ 'pagination.go': string;
126
130
  };
127
131
  export default _default;
128
132
  //# sourceMappingURL=no.d.ts.map
@@ -123,6 +123,10 @@ declare const _default: {
123
123
  'pagination.go-to-page': string;
124
124
  'pagination.current-page': string;
125
125
  'pagination.items-range': string;
126
+ 'pagination.jump-to-a-page': string;
127
+ 'pagination.page-number': string;
128
+ 'pagination.page-range': string;
129
+ 'pagination.go': string;
126
130
  };
127
131
  export default _default;
128
132
  //# sourceMappingURL=sv.d.ts.map