@pacem/pacem-ui 1.0.0-bessel → 1.0.0-binet

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 (54) hide show
  1. package/dist/browser/pacem-ui.js +143 -19
  2. package/dist/browser/pacem-ui.js.map +1 -1
  3. package/dist/browser/pacem-ui.min.js +2 -2
  4. package/dist/bundle/pacem-ui.min.mjs +27 -27
  5. package/dist/bundle/pacem-ui.mjs +70 -45
  6. package/dist/bundle/pacem-ui.mjs.map +3 -3
  7. package/dist/docs/pacem-ui.json +18628 -0
  8. package/dist/esm/adapter.js +10 -13
  9. package/dist/esm/anchor.js +3 -2
  10. package/dist/esm/balloon.js +9 -1
  11. package/dist/esm/binder.js +11 -1
  12. package/dist/esm/blade.js +2 -1
  13. package/dist/esm/bottom-sheet.js +12 -6
  14. package/dist/esm/button.js +2 -1
  15. package/dist/esm/buttonset.js +2 -1
  16. package/dist/esm/calendar.js +19 -1
  17. package/dist/esm/collapse.js +2 -1
  18. package/dist/esm/dialog-abstractions.js +8 -1
  19. package/dist/esm/dialog.js +8 -2
  20. package/dist/esm/divider.js +2 -1
  21. package/dist/esm/icon.js +2 -1
  22. package/dist/esm/image.js +2 -1
  23. package/dist/esm/index-components-ui.js +1 -1
  24. package/dist/esm/index-components.js +1 -1
  25. package/dist/esm/index-iife.js +1 -1
  26. package/dist/esm/index.js +1 -1
  27. package/dist/esm/infinite-scroller.js +3 -1
  28. package/dist/esm/iterative.js +6 -1
  29. package/dist/esm/lightbox-abstractions.js +2 -1
  30. package/dist/esm/lightbox.js +2 -1
  31. package/dist/esm/loader.js +3 -1
  32. package/dist/esm/markdown-svc.js +4 -1
  33. package/dist/esm/markdown.js +4 -1
  34. package/dist/esm/marquee.js +2 -1
  35. package/dist/esm/media-query.js +2 -1
  36. package/dist/esm/menu.js +4 -1
  37. package/dist/esm/pager.js +2 -1
  38. package/dist/esm/picture.js +4 -1
  39. package/dist/esm/progressbar.js +2 -1
  40. package/dist/esm/sidebar.js +4 -1
  41. package/dist/esm/slideshow.js +3 -1
  42. package/dist/esm/social-twitter.js +2 -1
  43. package/dist/esm/sticky-header.js +5 -1
  44. package/dist/esm/tabs.js +4 -1
  45. package/dist/esm/ticker.js +2 -1
  46. package/dist/esm/toast.js +12 -1
  47. package/dist/esm/toc.js +2 -1
  48. package/dist/esm/tuner.js +4 -1
  49. package/dist/esm/types.js +2 -1
  50. package/dist/esm/vibration.js +3 -1
  51. package/dist/esm/view.js +2 -1
  52. package/dist/esm/window.js +5 -1
  53. package/package.json +2 -1
  54. package/typings/index.d.ts +242 -2
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -9,21 +9,24 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
9
9
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
10
10
  return c > 3 && r && Object.defineProperty(target, key, r), r;
11
11
  };
12
- import { P, PCSS, Defaults, CustomElement, ViewChild, Watch, Utils, PropertyConverters, Debounce, avoidHandler, Throttle } from '@pacem/pacem-core';
12
+ import { P, PCSS, Defaults, CustomElement, ViewChild, Watch, Utils, PropertyConverters, Debounce, avoidHandler, Throttle, CustomElementUtils } from '@pacem/pacem-core';
13
13
  import { Components, UI } from '@pacem/pacem-core';
14
14
  const { PacemElement, RepeaterItemCreateEventName, ItemRegisterEventName, ItemUnregisterEventName } = Components;
15
15
  //namespace Pacem.Components.UI {
16
+ /** Orientation used by a {@link PacemAdapterElement} to interpret arrow-key navigation. */
16
17
  export var AdapterOrientation;
17
18
  (function (AdapterOrientation) {
18
19
  AdapterOrientation["Vertical"] = "vertical";
19
20
  AdapterOrientation["Horizontal"] = "horizontal";
20
21
  })(AdapterOrientation || (AdapterOrientation = {}));
21
22
  export const AdapterPageButtonRefreshEventName = 'pagerefresh';
23
+ /** Event dispatched by {@link PacemAdapterElement} whenever a page/dashboard button needs to (re)compute its visible state or content. */
22
24
  export class AdapterPageButtonRefreshEvent extends CustomEvent {
23
25
  constructor(args) {
24
26
  super(AdapterPageButtonRefreshEventName, { detail: args, bubbles: false, cancelable: false });
25
27
  }
26
28
  }
29
+ /** Renders a dashboard of prev/next buttons and page indicators driving a {@link Components.PacemAdapter} (e.g. a `<pacem-slideshow>` master). */
27
30
  let PacemAdapterElement = class PacemAdapterElement extends Components.PacemAdapter {
28
31
  constructor() {
29
32
  super(...arguments);
@@ -33,10 +36,13 @@ let PacemAdapterElement = class PacemAdapterElement extends Components.PacemAdap
33
36
  this._fireAdapterPageRefreshCallback(index, evt.detail.item);
34
37
  };
35
38
  this._pageMap = new Map();
39
+ /** Gets or sets whether the dashboard responds to user interaction (keyboard, click, swipe). */
36
40
  this.interactive = true;
37
41
  /** Gets or sets whether swipe gesture is enabled for navigation (also depends on the 'interactive' flag being set to 'true') */
38
42
  this.swipeEnabled = true;
43
+ /** Gets or sets whether navigating past the last (or before the first) item wraps around. */
39
44
  this.loop = true;
45
+ /** Gets or sets the callback computing a page button's caption for a given item/index (defaults to the 1-based index). */
40
46
  this.labelCallback = (item, index) => (index + 1).toString();
41
47
  this._itemRegisterHandler = (evt) => {
42
48
  let item = evt.detail;
@@ -153,10 +159,7 @@ let PacemAdapterElement = class PacemAdapterElement extends Components.PacemAdap
153
159
  const pagers = this._pageMap;
154
160
  if (pagers.has(index)) {
155
161
  const pager = pagers.get(index), span = pager.firstElementChild;
156
- let fn = (e) => {
157
- if (e) {
158
- pager.removeEventListener('load', fn, false);
159
- }
162
+ const fn = () => {
160
163
  pager.hide = hide;
161
164
  pager.disabled = disable;
162
165
  span.content = caption;
@@ -164,13 +167,7 @@ let PacemAdapterElement = class PacemAdapterElement extends Components.PacemAdap
164
167
  // *careful here*: TODO: TO BE STUDIED
165
168
  // if setting the property before it's connected
166
169
  // the @Watch configuration and the get+set injection gets lost!
167
- if (pager.isReady) {
168
- // does not work for properties(?)...
169
- fn();
170
- }
171
- else {
172
- pager.addEventListener('load', fn, false);
173
- }
170
+ CustomElementUtils.whenReady(pager, fn);
174
171
  }
175
172
  }
176
173
  _tickVersion() {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -12,12 +12,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
12
12
  import { P, PCSS, CustomElement, Watch, Utils, PropertyConverters, Components, PropertyChangeEvent } from '@pacem/pacem-core';
13
13
  //namespace Pacem.Components.UI {
14
14
  // TODO: shadow-ize and reuse native <a> element.
15
+ /** Anchor-like custom element, supporting routed navigation (via a {@link Components.PacemRouterElement}), OAuth-authenticated downloads and keyboard activation. */
15
16
  let PacemAnchorElement = class PacemAnchorElement extends Components.PacemElement {
16
17
  constructor() {
17
18
  super('link');
18
19
  this._fetching = false;
19
20
  }
20
- ///
21
+ /** @readonly Gets whether a `download` fetch is currently in progress. */
21
22
  get fetching() {
22
23
  return this._fetching;
23
24
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -12,12 +12,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
12
12
  import { P, PCSS, CustomElement, Watch, Utils, PropertyConverters, Components, PropertyChangeEvent, ViewChild, stopPropagationHandler, preventDefaultHandler } from '@pacem/pacem-core';
13
13
  import { ElementOrPointPropertyConverter } from './types';
14
14
  //namespace Pacem.Components.UI {
15
+ /** How a {@link PacemBalloonElement} behaves once popped up: a dismissible menu, a tooltip, or non-interactive. */
15
16
  export var BalloonBehavior;
16
17
  (function (BalloonBehavior) {
17
18
  BalloonBehavior["Menu"] = "menu";
18
19
  BalloonBehavior["Tooltip"] = "tooltip";
19
20
  BalloonBehavior["Inert"] = "inert";
20
21
  })(BalloonBehavior || (BalloonBehavior = {}));
22
+ /** The user interaction on `target` that pops a {@link PacemBalloonElement} up. */
21
23
  export var BalloonTrigger;
22
24
  (function (BalloonTrigger) {
23
25
  BalloonTrigger["Hover"] = "hover";
@@ -25,6 +27,7 @@ export var BalloonTrigger;
25
27
  BalloonTrigger["ContextMenu"] = "contextmenu";
26
28
  BalloonTrigger["Focus"] = "focus";
27
29
  })(BalloonTrigger || (BalloonTrigger = {}));
30
+ /** Cross-axis alignment of a {@link PacemBalloonElement} relative to its `target`. */
28
31
  export var BalloonAlignment;
29
32
  (function (BalloonAlignment) {
30
33
  BalloonAlignment["Start"] = "start";
@@ -32,6 +35,7 @@ export var BalloonAlignment;
32
35
  BalloonAlignment["End"] = "end";
33
36
  BalloonAlignment["Auto"] = "auto";
34
37
  })(BalloonAlignment || (BalloonAlignment = {}));
38
+ /** Side of `target` a {@link PacemBalloonElement} is anchored to (with automatic variants that pick the side with the most room). */
35
39
  export var BalloonPosition;
36
40
  (function (BalloonPosition) {
37
41
  BalloonPosition["Top"] = "top";
@@ -42,12 +46,15 @@ export var BalloonPosition;
42
46
  BalloonPosition["HorizontalAuto"] = "x";
43
47
  BalloonPosition["VerticalAuto"] = "y";
44
48
  })(BalloonPosition || (BalloonPosition = {}));
49
+ /** Whether a {@link PacemBalloonElement} sizes itself freely or matches its `target`'s size along the anchored axis. */
45
50
  export var BalloonSizing;
46
51
  (function (BalloonSizing) {
47
52
  BalloonSizing["Auto"] = "auto";
48
53
  BalloonSizing["Match"] = "match";
49
54
  })(BalloonSizing || (BalloonSizing = {}));
55
+ /** Event name fired by {@link PacemBalloonElement} once it has finished popping up (after the show transition). */
50
56
  export const BalloonPopupEventName = 'popup';
57
+ /** Event name fired by {@link PacemBalloonElement} once it has finished popping out (after the hide transition). */
51
58
  export const BalloonPopoutEventName = 'popout';
52
59
  const BalloonConsts = {
53
60
  Defaults: {
@@ -65,6 +72,7 @@ const BalloonConsts = {
65
72
  };
66
73
  const positioningStyles = 'balloon-right balloon-left balloon-bottom balloon-top balloon-start balloon-center balloon-end';
67
74
  const allStyles = PCSS + '-balloon ' + positioningStyles + ' balloon-out balloon-in balloon-on';
75
+ /** Positions its content as a floating popup (menu or tooltip) anchored to a `target` element or point; see {@link BalloonOptions}. */
68
76
  let PacemBalloonElement = class PacemBalloonElement extends Components.PacemElement {
69
77
  constructor() {
70
78
  super(...arguments);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -13,6 +13,7 @@ import { P, PCSS, CustomElement, Watch, Utils, PropertyConverters, Components, C
13
13
  import { Point } from '@pacem/pacem-foundation';
14
14
  import { ElementOrPointPropertyConverter } from './types';
15
15
  // namespace Pacem.Components.UI {
16
+ /** Edge (or center) of an element a {@link PacemBinderElement} curve attaches to. */
16
17
  export var BinderAnchor;
17
18
  (function (BinderAnchor) {
18
19
  BinderAnchor["Auto"] = "auto";
@@ -22,6 +23,7 @@ export var BinderAnchor;
22
23
  BinderAnchor["Bottom"] = "bottom";
23
24
  BinderAnchor["Center"] = "center";
24
25
  })(BinderAnchor || (BinderAnchor = {}));
26
+ /** Decoration drawn at either end of a {@link PacemBinderElement} curve. */
25
27
  export var BinderEnd;
26
28
  (function (BinderEnd) {
27
29
  BinderEnd["Default"] = "default";
@@ -29,18 +31,22 @@ export var BinderEnd;
29
31
  BinderEnd["FatArrow"] = "fatarrow";
30
32
  BinderEnd["None"] = "none";
31
33
  })(BinderEnd || (BinderEnd = {}));
34
+ /** How a {@link PacemBinderElement} computes its Bezier control points: from the elements' mass (size) or from the path direction. */
32
35
  export var BinderTension;
33
36
  (function (BinderTension) {
34
37
  BinderTension["Mass"] = "mass";
35
38
  BinderTension["Path"] = "path";
36
39
  })(BinderTension || (BinderTension = {}));
40
+ /** Event name fired by a {@link PacemBinderElement} when its connecting path is interacted with (click, hover, etc.). */
37
41
  export const BinderInteractionEventName = 'interact';
42
+ /** Event dispatched by a {@link PacemBinderElement} wrapping the original user-interaction event on its path. */
38
43
  export class BinderInteractionEvent extends CustomUIEvent {
39
44
  constructor(orig) {
40
45
  super(BinderInteractionEventName, null, orig);
41
46
  }
42
47
  }
43
48
  const UI_BINDERS = 'pacem:components:ui:binders';
49
+ /** Tracks the {@link PacemBinderElement} instances bound to a single endpoint element, refreshing them all on that element's resize/reposition. */
44
50
  class BindersCollector {
45
51
  constructor(element) {
46
52
  this.binders = [];
@@ -58,6 +64,7 @@ class BindersCollector {
58
64
  this.resize.remove();
59
65
  }
60
66
  }
67
+ /** Static registry pairing endpoint elements with their {@link BindersCollector}, plus a page-wide resize listener keeping every registered {@link PacemBinderElement} in sync. */
61
68
  class BinderUtils {
62
69
  static { this._pageBinders = []; }
63
70
  static _updateResizeListener() {
@@ -110,6 +117,7 @@ class BinderUtils {
110
117
  }
111
118
  }
112
119
  const STD_EVENTS = ['click', 'dblclick', 'mouseover', 'mouseout', 'mouseenter', 'mouseleave', 'mousedown', 'mouseup', 'mousemove', 'contextmenu'];
120
+ /** Draws an SVG Bezier curve connecting two elements (or points), following them as they move/resize; e.g. wires or diagram connectors. */
113
121
  let PacemBinderElement = class PacemBinderElement extends Components.PacemElement {
114
122
  constructor() {
115
123
  super(...arguments);
@@ -224,6 +232,7 @@ let PacemBinderElement = class PacemBinderElement extends Components.PacemElemen
224
232
  });
225
233
  }
226
234
  }
235
+ /** Resizes the shared full-page SVG overlay to match the current document size; call after layout changes that may affect `document.body`'s scroll size. */
227
236
  invalidateSize() {
228
237
  const svg = this._svg;
229
238
  if (!Utils.isNull(svg)) {
@@ -535,6 +544,7 @@ let PacemBinderElement = class PacemBinderElement extends Components.PacemElemen
535
544
  }
536
545
  return { points: [p1, c1, p2, c2], anchors: [anchor, refAnchor] };
537
546
  }
547
+ /** Updates the cached position/size for the given endpoint (`from` or `to`) and redraws the curve if both ends are known. @param args Pre-computed layout, or omitted to reuse the last known/cached value. */
538
548
  refresh(element, args) {
539
549
  var path;
540
550
  if (Utils.isNull(element) || Utils.isNull(path = this._path)) {
package/dist/esm/blade.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -12,6 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
12
12
  import { P, CustomElement, Watch, Utils, PropertyConverters, Components } from '@pacem/pacem-core';
13
13
  // namespace Pacem.Components.UI {
14
14
  const OPEN_CSSCLASS = 'blade-open';
15
+ /** Slide-in panel toggled via its `open` property, dispatching `open`/`close` events as it transitions. */
15
16
  let PacemBladeElement = class PacemBladeElement extends Components.PacemElement {
16
17
  propertyChangedCallback(name, old, val, first) {
17
18
  super.propertyChangedCallback(name, old, val, first);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -12,6 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
12
12
  import { P, PCSS, CustomElement, Watch, Utils, PropertyConverters, Components, preventDefaultHandler, ViewChild, CustomElementUtils, UI } from '@pacem/pacem-core';
13
13
  // namespace Pacem.Components.UI {
14
14
  const OPEN_CSSCLASS = 'bottom-sheet-open';
15
+ /** Drag handle for an ancestor {@link PacemBottomSheetElement}: renders a small grip icon, toggles the sheet on click and drives its swipe-to-drag behavior. */
15
16
  let PacemBottomSheetHandleElement = class PacemBottomSheetHandleElement extends Components.PacemElement {
16
17
  constructor() {
17
18
  super(...arguments);
@@ -44,7 +45,7 @@ let PacemBottomSheetHandleElement = class PacemBottomSheetHandleElement extends
44
45
  disconnectedCallback() {
45
46
  this.removeEventListener('click', this._clickHandler);
46
47
  const bs = this.#bottomSheet;
47
- if (!Utils.isNull(bs)) {
48
+ if (!Utils.isNull(bs) && bs.isReady) {
48
49
  bs._setHandle(null);
49
50
  }
50
51
  this.#bottomSheet = null;
@@ -56,9 +57,13 @@ let PacemBottomSheetHandleElement = class PacemBottomSheetHandleElement extends
56
57
  if (Utils.isNull(bs)) {
57
58
  return;
58
59
  }
59
- const id = Utils.isNullOrEmpty(this.id) ? (this.id = ('handle_' + Utils.uniqueCode())) : this.id;
60
- bs._setHandle(this);
61
- this.addEventListener('click', this._clickHandler, false);
60
+ if (Utils.isNullOrEmpty(this.id)) {
61
+ this.id = ('handle_' + Utils.uniqueCode());
62
+ }
63
+ CustomElementUtils.whenReady(bs, () => {
64
+ bs._setHandle(this);
65
+ this.addEventListener('click', this._clickHandler, false);
66
+ });
62
67
  }
63
68
  _toggleHandle(disabled = this.disabled) {
64
69
  this.style.pointerEvents = disabled ? 'none' : '';
@@ -84,6 +89,7 @@ PacemBottomSheetHandleElement = __decorate([
84
89
  })
85
90
  ], PacemBottomSheetHandleElement);
86
91
  export { PacemBottomSheetHandleElement };
92
+ /** Mobile-style panel anchored to the bottom of the viewport, draggable (via its {@link PacemBottomSheetHandleElement}) and swipeable open/closed. */
87
93
  let PacemBottomSheetElement = class PacemBottomSheetElement extends Components.PacemElement {
88
94
  constructor() {
89
95
  super(...arguments);
@@ -142,7 +148,7 @@ let PacemBottomSheetElement = class PacemBottomSheetElement extends Components.P
142
148
  swiper.disabled = disabled;
143
149
  }
144
150
  }
145
- /** @internal */
151
+ /** @internal Wires (or clears) the swiper's drag handle selector to the given {@link PacemBottomSheetHandleElement}. */
146
152
  _setHandle(handle) {
147
153
  if (Utils.isNull(handle)) {
148
154
  this._swiper.handleSelector = null;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -12,6 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
12
12
  import { P, PCSS, CustomElement, Watch, Utils, PropertyConverters, Components, CommandEvent } from '@pacem/pacem-core';
13
13
  import { DialogButton } from './dialog-abstractions';
14
14
  //namespace Pacem.Components.UI {
15
+ /** Clickable button element with optional icon, command dispatching (via {@link CommandEvent}) and an optional confirmation dialog gate. */
15
16
  let PacemButtonElement = class PacemButtonElement extends Components.PacemIterableElement {
16
17
  constructor() {
17
18
  super('button');
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -12,6 +12,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
12
12
  import { P, CustomElement, Components } from '@pacem/pacem-core';
13
13
  import { PacemButtonElement } from './button';
14
14
  //namespace Pacem.Components.UI {
15
+ /** Groups {@link PacemButtonElement} children into a single iterable/selectable set, focusing the item matching `index`. */
15
16
  let PacemButtonsetElement = class PacemButtonsetElement extends Components.PacemIterativeElement {
16
17
  connectedCallback() {
17
18
  super.connectedCallback();
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -11,22 +11,26 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
11
11
  };
12
12
  import { P, PCSS, CustomElement, Watch, ViewChild, Utils, PropertyConverters, Components, CustomTypedEvent, PropertyChangeEvent, Defaults, CustomElementUtils, Debounce, PropertyChangeEventName } from '@pacem/pacem-core';
13
13
  //namespace Pacem.Components.UI {
14
+ /** Granularity of a calendar/schedule/agenda view. */
14
15
  export var CalendarZoom;
15
16
  (function (CalendarZoom) {
16
17
  CalendarZoom["Month"] = "month";
17
18
  CalendarZoom["Week"] = "week";
18
19
  CalendarZoom["Day"] = "day";
19
20
  })(CalendarZoom || (CalendarZoom = {}));
21
+ /** Event dispatched by a {@link PacemCalendarBaseElement} whenever its `viewDate` changes, carrying the new date. */
20
22
  export class ViewDateChangeEvent extends CustomTypedEvent {
21
23
  constructor(date) {
22
24
  super('viewdatechange', date);
23
25
  }
24
26
  }
27
+ /** Event dispatched (and bubbling) when a day is selected on a {@link PacemCalendarElement}, carrying the selected date. */
25
28
  export class DateSelectEvent extends CustomTypedEvent {
26
29
  constructor(date) {
27
30
  super('dateselect', date, { bubbles: true });
28
31
  }
29
32
  }
33
+ /** Event dispatched (and bubbling) when a time slot is selected on a {@link PacemAgendaElement}, carrying the selected date/time. */
30
34
  export class TimeSelectEvent extends CustomTypedEvent {
31
35
  constructor(date) {
32
36
  super('timeselect', date, { bubbles: true });
@@ -39,6 +43,7 @@ const DAY_HOURS = [0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.
39
43
  let now = new Date();
40
44
  const DUMMY_DATE = Utils.Dates.dateOnly(now).valueOf();
41
45
  const DAYS_OF_WEEK = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
46
+ /** A single event/appointment item, meant as a child of a {@link PacemCalendarWithEventsBaseElement} (e.g. {@link PacemCalendarElement} or {@link PacemAgendaElement}). */
42
47
  let PacemCalendarEventElement = class PacemCalendarEventElement extends Components.PacemItemElement {
43
48
  propertyChangedCallback(name, old, val, first) {
44
49
  super.propertyChangedCallback(name, old, val, first);
@@ -73,16 +78,19 @@ PacemCalendarEventElement = __decorate([
73
78
  })
74
79
  ], PacemCalendarEventElement);
75
80
  export { PacemCalendarEventElement };
81
+ /** Event dispatched when a {@link PacemCalendarEventElement} rendering gains focus/selection within its host calendar. */
76
82
  export class CalendarEventSelectEvent extends CustomTypedEvent {
77
83
  constructor(args) {
78
84
  super("eventselect", args, { bubbles: false, cancelable: true });
79
85
  }
80
86
  }
87
+ /** Event dispatched when a {@link PacemCalendarEventElement} rendering loses focus/selection within its host calendar. */
81
88
  export class CalendarEventUnselectEvent extends CustomTypedEvent {
82
89
  constructor(args) {
83
90
  super("eventunselect", args, { bubbles: false, cancelable: true });
84
91
  }
85
92
  }
93
+ /** Base class shared by the calendar-family elements ({@link PacemCalendarElement}, {@link PacemAgendaElement}, {@link PacemScheduleElement}): holds the current view date/zoom/week/month grids and the {@link PacemCalendarEventElement} items collection. */
86
94
  export class PacemCalendarBaseElement extends Components.PacemItemsContainerElement {
87
95
  validate(item) {
88
96
  return item instanceof PacemCalendarEventElement;
@@ -240,11 +248,13 @@ __decorate([
240
248
  __decorate([
241
249
  Watch({ converter: PropertyConverters.Eval })
242
250
  ], PacemCalendarBaseElement.prototype, "disabledRanges", void 0);
251
+ /** Base class for calendar-family elements that render their {@link PacemCalendarEventElement} items into a positioned grid (see {@link PacemCalendarElement}, {@link PacemAgendaElement}); subclasses supply the grid-building logic via `buildDataSource`. */
243
252
  export class PacemCalendarWithEventsBaseElement extends PacemCalendarBaseElement {
244
253
  constructor() {
245
254
  super(...arguments);
246
255
  this._datasource = [];
247
256
  }
257
+ /** @readonly Gets the computed, per-row (week or day) grid of positioned event items ready for rendering. */
248
258
  get datasource() {
249
259
  return this._datasource;
250
260
  }
@@ -323,6 +333,7 @@ function buildAgendaGrid() {
323
333
  }
324
334
  return grid;
325
335
  }
336
+ /** Renders a day/week hourly grid ("agenda" view) with an all-day row, placing {@link PacemCalendarEventElement} items on the timeline and dispatching {@link TimeSelectEvent} on slot click. */
326
337
  let PacemAgendaElement = class PacemAgendaElement extends PacemCalendarWithEventsBaseElement {
327
338
  constructor() {
328
339
  super(...arguments);
@@ -384,6 +395,7 @@ let PacemAgendaElement = class PacemAgendaElement extends PacemCalendarWithEvent
384
395
  }
385
396
  return ds;
386
397
  }
398
+ /** @readonly Gets the computed all-day row of positioned event items ready for rendering. */
387
399
  get allDayDatasource() {
388
400
  return this._allDayDatasource;
389
401
  }
@@ -454,6 +466,7 @@ function buildCalendarGrid() {
454
466
  }
455
467
  return grid;
456
468
  }
469
+ /** Renders a classic month grid, placing {@link PacemCalendarEventElement} items on their spanning day cells and dispatching {@link DateSelectEvent} on day click. */
457
470
  let PacemCalendarElement = class PacemCalendarElement extends PacemCalendarWithEventsBaseElement {
458
471
  buildDataSource(items) {
459
472
  const month = this.month;
@@ -525,6 +538,7 @@ PacemCalendarElement = __decorate([
525
538
  export { PacemCalendarElement };
526
539
  // #endregion
527
540
  // #region CLOCK (to be worked on: many possibilities ahead)
541
+ /** Displays (and CSS-classes itself by) the current hour/minute; typically overlaid on a {@link PacemAgendaElement} to mark the current-time line. */
528
542
  let PacemClockElement = class PacemClockElement extends Components.PacemElement {
529
543
  };
530
544
  __decorate([
@@ -544,6 +558,7 @@ function buildCalendarHeader() {
544
558
  const id = "dock_" + Utils.uniqueCode();
545
559
  return `<div class="schedule-header schedule-grid"><div class="heading-left"></div>${header}</div>`;
546
560
  }
561
+ /** Combines a {@link PacemCalendarElement} (month view) and a {@link PacemAgendaElement} (day/week view) into a single scheduler, switching between them based on `zoom`. */
547
562
  let PacemScheduleElement = class PacemScheduleElement extends PacemCalendarBaseElement {
548
563
  viewActivatedCallback() {
549
564
  super.viewActivatedCallback();
@@ -581,6 +596,7 @@ PacemScheduleElement = __decorate([
581
596
  export { PacemScheduleElement };
582
597
  // #endregion
583
598
  // #region RULES
599
+ /** Base class for declarative rule elements that compute and inject {@link DateRange}s into an ancestor {@link PacemCalendarBaseElement}'s `disabledRanges` (e.g. {@link PacemCalendarDayOfWeekRuleElement}). */
584
600
  export class PacemCalendarRuleBaseElement extends HTMLElement {
585
601
  constructor() {
586
602
  super(...arguments);
@@ -597,6 +613,7 @@ export class PacemCalendarRuleBaseElement extends HTMLElement {
597
613
  disconnectedCallback() {
598
614
  this._target = undefined;
599
615
  }
616
+ /** @readonly Gets the ancestor calendar element this rule applies its disabled ranges to. */
600
617
  get target() {
601
618
  return this._target;
602
619
  }
@@ -624,6 +641,7 @@ export class PacemCalendarRuleBaseElement extends HTMLElement {
624
641
  __decorate([
625
642
  Debounce(true)
626
643
  ], PacemCalendarRuleBaseElement.prototype, "refreshDisabledRanges", null);
644
+ /** Declarative {@link PacemCalendarRuleBaseElement} that disables every day of the ancestor calendar not listed in `days` (e.g. weekends). */
627
645
  let PacemCalendarDayOfWeekRuleElement = class PacemCalendarDayOfWeekRuleElement extends PacemCalendarRuleBaseElement {
628
646
  constructor() {
629
647
  super(...arguments);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -11,6 +11,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
11
11
  };
12
12
  import { P, PCSS, CustomElement, Watch, ViewChild, Utils, PropertyConverters, PacemEventTarget, Components } from '@pacem/pacem-core';
13
13
  //namespace Pacem.Components.UI {
14
+ /** Animates its content's height (or width, if `horizontal`) between 0 and its natural size, toggled via the `collapse` property. */
14
15
  let PacemCollapseElement = class PacemCollapseElement extends PacemEventTarget {
15
16
  constructor() {
16
17
  super(...arguments);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -11,6 +11,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
11
11
  };
12
12
  import { Watch, Utils, Components, CustomTypedEvent, Logging, avoidHandler } from '@pacem/pacem-core';
13
13
  //namespace Pacem.Components.UI {
14
+ /** Set of buttons shown by a dialog (e.g. {@link PacemDialogBase}), controlling which {@link DialogButton}s are visible. */
14
15
  export var DialogButtons;
15
16
  (function (DialogButtons) {
16
17
  DialogButtons["YesNo"] = "yesno";
@@ -18,6 +19,7 @@ export var DialogButtons;
18
19
  DialogButtons["Ok"] = "ok";
19
20
  DialogButtons["OkCancel"] = "okcancel";
20
21
  })(DialogButtons || (DialogButtons = {}));
22
+ /** Single button a dialog can be committed/closed with. */
21
23
  export var DialogButton;
22
24
  (function (DialogButton) {
23
25
  DialogButton["Yes"] = "yes";
@@ -25,14 +27,18 @@ export var DialogButton;
25
27
  DialogButton["Cancel"] = "cancel";
26
28
  DialogButton["Ok"] = "ok";
27
29
  })(DialogButton || (DialogButton = {}));
30
+ /** Event name dispatched by a {@link PacemDialogBase} when it is committed/closed via one of its buttons. */
28
31
  export const DialogResultEventName = 'commit';
32
+ /** Event dispatched by a {@link PacemDialogBase} when it is committed/closed via one of its buttons; also the resolution value of `open()`'s promise. */
29
33
  export class DialogResultEvent extends CustomTypedEvent {
30
34
  constructor(args) {
31
35
  super(DialogResultEventName, args);
32
36
  }
33
37
  }
38
+ /** Base class for modal dialog elements (see {@link PacemDialogElement}): wraps a {@link Lightbox} with an open/commit lifecycle resolved through a promise. */
34
39
  export class PacemDialogBase extends Components.PacemElement {
35
40
  #deferred;
41
+ /** Opens the dialog, optionally seeding its `state`. @returns A promise resolved with the {@link DialogResultEventArgs} once the dialog is committed. */
36
42
  open(state) {
37
43
  const lb = this.lightbox;
38
44
  if (!Utils.isNull(this.#deferred)) {
@@ -50,6 +56,7 @@ export class PacemDialogBase extends Components.PacemElement {
50
56
  }
51
57
  return deferred.promise;
52
58
  }
59
+ /** Closes the dialog with the given button outcome, resolving the pending `open()` promise and dispatching a {@link DialogResultEvent}. */
53
60
  commit(btn, evt) {
54
61
  avoidHandler(evt);
55
62
  this.log(Logging.LogLevel.Debug, `Committing dialog by clicking '${btn}'.`);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -12,13 +12,19 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
12
12
  import { P, PCSS, Defaults, CustomElement, ViewChild, Watch, PropertyConverters } from '@pacem/pacem-core';
13
13
  import { PacemDialogBase, DialogButtons } from './dialog-abstractions';
14
14
  //namespace Pacem.Components.UI {
15
+ /** Modal dialog built on top of a {@link PacemLightboxElement}, with a configurable Ok/Yes/No/Cancel button set (see {@link DialogButtons}). */
15
16
  let PacemDialogElement = class PacemDialogElement extends PacemDialogBase {
16
17
  constructor() {
17
18
  super(...arguments);
19
+ /** Gets or sets which button set is shown (Ok, OkCancel, YesNo, YesNoCancel). */
18
20
  this.buttons = DialogButtons.Ok;
21
+ /** Gets or sets the caption of the Ok button. */
19
22
  this.okCaption = 'OK';
23
+ /** Gets or sets the caption of the Yes button. */
20
24
  this.yesCaption = 'Yes';
25
+ /** Gets or sets the caption of the No button. */
21
26
  this.noCaption = 'No';
27
+ /** Gets or sets the caption of the Cancel button. */
22
28
  this.cancelCaption = 'Cancel';
23
29
  }
24
30
  propertyChangedCallback(name, old, val, first) {
@@ -55,7 +61,7 @@ let PacemDialogElement = class PacemDialogElement extends PacemDialogBase {
55
61
  // }
56
62
  //});
57
63
  }
58
- /** Gets the 'ok', 'yes', 'no' and 'cancel' dialog buttons. */
64
+ /** @readonly Gets the 'ok', 'yes', 'no' and 'cancel' dialog buttons. */
59
65
  get dialogButtons() {
60
66
  const btns = this._buttons;
61
67
  return {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -11,6 +11,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
11
11
  };
12
12
  import { P, CustomElement, Watch, Utils, PropertyConverters, Components } from '@pacem/pacem-core';
13
13
  //namespace Pacem.Components.UI {
14
+ /** ARIA-`separator` element drawing a horizontal or vertical divider line, with optional `prepend`/`append` slotted content. */
14
15
  let PacemDividerElement = class PacemDividerElement extends Components.PacemElement {
15
16
  constructor() {
16
17
  super('separator');
package/dist/esm/icon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -91,6 +91,7 @@ function getIconMarkup(icon) {
91
91
  }
92
92
  });
93
93
  }
94
+ /** Renders an icon from a wide range of notations (inline SVG, Font Awesome, Material Symbols/Icons, LineIcons, CoreUI, or a plain image URL), lazily importing the matching stylesheet/script on demand. */
94
95
  let PacemIconElement = class PacemIconElement extends Components.PacemElement {
95
96
  constructor() {
96
97
  super('', { hidden: 'true' });
package/dist/esm/image.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -11,6 +11,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
11
11
  };
12
12
  import { P, CustomElement, Watch, Utils, PropertyConverters, Components } from '@pacem/pacem-core';
13
13
  //namespace Pacem.Components.UI {
14
+ /** Renders an image as a CSS background (rather than an `<img>` src), enabling `cover`/`contain`/`auto` fitting and reporting its natural/decoded size. */
14
15
  let PacemImageElement = class PacemImageElement extends Components.PacemElement {
15
16
  constructor() {
16
17
  super('img');
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
package/dist/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-ui v1.0.0-bessel (https://js.pacem.it)
2
+ * @pacem/pacem-ui v1.0.0-binet (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */