@dnncommunity/dnn-elements 0.14.0-beta.9 → 0.14.1

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 (59) hide show
  1. package/dist/cjs/dnn-button_16.cjs.entry.js +45 -20
  2. package/dist/cjs/dnn-button_16.cjs.entry.js.map +1 -1
  3. package/dist/cjs/dnn-collapsible.cjs.entry.js +6 -1
  4. package/dist/cjs/dnn-collapsible.cjs.entry.js.map +1 -1
  5. package/dist/cjs/dnn-treeview-item.cjs.entry.js +18 -4
  6. package/dist/cjs/dnn-treeview-item.cjs.entry.js.map +1 -1
  7. package/dist/cjs/dnn-vertical-splitview.cjs.entry.js +21 -15
  8. package/dist/cjs/dnn-vertical-splitview.cjs.entry.js.map +1 -1
  9. package/dist/cjs/dnn.cjs.js +1 -1
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/collection/components/dnn-collapsible/dnn-collapsible.js +6 -1
  12. package/dist/collection/components/dnn-collapsible/dnn-collapsible.js.map +1 -1
  13. package/dist/collection/components/dnn-treeview-item/dnn-treeview-item.js +22 -7
  14. package/dist/collection/components/dnn-treeview-item/dnn-treeview-item.js.map +1 -1
  15. package/dist/collection/components/dnn-vertical-splitview/dnn-vertical-splitview.js +22 -16
  16. package/dist/collection/components/dnn-vertical-splitview/dnn-vertical-splitview.js.map +1 -1
  17. package/dist/dnn/dnn-collapsible.entry.js +6 -1
  18. package/dist/dnn/dnn-collapsible.entry.js.map +1 -1
  19. package/dist/dnn/dnn-collapsible.system.entry.js +1 -1
  20. package/dist/dnn/dnn-collapsible.system.entry.js.map +1 -1
  21. package/dist/dnn/dnn-treeview-item.entry.js +18 -4
  22. package/dist/dnn/dnn-treeview-item.entry.js.map +1 -1
  23. package/dist/dnn/dnn-treeview-item.system.entry.js +1 -1
  24. package/dist/dnn/dnn-treeview-item.system.entry.js.map +1 -1
  25. package/dist/dnn/dnn-vertical-splitview.entry.js +21 -15
  26. package/dist/dnn/dnn-vertical-splitview.entry.js.map +1 -1
  27. package/dist/dnn/dnn-vertical-splitview.system.entry.js +1 -1
  28. package/dist/dnn/dnn-vertical-splitview.system.entry.js.map +1 -1
  29. package/dist/dnn/dnn.esm.js +1 -1
  30. package/dist/dnn/dnn.system.js +1 -1
  31. package/dist/dnn/dnn.system.js.map +1 -1
  32. package/dist/dnn/{p-fd82122b.system.entry.js → p-755d047d.system.entry.js} +3 -3
  33. package/dist/dnn/p-755d047d.system.entry.js.map +1 -0
  34. package/dist/dnn/{p-f4e6790b.entry.js → p-8ec1f3a8.entry.js} +4 -4
  35. package/dist/dnn/p-8ec1f3a8.entry.js.map +1 -0
  36. package/dist/dnn/p-f91193e2.system.js +1 -1
  37. package/dist/dnn/p-f91193e2.system.js.map +1 -1
  38. package/dist/esm/dnn-button_16.entry.js +45 -20
  39. package/dist/esm/dnn-button_16.entry.js.map +1 -1
  40. package/dist/esm/dnn-collapsible.entry.js +6 -1
  41. package/dist/esm/dnn-collapsible.entry.js.map +1 -1
  42. package/dist/esm/dnn-treeview-item.entry.js +18 -4
  43. package/dist/esm/dnn-treeview-item.entry.js.map +1 -1
  44. package/dist/esm/dnn-vertical-splitview.entry.js +21 -15
  45. package/dist/esm/dnn-vertical-splitview.entry.js.map +1 -1
  46. package/dist/esm/dnn.js +1 -1
  47. package/dist/esm/loader.js +1 -1
  48. package/dist/esm-es5/dnn-button_16.entry.js +2 -2
  49. package/dist/esm-es5/dnn-button_16.entry.js.map +1 -1
  50. package/dist/esm-es5/dnn.js +1 -1
  51. package/dist/esm-es5/dnn.js.map +1 -1
  52. package/dist/esm-es5/loader.js +1 -1
  53. package/dist/esm-es5/loader.js.map +1 -1
  54. package/dist/types/components/dnn-treeview-item/dnn-treeview-item.d.ts +5 -2
  55. package/dist/types/components/dnn-vertical-splitview/dnn-vertical-splitview.d.ts +1 -0
  56. package/dist/types/components.d.ts +2 -2
  57. package/package.json +3 -3
  58. package/dist/dnn/p-f4e6790b.entry.js.map +0 -1
  59. package/dist/dnn/p-fd82122b.system.entry.js.map +0 -1
@@ -38,7 +38,12 @@ let DnnCollapsible = class {
38
38
  this.updateSize();
39
39
  }
40
40
  else {
41
- this.container.style.maxHeight = "0px";
41
+ requestAnimationFrame(() => {
42
+ this.container.style.maxHeight = `${this.container.scrollHeight}px`;
43
+ requestAnimationFrame(() => {
44
+ this.container.style.maxHeight = "0px";
45
+ });
46
+ });
42
47
  }
43
48
  setTimeout(() => {
44
49
  requestAnimationFrame(() => {
@@ -1 +1 @@
1
- {"file":"dnn-collapsible.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,iBAAiB,GAAG,sJAAsJ;;ICOnK,cAAc;EAL3B;;;;IAUyB,aAAQ,GAAY,KAAK,CAAC;;IAGzC,uBAAkB,GAAY,GAAG,CAAC;GAsD3C;EAhDC,mBAAmB;IACjB,qBAAqB,CAAC;MACpB,IAAI,CAAC,UAAU,EAAE,CAAC;KACnB,CAAC,CAAA;GACH;;;;EAMD,MAAM,UAAU;IACd,IAAI,IAAI,CAAC,QAAQ,EAAC;MACd,qBAAqB,CAAC;QACpB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC;OACrE,CAAC,CAAC;MACH,UAAU,CAAC;QACT,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;OACzC,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;KAC/B;GACF;EAGD,sBAAsB,CAAC,QAAiB;IACtC,IAAI,QAAQ,EAAC;MACX,IAAI,CAAC,UAAU,EAAE,CAAC;KACnB;SACG;MACF,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;KACxC;IACD,UAAU,CAAC;MACT,qBAAqB,CAAC;QACpB,IAAI,CAAC,2BAA2B,CAAC,IAAI,EAAE,CAAC;OACzC,CAAC,CAAC;KACJ,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;GAC7B;EAID,MAAM;IACJ,QACEA,QAACC,UAAI,QACHD,iBAAK,EAAE,EAAC,WAAW,EAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,IAAI,UAAU,EAAE,GAAG,EAAE,EAAE,IAAI,IAAI,CAAC,SAAS,GAAG,EAAE,IAClFA,qBAAa,CACX,CACD,EACP;GACH;;;;;;;;;;","names":["h","Host"],"sources":["./src/components/dnn-collapsible/dnn-collapsible.scss?tag=dnn-collapsible&encapsulation=shadow","./src/components/dnn-collapsible/dnn-collapsible.tsx"],"sourcesContent":[":host {\r\n display: block;\r\n}\r\n#container{\r\n max-height:0;\r\n overflow: hidden;\r\n transition: max-height 300ms ease-in-out;\r\n}","import { Component, Host, h, Prop, Element, Event, EventEmitter, Watch, Listen, Method } from '@stencil/core';\r\n\r\n@Component({\r\n tag: \"dnn-collapsible\",\r\n styleUrl: \"dnn-collapsible.scss\",\r\n shadow: true\r\n})\r\nexport class DnnCollapsible {\r\n\r\n @Element() el: HTMLDnnCollapsibleElement;\r\n\r\n /** Defines if the panel is expanded or not. */\r\n @Prop({reflect: true}) expanded: boolean = false;\r\n\r\n /** Defines the transition time in ms, defaults to 100ms */\r\n @Prop() transitionDuration?: number = 150;\r\n\r\n /** Fires whenever the collapsible height has changed */\r\n @Event({bubbles: true, composed: true}) dnnCollapsibleHeightChanged: EventEmitter<void>;\r\n\r\n @Listen(\"dnnCollapsibleHeightChanged\")\r\n handleHeightChanged(){\r\n requestAnimationFrame(() => {\r\n this.updateSize();\r\n })\r\n }\r\n\r\n /**\r\n * Updates the component height, use to update after a slot content changes.\r\n */\r\n @Method()\r\n async updateSize() {\r\n if (this.expanded){\r\n requestAnimationFrame(() => {\r\n this.container.style.maxHeight = `${this.container.scrollHeight}px`;\r\n });\r\n setTimeout(() => {\r\n this.container.style.maxHeight = \"none\";\r\n }, this.transitionDuration);\r\n }\r\n }\r\n \r\n @Watch(\"expanded\")\r\n handledExpandedChanged(expanded: boolean){\r\n if (expanded){\r\n this.updateSize();\r\n }\r\n else{\r\n this.container.style.maxHeight = \"0px\";\r\n }\r\n setTimeout(() => {\r\n requestAnimationFrame(() => {\r\n this.dnnCollapsibleHeightChanged.emit();\r\n });\r\n }, this.transitionDuration);\r\n }\r\n \r\n private container: HTMLDivElement;\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div id=\"container\" class={this.expanded && \"expanded\"} ref={el => this.container = el}>\r\n <slot></slot>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n\r\n}\r\n"],"version":3}
1
+ {"file":"dnn-collapsible.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,iBAAiB,GAAG,sJAAsJ;;ICOnK,cAAc;EAL3B;;;;IAUyB,aAAQ,GAAY,KAAK,CAAC;;IAGzC,uBAAkB,GAAY,GAAG,CAAC;GA2D3C;EArDC,mBAAmB;IACjB,qBAAqB,CAAC;MACpB,IAAI,CAAC,UAAU,EAAE,CAAC;KACnB,CAAC,CAAA;GACH;;;;EAMD,MAAM,UAAU;IACd,IAAI,IAAI,CAAC,QAAQ,EAAC;MACd,qBAAqB,CAAC;QACpB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC;OACrE,CAAC,CAAC;MACH,UAAU,CAAC;QACT,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;OACzC,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;KAC/B;GACF;EAGD,sBAAsB,CAAC,QAAiB;IACtC,IAAI,QAAQ,EAAC;MACX,IAAI,CAAC,UAAU,EAAE,CAAC;KACnB;SACG;MACF,qBAAqB,CAAC;QACpB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC;QACpE,qBAAqB,CAAC;UACpB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;SACxC,CAAC,CAAC;OACJ,CAAC,CAAC;KACJ;IACD,UAAU,CAAC;MACT,qBAAqB,CAAC;QACpB,IAAI,CAAC,2BAA2B,CAAC,IAAI,EAAE,CAAC;OACzC,CAAC,CAAC;KACJ,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;GAC7B;EAID,MAAM;IACJ,QACEA,QAACC,UAAI,QACHD,iBAAK,EAAE,EAAC,WAAW,EAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,IAAI,UAAU,EAAE,GAAG,EAAE,EAAE,IAAI,IAAI,CAAC,SAAS,GAAG,EAAE,IAClFA,qBAAa,CACX,CACD,EACP;GACH;;;;;;;;;;","names":["h","Host"],"sources":["./src/components/dnn-collapsible/dnn-collapsible.scss?tag=dnn-collapsible&encapsulation=shadow","./src/components/dnn-collapsible/dnn-collapsible.tsx"],"sourcesContent":[":host {\r\n display: block;\r\n}\r\n#container{\r\n max-height:0;\r\n overflow: hidden;\r\n transition: max-height 300ms ease-in-out;\r\n}","import { Component, Host, h, Prop, Element, Event, EventEmitter, Watch, Listen, Method } from '@stencil/core';\r\n\r\n@Component({\r\n tag: \"dnn-collapsible\",\r\n styleUrl: \"dnn-collapsible.scss\",\r\n shadow: true\r\n})\r\nexport class DnnCollapsible {\r\n\r\n @Element() el: HTMLDnnCollapsibleElement;\r\n\r\n /** Defines if the panel is expanded or not. */\r\n @Prop({reflect: true}) expanded: boolean = false;\r\n\r\n /** Defines the transition time in ms, defaults to 100ms */\r\n @Prop() transitionDuration?: number = 150;\r\n\r\n /** Fires whenever the collapsible height has changed */\r\n @Event({bubbles: true, composed: true}) dnnCollapsibleHeightChanged: EventEmitter<void>;\r\n\r\n @Listen(\"dnnCollapsibleHeightChanged\")\r\n handleHeightChanged(){\r\n requestAnimationFrame(() => {\r\n this.updateSize();\r\n })\r\n }\r\n\r\n /**\r\n * Updates the component height, use to update after a slot content changes.\r\n */\r\n @Method()\r\n async updateSize() {\r\n if (this.expanded){\r\n requestAnimationFrame(() => {\r\n this.container.style.maxHeight = `${this.container.scrollHeight}px`;\r\n });\r\n setTimeout(() => {\r\n this.container.style.maxHeight = \"none\";\r\n }, this.transitionDuration);\r\n }\r\n }\r\n \r\n @Watch(\"expanded\")\r\n handledExpandedChanged(expanded: boolean){\r\n if (expanded){\r\n this.updateSize();\r\n }\r\n else{\r\n requestAnimationFrame(() => {\r\n this.container.style.maxHeight = `${this.container.scrollHeight}px`;\r\n requestAnimationFrame(() => {\r\n this.container.style.maxHeight = \"0px\";\r\n });\r\n });\r\n }\r\n setTimeout(() => {\r\n requestAnimationFrame(() => {\r\n this.dnnCollapsibleHeightChanged.emit();\r\n });\r\n }, this.transitionDuration);\r\n }\r\n \r\n private container: HTMLDivElement;\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div id=\"container\" class={this.expanded && \"expanded\"} ref={el => this.container = el}>\r\n <slot></slot>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n\r\n}\r\n"],"version":3}
@@ -11,14 +11,25 @@ let DnnTreeviewItem = class {
11
11
  index.registerInstance(this, hostRef);
12
12
  this.userExpanded = index.createEvent(this, "userExpanded", 3);
13
13
  this.userCollapsed = index.createEvent(this, "userCollapsed", 3);
14
- /** Defines if the current node is expanded */
14
+ /** Defines if the current node is expanded. */
15
15
  this.expanded = false;
16
+ /** Manages state for whether or not item has children. */
16
17
  this.hasChildren = false;
17
18
  }
19
+ /** Watch expanded Prop */
20
+ watchExpanded(expanded) {
21
+ if (expanded) {
22
+ this.expander.classList.add("expanded");
23
+ this.collapsible.expanded = true;
24
+ return;
25
+ }
26
+ this.expander.classList.remove("expanded");
27
+ this.collapsible.expanded = false;
28
+ }
18
29
  componentDidLoad() {
19
30
  requestAnimationFrame(() => {
20
- const children = this.childrenElement.children[0];
21
- const count = children.assignedElements().length;
31
+ const child = this.childElement.children[0];
32
+ const count = child.assignedElements().length;
22
33
  if (count > 0) {
23
34
  this.hasChildren = true;
24
35
  }
@@ -43,9 +54,12 @@ let DnnTreeviewItem = class {
43
54
  }
44
55
  render() {
45
56
  return (index.h(index.Host, null, index.h("div", { class: "expander", ref: el => this.expander = el }, this.hasChildren &&
46
- index.h("button", { onClick: () => this.toggleCollapse() }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 0 24 24", width: "24px", fill: "#000000" }, index.h("path", { d: "M10 17l5-5-5-5v10z" }), index.h("path", { d: "M0 24V0h24v24H0z", fill: "none" })))), index.h("div", { class: "item" }, index.h("div", { class: "item-slot" }, index.h("slot", null)), index.h("dnn-collapsible", { ref: el => this.collapsible = el, expanded: this.expanded }, index.h("div", { ref: el => this.childrenElement = el }, index.h("slot", { name: "children" }))))));
57
+ index.h("button", { onClick: () => this.toggleCollapse() }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 0 24 24", width: "24px", fill: "#000000" }, index.h("path", { d: "M10 17l5-5-5-5v10z" }), index.h("path", { d: "M0 24V0h24v24H0z", fill: "none" })))), index.h("div", { class: "item" }, index.h("div", { class: "item-slot" }, index.h("slot", null)), index.h("dnn-collapsible", { ref: el => this.collapsible = el, expanded: this.expanded }, index.h("div", { ref: el => this.childElement = el }, index.h("slot", { name: "children" }))))));
47
58
  }
48
59
  get el() { return index.getElement(this); }
60
+ static get watchers() { return {
61
+ "expanded": ["watchExpanded"]
62
+ }; }
49
63
  };
50
64
  DnnTreeviewItem.style = dnnTreeviewItemCss;
51
65
 
@@ -1 +1 @@
1
- {"file":"dnn-treeview-item.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,kBAAkB,GAAG,u6BAAu6B;;ICOr7B,eAAe;EAL5B;;;;;IAYyB,aAAQ,GAAY,KAAK,CAAC;IAQxC,gBAAW,GAAY,KAAK,CAAC;GA2DvC;EAtDC,gBAAgB;IACd,qBAAqB,CAAC;MACpB,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAoB,CAAC;MACr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AAkB,EAAC,IAAI,EAAC,MAAM,GAAE,CAAM,CAC3K,CAEP,EACNA,iBAAK,KAAK,EAAC,MAAM,IACfA,iBAAK,KAAK,EAAC,WAAW,IACpBA,qBAAa,CACT,EACNA,6BAAiB,GAAG,EAAE,EAAE,IAAI,IAAI,CAAC,WAAW,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,IACxEA,iBAAK,GAAG,EAAE,EAAE,IAAI,IAAI,CAAC,eAAe,GAAG,EAAE,IACvCA,kBAAM,IAAI,EAAC,UAAU,GAAQ,CACzB,CACU,CACZ,CACH,EACP;GACH;;;;;;;","names":["h","Host"],"sources":["./src/components/dnn-treeview-item/dnn-treeview-item.scss?tag=dnn-treeview-item&encapsulation=shadow","./src/components/dnn-treeview-item/dnn-treeview-item.tsx"],"sourcesContent":[":host {\r\n display: flex;\r\n overflow: visible;\r\n}\r\n.expander{\r\n width: 24px;\r\n height: 24px;\r\n button{\r\n transition: all 150ms ease-in-out;\r\n background-color:transparent;\r\n border: none;\r\n padding: 0;\r\n margin: 0;\r\n height: 1em;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n cursor: pointer;\r\n position: relative;\r\n top: 2px;\r\n svg{\r\n :first-child{\r\n transition: all 150ms ease-in-out;\r\n fill: white;\r\n stroke: black\r\n }\r\n }\r\n }\r\n &.expanded{\r\n button{\r\n transform: rotate(45deg);\r\n svg{\r\n :first-child{\r\n fill: black;\r\n stroke: black;\r\n }\r\n }\r\n }\r\n }\r\n}\r\ndiv.item{\r\n .item-slot{\r\n display: flex;\r\n align-items: center;\r\n gap: 0.25em;\r\n min-height: 24px;\r\n }\r\n div.children{\r\n overflow: hidden;\r\n height:0;\r\n transition: all 150ms ease-in-out;\r\n }\r\n}","import { Component, Host, h, Prop, State, Element, Event, EventEmitter } from '@stencil/core';\r\n\r\n@Component({\r\n tag: 'dnn-treeview-item',\r\n styleUrl: 'dnn-treeview-item.scss',\r\n shadow: true,\r\n})\r\nexport class DnnTreeviewItem {\r\n \r\n private expander!: HTMLDivElement;\r\n\r\n @Element() el!: HTMLDnnTreeviewItemElement;\r\n \r\n /** Defines if the current node is expanded */\r\n @Prop({mutable: true}) expanded: boolean = false;\r\n\r\n /** Fires when the user expands a node. */\r\n @Event({bubbles: false}) userExpanded: EventEmitter<void>;\r\n\r\n /** Fires when the user collapses a node. */\r\n @Event({bubbles: false}) userCollapsed: EventEmitter<void>;\r\n\r\n @State() hasChildren: boolean = false;\r\n \r\n private childrenElement!: HTMLDivElement;\r\n private collapsible!: HTMLDnnCollapsibleElement;\r\n\r\n componentDidLoad() {\r\n requestAnimationFrame(() => {\r\n const children = this.childrenElement.children[0] as HTMLSlotElement;\r\n const count = children.assignedElements().length\r\n if (count > 0){\r\n this.hasChildren = true;\r\n }\r\n if (this.expanded){\r\n this.expander.classList.add(\"expanded\");\r\n this.collapsible.expanded = false;\r\n setTimeout(() => {\r\n this.collapsible.expanded = true;\r\n }, 300);\r\n }\r\n });\r\n }\r\n\r\n private toggleCollapse(): void {\r\n this.expanded = !this.expanded;\r\n if (this.expanded){\r\n this.expander.classList.add(\"expanded\");\r\n this.userExpanded.emit();\r\n return;\r\n }\r\n\r\n this.expander.classList.remove(\"expanded\");\r\n this.userCollapsed.emit();\r\n }\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div class=\"expander\" ref={el => this.expander = el}>\r\n {this.hasChildren &&\r\n <button\r\n onClick={() => this.toggleCollapse()}\r\n >\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\"><path d=\"M10 17l5-5-5-5v10z\"/><path d=\"M0 24V0h24v24H0z\" fill=\"none\"/></svg>\r\n </button>\r\n }\r\n </div>\r\n <div class=\"item\">\r\n <div class=\"item-slot\">\r\n <slot></slot>\r\n </div>\r\n <dnn-collapsible ref={el => this.collapsible = el} expanded={this.expanded}>\r\n <div ref={el => this.childrenElement = el}>\r\n <slot name=\"children\"></slot>\r\n </div>\r\n </dnn-collapsible>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n}\r\n\r\nexport interface ExpandedToggledEvent{\r\n state: \"expanded\" | \"collapsed\";\r\n height: number;\r\n}"],"version":3}
1
+ {"file":"dnn-treeview-item.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,kBAAkB,GAAG,u6BAAu6B;;ICOr7B,eAAe;EAL5B;;;;;IAYwC,aAAQ,GAAY,KAAK,CAAC;;IASvD,gBAAW,GAAY,KAAK,CAAC;GAyEvC;;EArEC,aAAa,CAAC,QAAiB;IAC7B,IAAI,QAAQ,EAAE;MACZ,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;MACxC,IAAI,CAAC,WAAW,CAAC,QAAQ,GAAG,IAAI,CAAC;MACjC,OAAO;KACR;IAED,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC3C,IAAI,CAAC,WAAW,CAAC,QAAQ,GAAG,KAAK,CAAC;GACnC;EAMD,gBAAgB;IACd,qBAAqB,CAAC;MACpB,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAoB,CAAC;MAC/D,MAAM,KAAK,GAAG,KAAK,CAAC,gBAAgB,EAAE,CAAC,MAAM,CAAA;MAC7C,IAAI,KAAK,GAAG,CAAC,EAAC;QACZ,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;OACzB;MACD,IAAI,IAAI,CAAC,QAAQ,EAAC;QAChB,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACxC,IAAI,CAAC,WAAW,CAAC,QAAQ,GAAG,KAAK,CAAC;QAClC,UAAU,CAAC;UACT,IAAI,CAAC,WAAW,CAAC,QAAQ,GAAG,IAAI,CAAC;SAClC,EAAE,GAAG,CAAC,CAAC;OACT;KACF,CAAC,CAAC;GACJ;EAEO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dnn-treeview-item&encapsulation=shadow","./src/components/dnn-treeview-item/dnn-treeview-item.tsx"],"sourcesContent":[":host {\r\n display: flex;\r\n overflow: visible;\r\n}\r\n.expander{\r\n width: 24px;\r\n height: 24px;\r\n button{\r\n transition: all 150ms ease-in-out;\r\n background-color:transparent;\r\n border: none;\r\n padding: 0;\r\n margin: 0;\r\n height: 1em;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n cursor: pointer;\r\n position: relative;\r\n top: 2px;\r\n svg{\r\n :first-child{\r\n transition: all 150ms ease-in-out;\r\n fill: white;\r\n stroke: black\r\n }\r\n }\r\n }\r\n &.expanded{\r\n button{\r\n transform: rotate(45deg);\r\n svg{\r\n :first-child{\r\n fill: black;\r\n stroke: black;\r\n }\r\n }\r\n }\r\n }\r\n}\r\ndiv.item{\r\n .item-slot{\r\n display: flex;\r\n align-items: center;\r\n gap: 0.25em;\r\n min-height: 24px;\r\n }\r\n div.children{\r\n overflow: hidden;\r\n height:0;\r\n transition: all 150ms ease-in-out;\r\n }\r\n}","import { Component, Host, h, Prop, State, Element, Event, EventEmitter, Watch } from '@stencil/core';\r\n\r\n@Component({\r\n tag: 'dnn-treeview-item',\r\n styleUrl: 'dnn-treeview-item.scss',\r\n shadow: true,\r\n})\r\nexport class DnnTreeviewItem {\r\n \r\n private expander!: HTMLDivElement;\r\n\r\n @Element() el!: HTMLDnnTreeviewItemElement;\r\n \r\n /** Defines if the current node is expanded. */\r\n @Prop({mutable: true, reflect: true}) expanded: boolean = false;\r\n\r\n /** Fires when the user expands a node. */\r\n @Event({bubbles: false}) userExpanded: EventEmitter<void>;\r\n\r\n /** Fires when the user collapses a node. */\r\n @Event({bubbles: false}) userCollapsed: EventEmitter<void>;\r\n\r\n /** Manages state for whether or not item has children. */\r\n @State() hasChildren: boolean = false;\r\n\r\n /** Watch expanded Prop */\r\n @Watch('expanded')\r\n watchExpanded(expanded: boolean) {\r\n if (expanded) {\r\n this.expander.classList.add(\"expanded\");\r\n this.collapsible.expanded = true;\r\n return;\r\n }\r\n \r\n this.expander.classList.remove(\"expanded\");\r\n this.collapsible.expanded = false;\r\n }\r\n \r\n \r\n private childElement!: HTMLDivElement;\r\n private collapsible!: HTMLDnnCollapsibleElement;\r\n\r\n componentDidLoad() {\r\n requestAnimationFrame(() => {\r\n const child = this.childElement.children[0] as HTMLSlotElement;\r\n const count = child.assignedElements().length\r\n if (count > 0){\r\n this.hasChildren = true;\r\n }\r\n if (this.expanded){\r\n this.expander.classList.add(\"expanded\");\r\n this.collapsible.expanded = false;\r\n setTimeout(() => {\r\n this.collapsible.expanded = true;\r\n }, 300);\r\n }\r\n });\r\n }\r\n\r\n private toggleCollapse(): void {\r\n this.expanded = !this.expanded;\r\n if (this.expanded){\r\n this.expander.classList.add(\"expanded\");\r\n this.userExpanded.emit();\r\n return;\r\n }\r\n\r\n this.expander.classList.remove(\"expanded\");\r\n this.userCollapsed.emit();\r\n }\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div class=\"expander\" ref={el => this.expander = el}>\r\n {this.hasChildren &&\r\n <button\r\n onClick={() => this.toggleCollapse()}\r\n >\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\"><path d=\"M10 17l5-5-5-5v10z\"/><path d=\"M0 24V0h24v24H0z\" fill=\"none\"/></svg>\r\n </button>\r\n }\r\n </div>\r\n <div class=\"item\">\r\n <div class=\"item-slot\">\r\n <slot></slot>\r\n </div>\r\n <dnn-collapsible ref={el => this.collapsible = el} expanded={this.expanded}>\r\n <div ref={el => this.childElement = el}>\r\n <slot name=\"children\"></slot>\r\n </div>\r\n </dnn-collapsible>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n}\r\n\r\nexport interface ExpandedToggledEvent{\r\n state: \"expanded\" | \"collapsed\";\r\n height: number;\r\n}"],"version":3}
@@ -49,26 +49,32 @@ let DnnVerticalSplitview = class {
49
49
  }
50
50
  componentDidLoad() {
51
51
  requestAnimationFrame(() => {
52
- const fullWidth = this.element.getBoundingClientRect().width;
53
- this.leftWidth = fullWidth * this.splitWidthPercentage / 100;
54
- this.rightWidth = fullWidth - this.leftWidth;
55
- this.widthChanged.emit(this.splitWidthPercentage);
52
+ this.resizeObserver = new ResizeObserver(() => {
53
+ const fullWidth = this.element.getBoundingClientRect().width;
54
+ this.leftWidth = fullWidth * this.splitWidthPercentage / 100;
55
+ this.rightWidth = fullWidth - this.leftWidth;
56
+ this.widthChanged.emit(this.splitWidthPercentage);
57
+ });
58
+ this.resizeObserver.observe(this.element);
56
59
  });
57
60
  }
58
61
  handleMouseDown(event) {
59
62
  event.preventDefault();
60
63
  const handleDrag = (ev) => {
61
- let { movementX } = mouseUtilities.getMovementFromEvent(ev, this.previousTouch);
62
- let fullWidth = this.element.getBoundingClientRect().width;
63
- let newLeft = this.leftWidth + movementX;
64
- if (newLeft < 0) {
65
- newLeft = 0;
66
- }
67
- if (newLeft > fullWidth) {
68
- newLeft = fullWidth;
69
- }
70
- this.leftWidth = newLeft;
71
- this.rightWidth = fullWidth - newLeft;
64
+ requestAnimationFrame(() => {
65
+ let fullWidth = this.element.getBoundingClientRect().width;
66
+ let { movementX } = mouseUtilities.getMovementFromEvent(ev, this.previousTouch);
67
+ let newLeft = this.leftWidth + movementX;
68
+ if (newLeft < 0) {
69
+ newLeft = 0;
70
+ }
71
+ if (newLeft > fullWidth) {
72
+ newLeft = fullWidth;
73
+ }
74
+ this.leftWidth = newLeft;
75
+ this.rightWidth = fullWidth - newLeft;
76
+ this.splitWidthPercentage = this.leftWidth / fullWidth * 100;
77
+ });
72
78
  };
73
79
  const handleDragFinished = () => {
74
80
  document.removeEventListener("mousemove", handleDrag);
@@ -1 +1 @@
1
- {"file":"dnn-vertical-splitview.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,uBAAuB,GAAG,oqBAAoqB;;ICavrB,oBAAoB;EALjC;;;;IAQU,kBAAa,GAAG,EAAE,CAAC;;IAGnB,yBAAoB,G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,IAAI,EAAC,MAAM,GAAQ,CACrB,EACNA,oBACE,WAAW,EAAE,CAAC,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EACzC,YAAY,EAAE,CAAC,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAC1C,SAAS,EAAE,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EACrC,GAAG,EAAE,EAAE,IAAI,IAAI,CAAC,QAAQ,GAAG,EAAE,EAC7B,KAAK,EAAE;QACL,QAAQ,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI;QAC9C,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI;OAChC,IAEDA,qBAAa,CACN,EACTA,iBACE,KAAK,EAAC,YAAY,EAClB,KAAK,EAAE;QACL,KAAK,EAAE,GAAG,IAAI,CAAC,UAAU,IAAI;OAC9B,IACDA,kBAAM,IAAI,EAAC,OAAO,GAAQ,CACtB,CACH,EACP;GACH;;;;;;;","names":["getMovementFromEvent","h","Host"],"sources":["./src/components/dnn-vertical-splitview/dnn-vertical-splitview.scss?tag=dnn-vertical-splitview&encapsulation=shadow","./src/components/dnn-vertical-splitview/dnn-vertical-splitview.tsx"],"sourcesContent":[":host {\r\n display: flex;\r\n align-items: stretch;\r\n margin: 0 auto;\r\n position: relative;\r\n\r\n /** @prop --left-pane-background-color: Allows customizing the left pane background-color */\r\n --left-pane-background-color: transparent;\r\n\r\n /** @prop --right-pane-background-color: Allows customizing the right pane background-color */\r\n --right-pane-background-color: transparent;\r\n}\r\n\r\nbutton{\r\n border: none;\r\n margin:0;\r\n padding:0;\r\n cursor: ew-resize;\r\n position: absolute;\r\n height: 100%;\r\n background-color: transparent;\r\n &.transition{\r\n transition: all 300ms ease-in-out;\r\n }\r\n}\r\n\r\n\r\n.pane{\r\n overflow-y: auto;\r\n &.transition{\r\n transition: all 300ms ease-in-out;\r\n }\r\n &.left{\r\n background-color: var(--left-pane-background-color);\r\n }\r\n &.right{\r\n background-color: var(--right-pane-background-color);\r\n flex-grow: 1;\r\n }\r\n}","import { Component, Host, h, Prop, Element, State, Method, Event, EventEmitter } from '@stencil/core';\r\nimport { getMovementFromEvent } from \"../../utilities/mouseUtilities\";\r\n\r\n/**\r\n * @slot default - The split divider control you want to use.\r\n * @slot left - The content of the left pane.\r\n * @slot right - The content of the right pane.\r\n */\r\n@Component({\r\n tag: 'dnn-vertical-splitview',\r\n styleUrl: 'dnn-vertical-splitview.scss',\r\n shadow: true,\r\n})\r\nexport class DnnVerticalSplitview {\r\n\r\n /** The width of the splitter area. */\r\n @Prop() splitterWidth = 16;\r\n\r\n /** The percentage position of the splitter in the container. */\r\n @Prop() splitWidthPercentage = 30;\r\n \r\n private splitter!: HTMLButtonElement;\r\n\r\n /** Sets the width percentage of the divider */\r\n @Method()\r\n async setSplitWidthPercentage(newWidth: number) {\r\n const panes = this.element.shadowRoot.querySelectorAll(\".pane\");\r\n requestAnimationFrame(() => {\r\n panes.forEach(pane => pane.classList.add(\"transition\"));\r\n this.splitter.classList.add(\"transition\");\r\n requestAnimationFrame(() => {\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n let newLeft = fullWidth * newWidth / 100;\r\n if (newLeft < 0){\r\n newLeft = 0;\r\n }\r\n if (newLeft > fullWidth){\r\n newLeft = fullWidth;\r\n }\r\n this.leftWidth = newLeft;\r\n this.rightWidth = fullWidth - newLeft;\r\n setTimeout(() => {\r\n panes.forEach(pane => pane.classList.remove(\"transition\"));\r\n this.splitter.classList.remove(\"transition\");\r\n }, 300);\r\n });\r\n });\r\n }\r\n\r\n /** Gets the current divider position percentage. */\r\n @Method()\r\n async getSplitWidthPercentage(){\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n return this.leftWidth / fullWidth;\r\n }\r\n\r\n /** Fires when the width of the divider changes. */\r\n @Event() widthChanged: EventEmitter<number>;\r\n\r\n @State() leftWidth = 0;\r\n @State() rightWidth = 0;\r\n\r\n @Element() element : HTMLDnnVerticalSplitviewElement;\r\n \r\n componentDidLoad() {\r\n requestAnimationFrame(() => {\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n this.leftWidth = fullWidth * this.splitWidthPercentage / 100;\r\n this.rightWidth = fullWidth - this.leftWidth;\r\n this.widthChanged.emit(this.splitWidthPercentage);\r\n });\r\n }\r\n \r\n private previousTouch: Touch;\r\n\r\n private handleMouseDown(event: MouseEvent | TouchEvent) {\r\n event.preventDefault();\r\n const handleDrag = (ev: MouseEvent | TouchEvent) => {\r\n let {movementX} = getMovementFromEvent(ev, this.previousTouch);\r\n let fullWidth = this.element.getBoundingClientRect().width;\r\n let newLeft = this.leftWidth + movementX;\r\n if (newLeft < 0){\r\n newLeft = 0;\r\n }\r\n if (newLeft > fullWidth){\r\n newLeft = fullWidth;\r\n }\r\n this.leftWidth = newLeft;\r\n this.rightWidth = fullWidth - newLeft;\r\n }\r\n const handleDragFinished = () => {\r\n document.removeEventListener(\"mousemove\", handleDrag);\r\n document.removeEventListener(\"touchmove\", handleDrag);\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n const newPercentage = this.leftWidth / fullWidth * 100;\r\n this.widthChanged.emit(newPercentage);\r\n };\r\n document.addEventListener(\"mouseup\", handleDragFinished);\r\n document.addEventListener(\"touchend\", handleDragFinished);\r\n document.addEventListener(\"mousemove\", handleDrag);\r\n document.addEventListener(\"touchmove\", handleDrag);\r\n }\r\n\r\n private handleKeyDown(e: KeyboardEvent): void {\r\n let movementX = 0;\r\n switch (e.key) {\r\n case \"ArrowLeft\":\r\n movementX = -10;\r\n break;\r\n case \"ArrowRight\":\r\n movementX = 10;\r\n break;\r\n default:\r\n return;\r\n }\r\n if (e.shiftKey){\r\n movementX = movementX * 10;\r\n }\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n let newLeft = this.leftWidth + movementX;\r\n if (newLeft < 0){\r\n newLeft = 0;\r\n }\r\n if (newLeft > fullWidth){\r\n newLeft = fullWidth;\r\n }\r\n this.leftWidth = newLeft;\r\n this.rightWidth = fullWidth - this.leftWidth;\r\n }\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div class=\"left pane\" style={{\r\n width: `${this.leftWidth}px`,\r\n }}>\r\n <slot name=\"left\"></slot>\r\n </div>\r\n <button\r\n onMouseDown={e => this.handleMouseDown(e)}\r\n onTouchStart={e => this.handleMouseDown(e)}\r\n onKeyDown={e => this.handleKeyDown(e)}\r\n ref={el => this.splitter = el}\r\n style={{\r\n minWidth: `${this.splitterWidth.toString()}px`,\r\n left: `${this.leftWidth - 2}px`,\r\n }}\r\n >\r\n <slot></slot>\r\n </button>\r\n <div\r\n class=\"right pane\"\r\n style={{\r\n width: `${this.rightWidth}px`,\r\n }}>\r\n <slot name=\"right\"></slot>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n}\r\n"],"version":3}
1
+ {"file":"dnn-vertical-splitview.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,uBAAuB,GAAG,oqBAAoqB;;ICavrB,oBAAoB;EALjC;;;;IAQU,kBAAa,GAAG,EAAE,CAAC;;IAGJ,yBAAoB,GAAG,EAAE,CAAC;IA0CxC,cAAS,GAAG,CAAC,CAAC;IACd,eAAU,GAAG,CAAC,CAAC;GA0GzB;;EA7IC,MAAM,uBAAuB,CAAC,QAAgB;IAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAChE,qBAAqB,CAAC;MACpB,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;MACxD,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;MAC1C,qBAAqB,CAAC;QACpB,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC;QAC7D,IAAI,OAAO,GAAG,SA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Q,GAAG,EAAE,EAC7B,KAAK,EAAE;QACL,QAAQ,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI;QAC9C,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI;OAChC,IAEDA,qBAAa,CACN,EACTA,iBACE,KAAK,EAAC,YAAY,EAClB,KAAK,EAAE;QACL,KAAK,EAAE,GAAG,IAAI,CAAC,UAAU,IAAI;OAC9B,IACDA,kBAAM,IAAI,EAAC,OAAO,GAAQ,CACtB,CACH,EACP;GACH;;;;;;;","names":["getMovementFromEvent","h","Host"],"sources":["./src/components/dnn-vertical-splitview/dnn-vertical-splitview.scss?tag=dnn-vertical-splitview&encapsulation=shadow","./src/components/dnn-vertical-splitview/dnn-vertical-splitview.tsx"],"sourcesContent":[":host {\r\n display: flex;\r\n align-items: stretch;\r\n margin: 0 auto;\r\n position: relative;\r\n\r\n /** @prop --left-pane-background-color: Allows customizing the left pane background-color */\r\n --left-pane-background-color: transparent;\r\n\r\n /** @prop --right-pane-background-color: Allows customizing the right pane background-color */\r\n --right-pane-background-color: transparent;\r\n}\r\n\r\nbutton{\r\n border: none;\r\n margin:0;\r\n padding:0;\r\n cursor: ew-resize;\r\n position: absolute;\r\n height: 100%;\r\n background-color: transparent;\r\n &.transition{\r\n transition: all 300ms ease-in-out;\r\n }\r\n}\r\n\r\n\r\n.pane{\r\n overflow-y: auto;\r\n &.transition{\r\n transition: all 300ms ease-in-out;\r\n }\r\n &.left{\r\n background-color: var(--left-pane-background-color);\r\n }\r\n &.right{\r\n background-color: var(--right-pane-background-color);\r\n flex-grow: 1;\r\n }\r\n}","import { Component, Host, h, Prop, Element, State, Method, Event, EventEmitter } from '@stencil/core';\r\nimport { getMovementFromEvent } from \"../../utilities/mouseUtilities\";\r\n\r\n/**\r\n * @slot default - The split divider control you want to use.\r\n * @slot left - The content of the left pane.\r\n * @slot right - The content of the right pane.\r\n */\r\n@Component({\r\n tag: 'dnn-vertical-splitview',\r\n styleUrl: 'dnn-vertical-splitview.scss',\r\n shadow: true,\r\n})\r\nexport class DnnVerticalSplitview {\r\n\r\n /** The width of the splitter area. */\r\n @Prop() splitterWidth = 16;\r\n\r\n /** The percentage position of the splitter in the container. */\r\n @Prop({mutable: true}) splitWidthPercentage = 30;\r\n \r\n private splitter!: HTMLButtonElement;\r\n\r\n private resizeObserver: ResizeObserver;\r\n\r\n /** Sets the width percentage of the divider */\r\n @Method()\r\n async setSplitWidthPercentage(newWidth: number) {\r\n const panes = this.element.shadowRoot.querySelectorAll(\".pane\");\r\n requestAnimationFrame(() => {\r\n panes.forEach(pane => pane.classList.add(\"transition\"));\r\n this.splitter.classList.add(\"transition\");\r\n requestAnimationFrame(() => {\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n let newLeft = fullWidth * newWidth / 100;\r\n if (newLeft < 0){\r\n newLeft = 0;\r\n }\r\n if (newLeft > fullWidth){\r\n newLeft = fullWidth;\r\n }\r\n this.leftWidth = newLeft;\r\n this.rightWidth = fullWidth - newLeft;\r\n setTimeout(() => {\r\n panes.forEach(pane => pane.classList.remove(\"transition\"));\r\n this.splitter.classList.remove(\"transition\");\r\n }, 300);\r\n });\r\n });\r\n }\r\n\r\n /** Gets the current divider position percentage. */\r\n @Method()\r\n async getSplitWidthPercentage(){\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n return this.leftWidth / fullWidth;\r\n }\r\n\r\n /** Fires when the width of the divider changes. */\r\n @Event() widthChanged: EventEmitter<number>;\r\n\r\n @State() leftWidth = 0;\r\n @State() rightWidth = 0;\r\n\r\n @Element() element : HTMLDnnVerticalSplitviewElement;\r\n \r\n componentDidLoad() {\r\n requestAnimationFrame(() => {\r\n this.resizeObserver = new ResizeObserver(() => {\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n this.leftWidth = fullWidth * this.splitWidthPercentage / 100;\r\n this.rightWidth = fullWidth - this.leftWidth;\r\n this.widthChanged.emit(this.splitWidthPercentage);\r\n });\r\n this.resizeObserver.observe(this.element);\r\n });\r\n }\r\n \r\n private previousTouch: Touch;\r\n\r\n private handleMouseDown(event: MouseEvent | TouchEvent) {\r\n event.preventDefault();\r\n const handleDrag = (ev: MouseEvent | TouchEvent) => {\r\n requestAnimationFrame(() => {\r\n let fullWidth = this.element.getBoundingClientRect().width;\r\n let {movementX} = getMovementFromEvent(ev, this.previousTouch);\r\n let newLeft = this.leftWidth + movementX;\r\n if (newLeft < 0){\r\n newLeft = 0;\r\n }\r\n if (newLeft > fullWidth){\r\n newLeft = fullWidth;\r\n }\r\n this.leftWidth = newLeft;\r\n this.rightWidth = fullWidth - newLeft;\r\n this.splitWidthPercentage = this.leftWidth / fullWidth * 100;\r\n });\r\n }\r\n const handleDragFinished = () => {\r\n document.removeEventListener(\"mousemove\", handleDrag);\r\n document.removeEventListener(\"touchmove\", handleDrag);\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n const newPercentage = this.leftWidth / fullWidth * 100;\r\n this.widthChanged.emit(newPercentage);\r\n };\r\n document.addEventListener(\"mouseup\", handleDragFinished);\r\n document.addEventListener(\"touchend\", handleDragFinished);\r\n document.addEventListener(\"mousemove\", handleDrag);\r\n document.addEventListener(\"touchmove\", handleDrag);\r\n }\r\n\r\n private handleKeyDown(e: KeyboardEvent): void {\r\n let movementX = 0;\r\n switch (e.key) {\r\n case \"ArrowLeft\":\r\n movementX = -10;\r\n break;\r\n case \"ArrowRight\":\r\n movementX = 10;\r\n break;\r\n default:\r\n return;\r\n }\r\n if (e.shiftKey){\r\n movementX = movementX * 10;\r\n }\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n let newLeft = this.leftWidth + movementX;\r\n if (newLeft < 0){\r\n newLeft = 0;\r\n }\r\n if (newLeft > fullWidth){\r\n newLeft = fullWidth;\r\n }\r\n this.leftWidth = newLeft;\r\n this.rightWidth = fullWidth - this.leftWidth;\r\n }\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div class=\"left pane\" style={{\r\n width: `${this.leftWidth}px`,\r\n }}>\r\n <slot name=\"left\"></slot>\r\n </div>\r\n <button\r\n onMouseDown={e => this.handleMouseDown(e)}\r\n onTouchStart={e => this.handleMouseDown(e)}\r\n onKeyDown={e => this.handleKeyDown(e)}\r\n ref={el => this.splitter = el}\r\n style={{\r\n minWidth: `${this.splitterWidth.toString()}px`,\r\n left: `${this.leftWidth - 2}px`,\r\n }}\r\n >\r\n <slot></slot>\r\n </button>\r\n <div\r\n class=\"right pane\"\r\n style={{\r\n width: `${this.rightWidth}px`,\r\n }}>\r\n <slot name=\"right\"></slot>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n}\r\n"],"version":3}
@@ -123,7 +123,7 @@ const patchCloneNodeFix = (HTMLElementPrototype) => {
123
123
 
124
124
  patchBrowser().then(options => {
125
125
  appGlobals.globalScripts();
126
- return index.bootstrapLazy([["dnn-image-cropper.cjs",[[1,"dnn-image-cropper",{"width":[2],"height":[2],"resx":[16],"quality":[2],"preventUndersized":[4,"prevent-undersized"],"view":[32]}]]],["dnn-treeview-item.cjs",[[1,"dnn-treeview-item",{"expanded":[1028],"hasChildren":[32]}]]],["dnn-checkbox.cjs",[[1,"dnn-checkbox",{"checked":[1028],"useIntermediate":[4,"use-intermediate"],"value":[1]}]]],["dnn-chevron.cjs",[[1,"dnn-chevron",{"expandText":[1,"expand-text"],"collapseText":[1,"collapse-text"],"expanded":[1540]}]]],["dnn-color-picker.cjs",[[1,"dnn-color-picker",{"color":[1],"colorBoxHeight":[1,"color-box-height"],"currentColor":[32],"rgbDisplay":[32],"hslDisplay":[32],"hexDisplay":[32]}]]],["dnn-searchbox.cjs",[[1,"dnn-searchbox",{"placeholder":[1],"debounced":[4],"query":[1025]}]]],["dnn-sort-icon.cjs",[[1,"dnn-sort-icon",{"sortDirection":[1,"sort-direction"]}]]],["dnn-tab.cjs",[[1,"dnn-tab",{"tabTitle":[1,"tab-title"],"visible":[32],"show":[64],"hide":[64]}]]],["dnn-tabs.cjs",[[1,"dnn-tabs",{"tabTitles":[32],"selectedTabTitle":[32]}]]],["dnn-toggle.cjs",[[1,"dnn-toggle",{"checked":[1028],"disabled":[4]}]]],["dnn-vertical-overflow-menu.cjs",[[1,"dnn-vertical-overflow-menu",{"showDropdownButton":[32],"showDropdownMenu":[32]}]]],["dnn-vertical-splitview.cjs",[[1,"dnn-vertical-splitview",{"splitterWidth":[2,"splitter-width"],"splitWidthPercentage":[2,"split-width-percentage"],"leftWidth":[32],"rightWidth":[32],"setSplitWidthPercentage":[64],"getSplitWidthPercentage":[64]}]]],["dnn-button.cjs",[[1,"dnn-button",{"type":[1],"reversed":[4],"size":[1],"confirm":[4],"confirmYesText":[1,"confirm-yes-text"],"confirmNoText":[1,"confirm-no-text"],"confirmMessage":[1,"confirm-message"],"disabled":[4],"modalVisible":[32]}]]],["dnn-collapsible.cjs",[[1,"dnn-collapsible",{"expanded":[516],"transitionDuration":[2,"transition-duration"],"updateSize":[64]},[[0,"dnnCollapsibleHeightChanged","handleHeightChanged"]]]]],["dnn-dropzone.cjs",[[1,"dnn-dropzone",{"resx":[16],"allowedExtensions":[16],"allowCameraMode":[4,"allow-camera-mode"],"captureQuality":[2,"capture-quality"],"canTakeSnapshots":[32],"takingPicture":[32]}]]],["dnn-modal.cjs",[[1,"dnn-modal",{"backdropDismiss":[4,"backdrop-dismiss"],"closeText":[1,"close-text"],"showCloseButton":[4,"show-close-button"],"visible":[32],"show":[64],"hide":[64]}]]]], options);
126
+ return index.bootstrapLazy([["dnn-image-cropper.cjs",[[1,"dnn-image-cropper",{"width":[2],"height":[2],"resx":[16],"quality":[2],"preventUndersized":[4,"prevent-undersized"],"view":[32]}]]],["dnn-treeview-item.cjs",[[1,"dnn-treeview-item",{"expanded":[1540],"hasChildren":[32]}]]],["dnn-checkbox.cjs",[[1,"dnn-checkbox",{"checked":[1028],"useIntermediate":[4,"use-intermediate"],"value":[1]}]]],["dnn-chevron.cjs",[[1,"dnn-chevron",{"expandText":[1,"expand-text"],"collapseText":[1,"collapse-text"],"expanded":[1540]}]]],["dnn-color-picker.cjs",[[1,"dnn-color-picker",{"color":[1],"colorBoxHeight":[1,"color-box-height"],"currentColor":[32],"rgbDisplay":[32],"hslDisplay":[32],"hexDisplay":[32]}]]],["dnn-searchbox.cjs",[[1,"dnn-searchbox",{"placeholder":[1],"debounced":[4],"query":[1025]}]]],["dnn-sort-icon.cjs",[[1,"dnn-sort-icon",{"sortDirection":[1,"sort-direction"]}]]],["dnn-tab.cjs",[[1,"dnn-tab",{"tabTitle":[1,"tab-title"],"visible":[32],"show":[64],"hide":[64]}]]],["dnn-tabs.cjs",[[1,"dnn-tabs",{"tabTitles":[32],"selectedTabTitle":[32]}]]],["dnn-toggle.cjs",[[1,"dnn-toggle",{"checked":[1028],"disabled":[4]}]]],["dnn-vertical-overflow-menu.cjs",[[1,"dnn-vertical-overflow-menu",{"showDropdownButton":[32],"showDropdownMenu":[32]}]]],["dnn-vertical-splitview.cjs",[[1,"dnn-vertical-splitview",{"splitterWidth":[2,"splitter-width"],"splitWidthPercentage":[1026,"split-width-percentage"],"leftWidth":[32],"rightWidth":[32],"setSplitWidthPercentage":[64],"getSplitWidthPercentage":[64]}]]],["dnn-button.cjs",[[1,"dnn-button",{"type":[1],"reversed":[4],"size":[1],"confirm":[4],"confirmYesText":[1,"confirm-yes-text"],"confirmNoText":[1,"confirm-no-text"],"confirmMessage":[1,"confirm-message"],"disabled":[4],"modalVisible":[32]}]]],["dnn-collapsible.cjs",[[1,"dnn-collapsible",{"expanded":[516],"transitionDuration":[2,"transition-duration"],"updateSize":[64]},[[0,"dnnCollapsibleHeightChanged","handleHeightChanged"]]]]],["dnn-dropzone.cjs",[[1,"dnn-dropzone",{"resx":[16],"allowedExtensions":[16],"allowCameraMode":[4,"allow-camera-mode"],"captureQuality":[2,"capture-quality"],"canTakeSnapshots":[32],"takingPicture":[32]}]]],["dnn-modal.cjs",[[1,"dnn-modal",{"backdropDismiss":[4,"backdrop-dismiss"],"closeText":[1,"close-text"],"showCloseButton":[4,"show-close-button"],"visible":[32],"show":[64],"hide":[64]}]]]], options);
127
127
  });
128
128
 
129
129
  //# sourceMappingURL=dnn.cjs.js.map
@@ -30,7 +30,7 @@ const defineCustomElements = (win, options) => {
30
30
  if (typeof window === 'undefined') return Promise.resolve();
31
31
  return patchEsm().then(() => {
32
32
  appGlobals.globalScripts();
33
- return index.bootstrapLazy([["dnn-image-cropper.cjs",[[1,"dnn-image-cropper",{"width":[2],"height":[2],"resx":[16],"quality":[2],"preventUndersized":[4,"prevent-undersized"],"view":[32]}]]],["dnn-treeview-item.cjs",[[1,"dnn-treeview-item",{"expanded":[1028],"hasChildren":[32]}]]],["dnn-checkbox.cjs",[[1,"dnn-checkbox",{"checked":[1028],"useIntermediate":[4,"use-intermediate"],"value":[1]}]]],["dnn-chevron.cjs",[[1,"dnn-chevron",{"expandText":[1,"expand-text"],"collapseText":[1,"collapse-text"],"expanded":[1540]}]]],["dnn-color-picker.cjs",[[1,"dnn-color-picker",{"color":[1],"colorBoxHeight":[1,"color-box-height"],"currentColor":[32],"rgbDisplay":[32],"hslDisplay":[32],"hexDisplay":[32]}]]],["dnn-searchbox.cjs",[[1,"dnn-searchbox",{"placeholder":[1],"debounced":[4],"query":[1025]}]]],["dnn-sort-icon.cjs",[[1,"dnn-sort-icon",{"sortDirection":[1,"sort-direction"]}]]],["dnn-tab.cjs",[[1,"dnn-tab",{"tabTitle":[1,"tab-title"],"visible":[32],"show":[64],"hide":[64]}]]],["dnn-tabs.cjs",[[1,"dnn-tabs",{"tabTitles":[32],"selectedTabTitle":[32]}]]],["dnn-toggle.cjs",[[1,"dnn-toggle",{"checked":[1028],"disabled":[4]}]]],["dnn-vertical-overflow-menu.cjs",[[1,"dnn-vertical-overflow-menu",{"showDropdownButton":[32],"showDropdownMenu":[32]}]]],["dnn-vertical-splitview.cjs",[[1,"dnn-vertical-splitview",{"splitterWidth":[2,"splitter-width"],"splitWidthPercentage":[2,"split-width-percentage"],"leftWidth":[32],"rightWidth":[32],"setSplitWidthPercentage":[64],"getSplitWidthPercentage":[64]}]]],["dnn-button.cjs",[[1,"dnn-button",{"type":[1],"reversed":[4],"size":[1],"confirm":[4],"confirmYesText":[1,"confirm-yes-text"],"confirmNoText":[1,"confirm-no-text"],"confirmMessage":[1,"confirm-message"],"disabled":[4],"modalVisible":[32]}]]],["dnn-collapsible.cjs",[[1,"dnn-collapsible",{"expanded":[516],"transitionDuration":[2,"transition-duration"],"updateSize":[64]},[[0,"dnnCollapsibleHeightChanged","handleHeightChanged"]]]]],["dnn-dropzone.cjs",[[1,"dnn-dropzone",{"resx":[16],"allowedExtensions":[16],"allowCameraMode":[4,"allow-camera-mode"],"captureQuality":[2,"capture-quality"],"canTakeSnapshots":[32],"takingPicture":[32]}]]],["dnn-modal.cjs",[[1,"dnn-modal",{"backdropDismiss":[4,"backdrop-dismiss"],"closeText":[1,"close-text"],"showCloseButton":[4,"show-close-button"],"visible":[32],"show":[64],"hide":[64]}]]]], options);
33
+ return index.bootstrapLazy([["dnn-image-cropper.cjs",[[1,"dnn-image-cropper",{"width":[2],"height":[2],"resx":[16],"quality":[2],"preventUndersized":[4,"prevent-undersized"],"view":[32]}]]],["dnn-treeview-item.cjs",[[1,"dnn-treeview-item",{"expanded":[1540],"hasChildren":[32]}]]],["dnn-checkbox.cjs",[[1,"dnn-checkbox",{"checked":[1028],"useIntermediate":[4,"use-intermediate"],"value":[1]}]]],["dnn-chevron.cjs",[[1,"dnn-chevron",{"expandText":[1,"expand-text"],"collapseText":[1,"collapse-text"],"expanded":[1540]}]]],["dnn-color-picker.cjs",[[1,"dnn-color-picker",{"color":[1],"colorBoxHeight":[1,"color-box-height"],"currentColor":[32],"rgbDisplay":[32],"hslDisplay":[32],"hexDisplay":[32]}]]],["dnn-searchbox.cjs",[[1,"dnn-searchbox",{"placeholder":[1],"debounced":[4],"query":[1025]}]]],["dnn-sort-icon.cjs",[[1,"dnn-sort-icon",{"sortDirection":[1,"sort-direction"]}]]],["dnn-tab.cjs",[[1,"dnn-tab",{"tabTitle":[1,"tab-title"],"visible":[32],"show":[64],"hide":[64]}]]],["dnn-tabs.cjs",[[1,"dnn-tabs",{"tabTitles":[32],"selectedTabTitle":[32]}]]],["dnn-toggle.cjs",[[1,"dnn-toggle",{"checked":[1028],"disabled":[4]}]]],["dnn-vertical-overflow-menu.cjs",[[1,"dnn-vertical-overflow-menu",{"showDropdownButton":[32],"showDropdownMenu":[32]}]]],["dnn-vertical-splitview.cjs",[[1,"dnn-vertical-splitview",{"splitterWidth":[2,"splitter-width"],"splitWidthPercentage":[1026,"split-width-percentage"],"leftWidth":[32],"rightWidth":[32],"setSplitWidthPercentage":[64],"getSplitWidthPercentage":[64]}]]],["dnn-button.cjs",[[1,"dnn-button",{"type":[1],"reversed":[4],"size":[1],"confirm":[4],"confirmYesText":[1,"confirm-yes-text"],"confirmNoText":[1,"confirm-no-text"],"confirmMessage":[1,"confirm-message"],"disabled":[4],"modalVisible":[32]}]]],["dnn-collapsible.cjs",[[1,"dnn-collapsible",{"expanded":[516],"transitionDuration":[2,"transition-duration"],"updateSize":[64]},[[0,"dnnCollapsibleHeightChanged","handleHeightChanged"]]]]],["dnn-dropzone.cjs",[[1,"dnn-dropzone",{"resx":[16],"allowedExtensions":[16],"allowCameraMode":[4,"allow-camera-mode"],"captureQuality":[2,"capture-quality"],"canTakeSnapshots":[32],"takingPicture":[32]}]]],["dnn-modal.cjs",[[1,"dnn-modal",{"backdropDismiss":[4,"backdrop-dismiss"],"closeText":[1,"close-text"],"showCloseButton":[4,"show-close-button"],"visible":[32],"show":[64],"hide":[64]}]]]], options);
34
34
  });
35
35
  };
36
36
 
@@ -29,7 +29,12 @@ export class DnnCollapsible {
29
29
  this.updateSize();
30
30
  }
31
31
  else {
32
- this.container.style.maxHeight = "0px";
32
+ requestAnimationFrame(() => {
33
+ this.container.style.maxHeight = `${this.container.scrollHeight}px`;
34
+ requestAnimationFrame(() => {
35
+ this.container.style.maxHeight = "0px";
36
+ });
37
+ });
33
38
  }
34
39
  setTimeout(() => {
35
40
  requestAnimationFrame(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"dnn-collapsible.js","sourceRoot":"","sources":["../../../src/components/dnn-collapsible/dnn-collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAO9G,MAAM,OAAO,cAAc;EAL3B;IASE,+CAA+C;IACxB,aAAQ,GAAY,KAAK,CAAC;IAEjD,2DAA2D;IACnD,uBAAkB,GAAY,GAAG,CAAC;GAsD3C;EAhDC,mBAAmB;IACjB,qBAAqB,CAAC,GAAG,EAAE;MACzB,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC,CAAC,CAAA;EACJ,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,UAAU;IACd,IAAI,IAAI,CAAC,QAAQ,EAAC;MACd,qBAAqB,CAAC,GAAG,EAAE;QACzB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC;MACtE,CAAC,CAAC,CAAC;MACH,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;MAC1C,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;KAC/B;EACH,CAAC;EAGD,sBAAsB,CAAC,QAAiB;IACtC,IAAI,QAAQ,EAAC;MACX,IAAI,CAAC,UAAU,EAAE,CAAC;KACnB;SACG;MACF,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;KACxC;IACD,UAAU,CAAC,GAAG,EAAE;MACd,qBAAqB,CAAC,GAAG,EAAE;QACzB,IAAI,CAAC,2BAA2B,CAAC,IAAI,EAAE,CAAC;MAC1C,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;EAC9B,CAAC;EAID,MAAM;IACJ,OAAO,CACL,EAAC,IAAI;MACH,WAAK,EAAE,EAAC,WAAW,EAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,IAAI,UAAU,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE;QAClF,eAAa,CACX,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, h, Prop, Element, Event, EventEmitter, Watch, Listen, Method } from '@stencil/core';\r\n\r\n@Component({\r\n tag: \"dnn-collapsible\",\r\n styleUrl: \"dnn-collapsible.scss\",\r\n shadow: true\r\n})\r\nexport class DnnCollapsible {\r\n\r\n @Element() el: HTMLDnnCollapsibleElement;\r\n\r\n /** Defines if the panel is expanded or not. */\r\n @Prop({reflect: true}) expanded: boolean = false;\r\n\r\n /** Defines the transition time in ms, defaults to 100ms */\r\n @Prop() transitionDuration?: number = 150;\r\n\r\n /** Fires whenever the collapsible height has changed */\r\n @Event({bubbles: true, composed: true}) dnnCollapsibleHeightChanged: EventEmitter<void>;\r\n\r\n @Listen(\"dnnCollapsibleHeightChanged\")\r\n handleHeightChanged(){\r\n requestAnimationFrame(() => {\r\n this.updateSize();\r\n })\r\n }\r\n\r\n /**\r\n * Updates the component height, use to update after a slot content changes.\r\n */\r\n @Method()\r\n async updateSize() {\r\n if (this.expanded){\r\n requestAnimationFrame(() => {\r\n this.container.style.maxHeight = `${this.container.scrollHeight}px`;\r\n });\r\n setTimeout(() => {\r\n this.container.style.maxHeight = \"none\";\r\n }, this.transitionDuration);\r\n }\r\n }\r\n \r\n @Watch(\"expanded\")\r\n handledExpandedChanged(expanded: boolean){\r\n if (expanded){\r\n this.updateSize();\r\n }\r\n else{\r\n this.container.style.maxHeight = \"0px\";\r\n }\r\n setTimeout(() => {\r\n requestAnimationFrame(() => {\r\n this.dnnCollapsibleHeightChanged.emit();\r\n });\r\n }, this.transitionDuration);\r\n }\r\n \r\n private container: HTMLDivElement;\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div id=\"container\" class={this.expanded && \"expanded\"} ref={el => this.container = el}>\r\n <slot></slot>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n\r\n}\r\n"]}
1
+ {"version":3,"file":"dnn-collapsible.js","sourceRoot":"","sources":["../../../src/components/dnn-collapsible/dnn-collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAO9G,MAAM,OAAO,cAAc;EAL3B;IASE,+CAA+C;IACxB,aAAQ,GAAY,KAAK,CAAC;IAEjD,2DAA2D;IACnD,uBAAkB,GAAY,GAAG,CAAC;GA2D3C;EArDC,mBAAmB;IACjB,qBAAqB,CAAC,GAAG,EAAE;MACzB,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC,CAAC,CAAA;EACJ,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,UAAU;IACd,IAAI,IAAI,CAAC,QAAQ,EAAC;MACd,qBAAqB,CAAC,GAAG,EAAE;QACzB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC;MACtE,CAAC,CAAC,CAAC;MACH,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;MAC1C,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;KAC/B;EACH,CAAC;EAGD,sBAAsB,CAAC,QAAiB;IACtC,IAAI,QAAQ,EAAC;MACX,IAAI,CAAC,UAAU,EAAE,CAAC;KACnB;SACG;MACF,qBAAqB,CAAC,GAAG,EAAE;QACzB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC;QACpE,qBAAqB,CAAC,GAAG,EAAE;UACzB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;QACzC,CAAC,CAAC,CAAC;MACL,CAAC,CAAC,CAAC;KACJ;IACD,UAAU,CAAC,GAAG,EAAE;MACd,qBAAqB,CAAC,GAAG,EAAE;QACzB,IAAI,CAAC,2BAA2B,CAAC,IAAI,EAAE,CAAC;MAC1C,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;EAC9B,CAAC;EAID,MAAM;IACJ,OAAO,CACL,EAAC,IAAI;MACH,WAAK,EAAE,EAAC,WAAW,EAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,IAAI,UAAU,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE;QAClF,eAAa,CACX,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, h, Prop, Element, Event, EventEmitter, Watch, Listen, Method } from '@stencil/core';\r\n\r\n@Component({\r\n tag: \"dnn-collapsible\",\r\n styleUrl: \"dnn-collapsible.scss\",\r\n shadow: true\r\n})\r\nexport class DnnCollapsible {\r\n\r\n @Element() el: HTMLDnnCollapsibleElement;\r\n\r\n /** Defines if the panel is expanded or not. */\r\n @Prop({reflect: true}) expanded: boolean = false;\r\n\r\n /** Defines the transition time in ms, defaults to 100ms */\r\n @Prop() transitionDuration?: number = 150;\r\n\r\n /** Fires whenever the collapsible height has changed */\r\n @Event({bubbles: true, composed: true}) dnnCollapsibleHeightChanged: EventEmitter<void>;\r\n\r\n @Listen(\"dnnCollapsibleHeightChanged\")\r\n handleHeightChanged(){\r\n requestAnimationFrame(() => {\r\n this.updateSize();\r\n })\r\n }\r\n\r\n /**\r\n * Updates the component height, use to update after a slot content changes.\r\n */\r\n @Method()\r\n async updateSize() {\r\n if (this.expanded){\r\n requestAnimationFrame(() => {\r\n this.container.style.maxHeight = `${this.container.scrollHeight}px`;\r\n });\r\n setTimeout(() => {\r\n this.container.style.maxHeight = \"none\";\r\n }, this.transitionDuration);\r\n }\r\n }\r\n \r\n @Watch(\"expanded\")\r\n handledExpandedChanged(expanded: boolean){\r\n if (expanded){\r\n this.updateSize();\r\n }\r\n else{\r\n requestAnimationFrame(() => {\r\n this.container.style.maxHeight = `${this.container.scrollHeight}px`;\r\n requestAnimationFrame(() => {\r\n this.container.style.maxHeight = \"0px\";\r\n });\r\n });\r\n }\r\n setTimeout(() => {\r\n requestAnimationFrame(() => {\r\n this.dnnCollapsibleHeightChanged.emit();\r\n });\r\n }, this.transitionDuration);\r\n }\r\n \r\n private container: HTMLDivElement;\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div id=\"container\" class={this.expanded && \"expanded\"} ref={el => this.container = el}>\r\n <slot></slot>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n\r\n}\r\n"]}
@@ -1,14 +1,25 @@
1
- import { Component, Host, h, Prop, State, Element, Event } from '@stencil/core';
1
+ import { Component, Host, h, Prop, State, Element, Event, Watch } from '@stencil/core';
2
2
  export class DnnTreeviewItem {
3
3
  constructor() {
4
- /** Defines if the current node is expanded */
4
+ /** Defines if the current node is expanded. */
5
5
  this.expanded = false;
6
+ /** Manages state for whether or not item has children. */
6
7
  this.hasChildren = false;
7
8
  }
9
+ /** Watch expanded Prop */
10
+ watchExpanded(expanded) {
11
+ if (expanded) {
12
+ this.expander.classList.add("expanded");
13
+ this.collapsible.expanded = true;
14
+ return;
15
+ }
16
+ this.expander.classList.remove("expanded");
17
+ this.collapsible.expanded = false;
18
+ }
8
19
  componentDidLoad() {
9
20
  requestAnimationFrame(() => {
10
- const children = this.childrenElement.children[0];
11
- const count = children.assignedElements().length;
21
+ const child = this.childElement.children[0];
22
+ const count = child.assignedElements().length;
12
23
  if (count > 0) {
13
24
  this.hasChildren = true;
14
25
  }
@@ -42,7 +53,7 @@ export class DnnTreeviewItem {
42
53
  h("div", { class: "item-slot" },
43
54
  h("slot", null)),
44
55
  h("dnn-collapsible", { ref: el => this.collapsible = el, expanded: this.expanded },
45
- h("div", { ref: el => this.childrenElement = el },
56
+ h("div", { ref: el => this.childElement = el },
46
57
  h("slot", { name: "children" }))))));
47
58
  }
48
59
  static get is() { return "dnn-treeview-item"; }
@@ -66,10 +77,10 @@ export class DnnTreeviewItem {
66
77
  "optional": false,
67
78
  "docs": {
68
79
  "tags": [],
69
- "text": "Defines if the current node is expanded"
80
+ "text": "Defines if the current node is expanded."
70
81
  },
71
82
  "attribute": "expanded",
72
- "reflect": false,
83
+ "reflect": true,
73
84
  "defaultValue": "false"
74
85
  }
75
86
  }; }
@@ -108,5 +119,9 @@ export class DnnTreeviewItem {
108
119
  }
109
120
  }]; }
110
121
  static get elementRef() { return "el"; }
122
+ static get watchers() { return [{
123
+ "propName": "expanded",
124
+ "methodName": "watchExpanded"
125
+ }]; }
111
126
  }
112
127
  //# sourceMappingURL=dnn-treeview-item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dnn-treeview-item.js","sourceRoot":"","sources":["../../../src/components/dnn-treeview-item/dnn-treeview-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAO9F,MAAM,OAAO,eAAe;EAL5B;IAWE,+CAA+C;IACxB,aAAQ,GAAY,KAAK,CAAC;I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CAAC,IAAI,CAAC,cAAc,EAAE;UAEpC,WAAK,KAAK,EAAC,4BAA4B,EAAC,MAAM,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,MAAM,EAAC,IAAI,EAAC,SAAS;YAAC,YAAM,CAAC,EAAC,oBAAoB,GAAE;YAAA,YAAM,CAAC,EAAC,kBAAkB,EAAC,IAAI,EAAC,MAAM,GAAE,CAAM,CAC3K,CAEP;MACN,WAAK,KAAK,EAAC,MAAM;QACf,WAAK,KAAK,EAAC,WAAW;UACpB,eAAa,CACT;QACN,uBAAiB,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ;UACxE,WAAK,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,eAAe,GAAG,EAAE;YACvC,YAAM,IAAI,EAAC,UAAU,GAAQ,CACzB,CACU,CACZ,CACH,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State, Element, Event, EventEmitter } from '@stencil/core';\r\n\r\n@Component({\r\n tag: 'dnn-treeview-item',\r\n styleUrl: 'dnn-treeview-item.scss',\r\n shadow: true,\r\n})\r\nexport class DnnTreeviewItem {\r\n \r\n private expander!: HTMLDivElement;\r\n\r\n @Element() el!: HTMLDnnTreeviewItemElement;\r\n \r\n /** Defines if the current node is expanded */\r\n @Prop({mutable: true}) expanded: boolean = false;\r\n\r\n /** Fires when the user expands a node. */\r\n @Event({bubbles: false}) userExpanded: EventEmitter<void>;\r\n\r\n /** Fires when the user collapses a node. */\r\n @Event({bubbles: false}) userCollapsed: EventEmitter<void>;\r\n\r\n @State() hasChildren: boolean = false;\r\n \r\n private childrenElement!: HTMLDivElement;\r\n private collapsible!: HTMLDnnCollapsibleElement;\r\n\r\n componentDidLoad() {\r\n requestAnimationFrame(() => {\r\n const children = this.childrenElement.children[0] as HTMLSlotElement;\r\n const count = children.assignedElements().length\r\n if (count > 0){\r\n this.hasChildren = true;\r\n }\r\n if (this.expanded){\r\n this.expander.classList.add(\"expanded\");\r\n this.collapsible.expanded = false;\r\n setTimeout(() => {\r\n this.collapsible.expanded = true;\r\n }, 300);\r\n }\r\n });\r\n }\r\n\r\n private toggleCollapse(): void {\r\n this.expanded = !this.expanded;\r\n if (this.expanded){\r\n this.expander.classList.add(\"expanded\");\r\n this.userExpanded.emit();\r\n return;\r\n }\r\n\r\n this.expander.classList.remove(\"expanded\");\r\n this.userCollapsed.emit();\r\n }\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div class=\"expander\" ref={el => this.expander = el}>\r\n {this.hasChildren &&\r\n <button\r\n onClick={() => this.toggleCollapse()}\r\n >\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\"><path d=\"M10 17l5-5-5-5v10z\"/><path d=\"M0 24V0h24v24H0z\" fill=\"none\"/></svg>\r\n </button>\r\n }\r\n </div>\r\n <div class=\"item\">\r\n <div class=\"item-slot\">\r\n <slot></slot>\r\n </div>\r\n <dnn-collapsible ref={el => this.collapsible = el} expanded={this.expanded}>\r\n <div ref={el => this.childrenElement = el}>\r\n <slot name=\"children\"></slot>\r\n </div>\r\n </dnn-collapsible>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n}\r\n\r\nexport interface ExpandedToggledEvent{\r\n state: \"expanded\" | \"collapsed\";\r\n height: number;\r\n}"]}
1
+ {"version":3,"file":"dnn-treeview-item.js","sourceRoot":"","sources":["../../../src/components/dnn-treeview-item/dnn-treeview-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,eAAe,CA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n\r\n@Component({\r\n tag: 'dnn-treeview-item',\r\n styleUrl: 'dnn-treeview-item.scss',\r\n shadow: true,\r\n})\r\nexport class DnnTreeviewItem {\r\n \r\n private expander!: HTMLDivElement;\r\n\r\n @Element() el!: HTMLDnnTreeviewItemElement;\r\n \r\n /** Defines if the current node is expanded. */\r\n @Prop({mutable: true, reflect: true}) expanded: boolean = false;\r\n\r\n /** Fires when the user expands a node. */\r\n @Event({bubbles: false}) userExpanded: EventEmitter<void>;\r\n\r\n /** Fires when the user collapses a node. */\r\n @Event({bubbles: false}) userCollapsed: EventEmitter<void>;\r\n\r\n /** Manages state for whether or not item has children. */\r\n @State() hasChildren: boolean = false;\r\n\r\n /** Watch expanded Prop */\r\n @Watch('expanded')\r\n watchExpanded(expanded: boolean) {\r\n if (expanded) {\r\n this.expander.classList.add(\"expanded\");\r\n this.collapsible.expanded = true;\r\n return;\r\n }\r\n \r\n this.expander.classList.remove(\"expanded\");\r\n this.collapsible.expanded = false;\r\n }\r\n \r\n \r\n private childElement!: HTMLDivElement;\r\n private collapsible!: HTMLDnnCollapsibleElement;\r\n\r\n componentDidLoad() {\r\n requestAnimationFrame(() => {\r\n const child = this.childElement.children[0] as HTMLSlotElement;\r\n const count = child.assignedElements().length\r\n if (count > 0){\r\n this.hasChildren = true;\r\n }\r\n if (this.expanded){\r\n this.expander.classList.add(\"expanded\");\r\n this.collapsible.expanded = false;\r\n setTimeout(() => {\r\n this.collapsible.expanded = true;\r\n }, 300);\r\n }\r\n });\r\n }\r\n\r\n private toggleCollapse(): void {\r\n this.expanded = !this.expanded;\r\n if (this.expanded){\r\n this.expander.classList.add(\"expanded\");\r\n this.userExpanded.emit();\r\n return;\r\n }\r\n\r\n this.expander.classList.remove(\"expanded\");\r\n this.userCollapsed.emit();\r\n }\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div class=\"expander\" ref={el => this.expander = el}>\r\n {this.hasChildren &&\r\n <button\r\n onClick={() => this.toggleCollapse()}\r\n >\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\"><path d=\"M10 17l5-5-5-5v10z\"/><path d=\"M0 24V0h24v24H0z\" fill=\"none\"/></svg>\r\n </button>\r\n }\r\n </div>\r\n <div class=\"item\">\r\n <div class=\"item-slot\">\r\n <slot></slot>\r\n </div>\r\n <dnn-collapsible ref={el => this.collapsible = el} expanded={this.expanded}>\r\n <div ref={el => this.childElement = el}>\r\n <slot name=\"children\"></slot>\r\n </div>\r\n </dnn-collapsible>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n}\r\n\r\nexport interface ExpandedToggledEvent{\r\n state: \"expanded\" | \"collapsed\";\r\n height: number;\r\n}"]}
@@ -45,26 +45,32 @@ export class DnnVerticalSplitview {
45
45
  }
46
46
  componentDidLoad() {
47
47
  requestAnimationFrame(() => {
48
- const fullWidth = this.element.getBoundingClientRect().width;
49
- this.leftWidth = fullWidth * this.splitWidthPercentage / 100;
50
- this.rightWidth = fullWidth - this.leftWidth;
51
- this.widthChanged.emit(this.splitWidthPercentage);
48
+ this.resizeObserver = new ResizeObserver(() => {
49
+ const fullWidth = this.element.getBoundingClientRect().width;
50
+ this.leftWidth = fullWidth * this.splitWidthPercentage / 100;
51
+ this.rightWidth = fullWidth - this.leftWidth;
52
+ this.widthChanged.emit(this.splitWidthPercentage);
53
+ });
54
+ this.resizeObserver.observe(this.element);
52
55
  });
53
56
  }
54
57
  handleMouseDown(event) {
55
58
  event.preventDefault();
56
59
  const handleDrag = (ev) => {
57
- let { movementX } = getMovementFromEvent(ev, this.previousTouch);
58
- let fullWidth = this.element.getBoundingClientRect().width;
59
- let newLeft = this.leftWidth + movementX;
60
- if (newLeft < 0) {
61
- newLeft = 0;
62
- }
63
- if (newLeft > fullWidth) {
64
- newLeft = fullWidth;
65
- }
66
- this.leftWidth = newLeft;
67
- this.rightWidth = fullWidth - newLeft;
60
+ requestAnimationFrame(() => {
61
+ let fullWidth = this.element.getBoundingClientRect().width;
62
+ let { movementX } = getMovementFromEvent(ev, this.previousTouch);
63
+ let newLeft = this.leftWidth + movementX;
64
+ if (newLeft < 0) {
65
+ newLeft = 0;
66
+ }
67
+ if (newLeft > fullWidth) {
68
+ newLeft = fullWidth;
69
+ }
70
+ this.leftWidth = newLeft;
71
+ this.rightWidth = fullWidth - newLeft;
72
+ this.splitWidthPercentage = this.leftWidth / fullWidth * 100;
73
+ });
68
74
  };
69
75
  const handleDragFinished = () => {
70
76
  document.removeEventListener("mousemove", handleDrag);
@@ -149,7 +155,7 @@ export class DnnVerticalSplitview {
149
155
  },
150
156
  "splitWidthPercentage": {
151
157
  "type": "number",
152
- "mutable": false,
158
+ "mutable": true,
153
159
  "complexType": {
154
160
  "original": "number",
155
161
  "resolved": "number",
@@ -1 +1 @@
1
- {"version":3,"file":"dnn-vertical-splitview.js","sourceRoot":"","sources":["../../../src/components/dnn-vertical-splitview/dnn-vertical-splitview.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACtG,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEtE;;;;GAIG;AAMH,MAAM,OAAO,oBAAoB;EALjC;IAOE,sCAAsC;IAC9B,kBAAa,GAAG,EAAE,CAAC;IAE3B,gEAAgE;IACxD,yBAAoB,GAAG,EAAE,CAAC;IAwCzB,cAAS,GAAG,CAAC,CAAC;IACd,eAAU,GAAG,CAAC,CAAC;GAoGzB;EAzIC,+CAA+C;EAE/C,KAAK,CAAC,uBAAuB,CAAC,QAAgB;IAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAChE,qBAAqB,CAAC,GAAG,EAAE;MACzB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,E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CAAC,EACzC,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAC1C,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EACrC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,GAAG,EAAE,EAC7B,KAAK,EAAE;UACL,QAAQ,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI;UAC9C,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI;SAChC;QAED,eAAa,CACN;MACT,WACE,KAAK,EAAC,YAAY,EAClB,KAAK,EAAE;UACL,KAAK,EAAE,GAAG,IAAI,CAAC,UAAU,IAAI;SAC9B;QACD,YAAM,IAAI,EAAC,OAAO,GAAQ,CACtB,CACH,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, Element, State, Method, Event, EventEmitter } from '@stencil/core';\r\nimport { getMovementFromEvent } from \"../../utilities/mouseUtilities\";\r\n\r\n/**\r\n * @slot default - The split divider control you want to use.\r\n * @slot left - The content of the left pane.\r\n * @slot right - The content of the right pane.\r\n */\r\n@Component({\r\n tag: 'dnn-vertical-splitview',\r\n styleUrl: 'dnn-vertical-splitview.scss',\r\n shadow: true,\r\n})\r\nexport class DnnVerticalSplitview {\r\n\r\n /** The width of the splitter area. */\r\n @Prop() splitterWidth = 16;\r\n\r\n /** The percentage position of the splitter in the container. */\r\n @Prop() splitWidthPercentage = 30;\r\n \r\n private splitter!: HTMLButtonElement;\r\n\r\n /** Sets the width percentage of the divider */\r\n @Method()\r\n async setSplitWidthPercentage(newWidth: number) {\r\n const panes = this.element.shadowRoot.querySelectorAll(\".pane\");\r\n requestAnimationFrame(() => {\r\n panes.forEach(pane => pane.classList.add(\"transition\"));\r\n this.splitter.classList.add(\"transition\");\r\n requestAnimationFrame(() => {\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n let newLeft = fullWidth * newWidth / 100;\r\n if (newLeft < 0){\r\n newLeft = 0;\r\n }\r\n if (newLeft > fullWidth){\r\n newLeft = fullWidth;\r\n }\r\n this.leftWidth = newLeft;\r\n this.rightWidth = fullWidth - newLeft;\r\n setTimeout(() => {\r\n panes.forEach(pane => pane.classList.remove(\"transition\"));\r\n this.splitter.classList.remove(\"transition\");\r\n }, 300);\r\n });\r\n });\r\n }\r\n\r\n /** Gets the current divider position percentage. */\r\n @Method()\r\n async getSplitWidthPercentage(){\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n return this.leftWidth / fullWidth;\r\n }\r\n\r\n /** Fires when the width of the divider changes. */\r\n @Event() widthChanged: EventEmitter<number>;\r\n\r\n @State() leftWidth = 0;\r\n @State() rightWidth = 0;\r\n\r\n @Element() element : HTMLDnnVerticalSplitviewElement;\r\n \r\n componentDidLoad() {\r\n requestAnimationFrame(() => {\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n this.leftWidth = fullWidth * this.splitWidthPercentage / 100;\r\n this.rightWidth = fullWidth - this.leftWidth;\r\n this.widthChanged.emit(this.splitWidthPercentage);\r\n });\r\n }\r\n \r\n private previousTouch: Touch;\r\n\r\n private handleMouseDown(event: MouseEvent | TouchEvent) {\r\n event.preventDefault();\r\n const handleDrag = (ev: MouseEvent | TouchEvent) => {\r\n let {movementX} = getMovementFromEvent(ev, this.previousTouch);\r\n let fullWidth = this.element.getBoundingClientRect().width;\r\n let newLeft = this.leftWidth + movementX;\r\n if (newLeft < 0){\r\n newLeft = 0;\r\n }\r\n if (newLeft > fullWidth){\r\n newLeft = fullWidth;\r\n }\r\n this.leftWidth = newLeft;\r\n this.rightWidth = fullWidth - newLeft;\r\n }\r\n const handleDragFinished = () => {\r\n document.removeEventListener(\"mousemove\", handleDrag);\r\n document.removeEventListener(\"touchmove\", handleDrag);\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n const newPercentage = this.leftWidth / fullWidth * 100;\r\n this.widthChanged.emit(newPercentage);\r\n };\r\n document.addEventListener(\"mouseup\", handleDragFinished);\r\n document.addEventListener(\"touchend\", handleDragFinished);\r\n document.addEventListener(\"mousemove\", handleDrag);\r\n document.addEventListener(\"touchmove\", handleDrag);\r\n }\r\n\r\n private handleKeyDown(e: KeyboardEvent): void {\r\n let movementX = 0;\r\n switch (e.key) {\r\n case \"ArrowLeft\":\r\n movementX = -10;\r\n break;\r\n case \"ArrowRight\":\r\n movementX = 10;\r\n break;\r\n default:\r\n return;\r\n }\r\n if (e.shiftKey){\r\n movementX = movementX * 10;\r\n }\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n let newLeft = this.leftWidth + movementX;\r\n if (newLeft < 0){\r\n newLeft = 0;\r\n }\r\n if (newLeft > fullWidth){\r\n newLeft = fullWidth;\r\n }\r\n this.leftWidth = newLeft;\r\n this.rightWidth = fullWidth - this.leftWidth;\r\n }\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div class=\"left pane\" style={{\r\n width: `${this.leftWidth}px`,\r\n }}>\r\n <slot name=\"left\"></slot>\r\n </div>\r\n <button\r\n onMouseDown={e => this.handleMouseDown(e)}\r\n onTouchStart={e => this.handleMouseDown(e)}\r\n onKeyDown={e => this.handleKeyDown(e)}\r\n ref={el => this.splitter = el}\r\n style={{\r\n minWidth: `${this.splitterWidth.toString()}px`,\r\n left: `${this.leftWidth - 2}px`,\r\n }}\r\n >\r\n <slot></slot>\r\n </button>\r\n <div\r\n class=\"right pane\"\r\n style={{\r\n width: `${this.rightWidth}px`,\r\n }}>\r\n <slot name=\"right\"></slot>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"dnn-vertical-splitview.js","sourceRoot":"","sources":["../../../src/components/dnn-vertical-splitview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AAG,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI;UAC9C,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI;SAChC;QAED,eAAa,CACN;MACT,WACE,KAAK,EAAC,YAAY,EAClB,KAAK,EAAE;UACL,KAAK,EAAE,GAAG,IAAI,CAAC,UAAU,IAAI;SAC9B;QACD,YAAM,IAAI,EAAC,OAAO,GAAQ,CACtB,CACH,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, Element, State, Method, Event, EventEmitter } from '@stencil/core';\r\nimport { getMovementFromEvent } from \"../../utilities/mouseUtilities\";\r\n\r\n/**\r\n * @slot default - The split divider control you want to use.\r\n * @slot left - The content of the left pane.\r\n * @slot right - The content of the right pane.\r\n */\r\n@Component({\r\n tag: 'dnn-vertical-splitview',\r\n styleUrl: 'dnn-vertical-splitview.scss',\r\n shadow: true,\r\n})\r\nexport class DnnVerticalSplitview {\r\n\r\n /** The width of the splitter area. */\r\n @Prop() splitterWidth = 16;\r\n\r\n /** The percentage position of the splitter in the container. */\r\n @Prop({mutable: true}) splitWidthPercentage = 30;\r\n \r\n private splitter!: HTMLButtonElement;\r\n\r\n private resizeObserver: ResizeObserver;\r\n\r\n /** Sets the width percentage of the divider */\r\n @Method()\r\n async setSplitWidthPercentage(newWidth: number) {\r\n const panes = this.element.shadowRoot.querySelectorAll(\".pane\");\r\n requestAnimationFrame(() => {\r\n panes.forEach(pane => pane.classList.add(\"transition\"));\r\n this.splitter.classList.add(\"transition\");\r\n requestAnimationFrame(() => {\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n let newLeft = fullWidth * newWidth / 100;\r\n if (newLeft < 0){\r\n newLeft = 0;\r\n }\r\n if (newLeft > fullWidth){\r\n newLeft = fullWidth;\r\n }\r\n this.leftWidth = newLeft;\r\n this.rightWidth = fullWidth - newLeft;\r\n setTimeout(() => {\r\n panes.forEach(pane => pane.classList.remove(\"transition\"));\r\n this.splitter.classList.remove(\"transition\");\r\n }, 300);\r\n });\r\n });\r\n }\r\n\r\n /** Gets the current divider position percentage. */\r\n @Method()\r\n async getSplitWidthPercentage(){\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n return this.leftWidth / fullWidth;\r\n }\r\n\r\n /** Fires when the width of the divider changes. */\r\n @Event() widthChanged: EventEmitter<number>;\r\n\r\n @State() leftWidth = 0;\r\n @State() rightWidth = 0;\r\n\r\n @Element() element : HTMLDnnVerticalSplitviewElement;\r\n \r\n componentDidLoad() {\r\n requestAnimationFrame(() => {\r\n this.resizeObserver = new ResizeObserver(() => {\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n this.leftWidth = fullWidth * this.splitWidthPercentage / 100;\r\n this.rightWidth = fullWidth - this.leftWidth;\r\n this.widthChanged.emit(this.splitWidthPercentage);\r\n });\r\n this.resizeObserver.observe(this.element);\r\n });\r\n }\r\n \r\n private previousTouch: Touch;\r\n\r\n private handleMouseDown(event: MouseEvent | TouchEvent) {\r\n event.preventDefault();\r\n const handleDrag = (ev: MouseEvent | TouchEvent) => {\r\n requestAnimationFrame(() => {\r\n let fullWidth = this.element.getBoundingClientRect().width;\r\n let {movementX} = getMovementFromEvent(ev, this.previousTouch);\r\n let newLeft = this.leftWidth + movementX;\r\n if (newLeft < 0){\r\n newLeft = 0;\r\n }\r\n if (newLeft > fullWidth){\r\n newLeft = fullWidth;\r\n }\r\n this.leftWidth = newLeft;\r\n this.rightWidth = fullWidth - newLeft;\r\n this.splitWidthPercentage = this.leftWidth / fullWidth * 100;\r\n });\r\n }\r\n const handleDragFinished = () => {\r\n document.removeEventListener(\"mousemove\", handleDrag);\r\n document.removeEventListener(\"touchmove\", handleDrag);\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n const newPercentage = this.leftWidth / fullWidth * 100;\r\n this.widthChanged.emit(newPercentage);\r\n };\r\n document.addEventListener(\"mouseup\", handleDragFinished);\r\n document.addEventListener(\"touchend\", handleDragFinished);\r\n document.addEventListener(\"mousemove\", handleDrag);\r\n document.addEventListener(\"touchmove\", handleDrag);\r\n }\r\n\r\n private handleKeyDown(e: KeyboardEvent): void {\r\n let movementX = 0;\r\n switch (e.key) {\r\n case \"ArrowLeft\":\r\n movementX = -10;\r\n break;\r\n case \"ArrowRight\":\r\n movementX = 10;\r\n break;\r\n default:\r\n return;\r\n }\r\n if (e.shiftKey){\r\n movementX = movementX * 10;\r\n }\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n let newLeft = this.leftWidth + movementX;\r\n if (newLeft < 0){\r\n newLeft = 0;\r\n }\r\n if (newLeft > fullWidth){\r\n newLeft = fullWidth;\r\n }\r\n this.leftWidth = newLeft;\r\n this.rightWidth = fullWidth - this.leftWidth;\r\n }\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div class=\"left pane\" style={{\r\n width: `${this.leftWidth}px`,\r\n }}>\r\n <slot name=\"left\"></slot>\r\n </div>\r\n <button\r\n onMouseDown={e => this.handleMouseDown(e)}\r\n onTouchStart={e => this.handleMouseDown(e)}\r\n onKeyDown={e => this.handleKeyDown(e)}\r\n ref={el => this.splitter = el}\r\n style={{\r\n minWidth: `${this.splitterWidth.toString()}px`,\r\n left: `${this.leftWidth - 2}px`,\r\n }}\r\n >\r\n <slot></slot>\r\n </button>\r\n <div\r\n class=\"right pane\"\r\n style={{\r\n width: `${this.rightWidth}px`,\r\n }}>\r\n <slot name=\"right\"></slot>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n}\r\n"]}
@@ -34,7 +34,12 @@ let DnnCollapsible = class {
34
34
  this.updateSize();
35
35
  }
36
36
  else {
37
- this.container.style.maxHeight = "0px";
37
+ requestAnimationFrame(() => {
38
+ this.container.style.maxHeight = `${this.container.scrollHeight}px`;
39
+ requestAnimationFrame(() => {
40
+ this.container.style.maxHeight = "0px";
41
+ });
42
+ });
38
43
  }
39
44
  setTimeout(() => {
40
45
  requestAnimationFrame(() => {
@@ -1 +1 @@
1
- {"file":"dnn-collapsible.entry.esm.js","mappings":";;AAAA,MAAM,iBAAiB,GAAG,sJAAsJ;;ICOnK,cAAc;EAL3B;;;;IAUyB,aAAQ,GAAY,KAAK,CAAC;;IAGzC,uBAAkB,GAAY,GAAG,CAAC;GAsD3C;EAhDC,mBAAmB;IACjB,qBAAqB,CAAC;MACpB,IAAI,CAAC,UAAU,EAAE,CAAC;KACnB,CAAC,CAAA;GACH;;;;EAMD,MAAM,UAAU;IACd,IAAI,IAAI,CAAC,QAAQ,EAAC;MACd,qBAAqB,CAAC;QACpB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC;OACrE,CAAC,CAAC;MACH,UAAU,CAAC;QACT,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;OACzC,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;KAC/B;GACF;EAGD,sBAAsB,CAAC,QAAiB;IACtC,IAAI,QAAQ,EAAC;MACX,IAAI,CAAC,UAAU,EAAE,CAAC;KACnB;SACG;MACF,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;KACxC;IACD,UAAU,CAAC;MACT,qBAAqB,CAAC;QACpB,IAAI,CAAC,2BAA2B,CAAC,IAAI,EAAE,CAAC;OACzC,CAAC,CAAC;KACJ,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;GAC7B;EAID,MAAM;IACJ,QACE,EAAC,IAAI,QACH,WAAK,EAAE,EAAC,WAAW,EAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,IAAI,UAAU,EAAE,GAAG,EAAE,EAAE,IAAI,IAAI,CAAC,SAAS,GAAG,EAAE,IAClF,eAAa,CACX,CACD,EACP;GACH;;;;;;;;;;","names":[],"sources":["./src/components/dnn-collapsible/dnn-collapsible.scss?tag=dnn-collapsible&encapsulation=shadow","./src/components/dnn-collapsible/dnn-collapsible.tsx"],"sourcesContent":[":host {\r\n display: block;\r\n}\r\n#container{\r\n max-height:0;\r\n overflow: hidden;\r\n transition: max-height 300ms ease-in-out;\r\n}","import { Component, Host, h, Prop, Element, Event, EventEmitter, Watch, Listen, Method } from '@stencil/core';\r\n\r\n@Component({\r\n tag: \"dnn-collapsible\",\r\n styleUrl: \"dnn-collapsible.scss\",\r\n shadow: true\r\n})\r\nexport class DnnCollapsible {\r\n\r\n @Element() el: HTMLDnnCollapsibleElement;\r\n\r\n /** Defines if the panel is expanded or not. */\r\n @Prop({reflect: true}) expanded: boolean = false;\r\n\r\n /** Defines the transition time in ms, defaults to 100ms */\r\n @Prop() transitionDuration?: number = 150;\r\n\r\n /** Fires whenever the collapsible height has changed */\r\n @Event({bubbles: true, composed: true}) dnnCollapsibleHeightChanged: EventEmitter<void>;\r\n\r\n @Listen(\"dnnCollapsibleHeightChanged\")\r\n handleHeightChanged(){\r\n requestAnimationFrame(() => {\r\n this.updateSize();\r\n })\r\n }\r\n\r\n /**\r\n * Updates the component height, use to update after a slot content changes.\r\n */\r\n @Method()\r\n async updateSize() {\r\n if (this.expanded){\r\n requestAnimationFrame(() => {\r\n this.container.style.maxHeight = `${this.container.scrollHeight}px`;\r\n });\r\n setTimeout(() => {\r\n this.container.style.maxHeight = \"none\";\r\n }, this.transitionDuration);\r\n }\r\n }\r\n \r\n @Watch(\"expanded\")\r\n handledExpandedChanged(expanded: boolean){\r\n if (expanded){\r\n this.updateSize();\r\n }\r\n else{\r\n this.container.style.maxHeight = \"0px\";\r\n }\r\n setTimeout(() => {\r\n requestAnimationFrame(() => {\r\n this.dnnCollapsibleHeightChanged.emit();\r\n });\r\n }, this.transitionDuration);\r\n }\r\n \r\n private container: HTMLDivElement;\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div id=\"container\" class={this.expanded && \"expanded\"} ref={el => this.container = el}>\r\n <slot></slot>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n\r\n}\r\n"],"version":3}
1
+ {"file":"dnn-collapsible.entry.esm.js","mappings":";;AAAA,MAAM,iBAAiB,GAAG,sJAAsJ;;ICOnK,cAAc;EAL3B;;;;IAUyB,aAAQ,GAAY,KAAK,CAAC;;IAGzC,uBAAkB,GAAY,GAAG,CAAC;GA2D3C;EArDC,mBAAmB;IACjB,qBAAqB,CAAC;MACpB,IAAI,CAAC,UAAU,EAAE,CAAC;KACnB,CAAC,CAAA;GACH;;;;EAMD,MAAM,UAAU;IACd,IAAI,IAAI,CAAC,QAAQ,EAAC;MACd,qBAAqB,CAAC;QACpB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC;OACrE,CAAC,CAAC;MACH,UAAU,CAAC;QACT,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;OACzC,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;KAC/B;GACF;EAGD,sBAAsB,CAAC,QAAiB;IACtC,IAAI,QAAQ,EAAC;MACX,IAAI,CAAC,UAAU,EAAE,CAAC;KACnB;SACG;MACF,qBAAqB,CAAC;QACpB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC;QACpE,qBAAqB,CAAC;UACpB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;SACxC,CAAC,CAAC;OACJ,CAAC,CAAC;KACJ;IACD,UAAU,CAAC;MACT,qBAAqB,CAAC;QACpB,IAAI,CAAC,2BAA2B,CAAC,IAAI,EAAE,CAAC;OACzC,CAAC,CAAC;KACJ,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;GAC7B;EAID,MAAM;IACJ,QACE,EAAC,IAAI,QACH,WAAK,EAAE,EAAC,WAAW,EAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,IAAI,UAAU,EAAE,GAAG,EAAE,EAAE,IAAI,IAAI,CAAC,SAAS,GAAG,EAAE,IAClF,eAAa,CACX,CACD,EACP;GACH;;;;;;;;;;","names":[],"sources":["./src/components/dnn-collapsible/dnn-collapsible.scss?tag=dnn-collapsible&encapsulation=shadow","./src/components/dnn-collapsible/dnn-collapsible.tsx"],"sourcesContent":[":host {\r\n display: block;\r\n}\r\n#container{\r\n max-height:0;\r\n overflow: hidden;\r\n transition: max-height 300ms ease-in-out;\r\n}","import { Component, Host, h, Prop, Element, Event, EventEmitter, Watch, Listen, Method } from '@stencil/core';\r\n\r\n@Component({\r\n tag: \"dnn-collapsible\",\r\n styleUrl: \"dnn-collapsible.scss\",\r\n shadow: true\r\n})\r\nexport class DnnCollapsible {\r\n\r\n @Element() el: HTMLDnnCollapsibleElement;\r\n\r\n /** Defines if the panel is expanded or not. */\r\n @Prop({reflect: true}) expanded: boolean = false;\r\n\r\n /** Defines the transition time in ms, defaults to 100ms */\r\n @Prop() transitionDuration?: number = 150;\r\n\r\n /** Fires whenever the collapsible height has changed */\r\n @Event({bubbles: true, composed: true}) dnnCollapsibleHeightChanged: EventEmitter<void>;\r\n\r\n @Listen(\"dnnCollapsibleHeightChanged\")\r\n handleHeightChanged(){\r\n requestAnimationFrame(() => {\r\n this.updateSize();\r\n })\r\n }\r\n\r\n /**\r\n * Updates the component height, use to update after a slot content changes.\r\n */\r\n @Method()\r\n async updateSize() {\r\n if (this.expanded){\r\n requestAnimationFrame(() => {\r\n this.container.style.maxHeight = `${this.container.scrollHeight}px`;\r\n });\r\n setTimeout(() => {\r\n this.container.style.maxHeight = \"none\";\r\n }, this.transitionDuration);\r\n }\r\n }\r\n \r\n @Watch(\"expanded\")\r\n handledExpandedChanged(expanded: boolean){\r\n if (expanded){\r\n this.updateSize();\r\n }\r\n else{\r\n requestAnimationFrame(() => {\r\n this.container.style.maxHeight = `${this.container.scrollHeight}px`;\r\n requestAnimationFrame(() => {\r\n this.container.style.maxHeight = \"0px\";\r\n });\r\n });\r\n }\r\n setTimeout(() => {\r\n requestAnimationFrame(() => {\r\n this.dnnCollapsibleHeightChanged.emit();\r\n });\r\n }, this.transitionDuration);\r\n }\r\n \r\n private container: HTMLDivElement;\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div id=\"container\" class={this.expanded && \"expanded\"} ref={el => this.container = el}>\r\n <slot></slot>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n\r\n}\r\n"],"version":3}
@@ -1,2 +1,2 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function o(e){try{s(i.next(e))}catch(e){a(e)}}function u(e){try{s(i["throw"](e))}catch(e){a(e)}}function s(e){e.done?n(e.value):r(e.value).then(o,u)}s((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,r,a,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(e){return function(t){return s([e,t])}}function s(o){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(a=o[0]&2?r["return"]:o[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,o[1])).done)return a;if(r=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;r=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1];a=o;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(o);break}if(a[2])n.ops.pop();n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e];r=0}finally{i=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./index-a3a55419.system.js"],(function(e){"use strict";var t,n,i,r,a;return{setters:[function(e){t=e.r;n=e.e;i=e.h;r=e.f;a=e.g}],execute:function(){var o=":host{display:block}#container{max-height:0;overflow:hidden;-webkit-transition:max-height 300ms ease-in-out;transition:max-height 300ms ease-in-out}";var u=e("dnn_collapsible",function(){function e(e){t(this,e);this.dnnCollapsibleHeightChanged=n(this,"dnnCollapsibleHeightChanged",7);this.expanded=false;this.transitionDuration=150}e.prototype.handleHeightChanged=function(){var e=this;requestAnimationFrame((function(){e.updateSize()}))};e.prototype.updateSize=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){if(this.expanded){requestAnimationFrame((function(){e.container.style.maxHeight=e.container.scrollHeight+"px"}));setTimeout((function(){e.container.style.maxHeight="none"}),this.transitionDuration)}return[2]}))}))};e.prototype.handledExpandedChanged=function(e){var t=this;if(e){this.updateSize()}else{this.container.style.maxHeight="0px"}setTimeout((function(){requestAnimationFrame((function(){t.dnnCollapsibleHeightChanged.emit()}))}),this.transitionDuration)};e.prototype.render=function(){var e=this;return i(r,null,i("div",{id:"container",class:this.expanded&&"expanded",ref:function(t){return e.container=t}},i("slot",null)))};Object.defineProperty(e.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{expanded:["handledExpandedChanged"]}},enumerable:false,configurable:true});return e}());u.style=o}}}));
1
+ var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function o(e){try{s(i.next(e))}catch(e){a(e)}}function u(e){try{s(i["throw"](e))}catch(e){a(e)}}function s(e){e.done?n(e.value):r(e.value).then(o,u)}s((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,r,a,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(e){return function(t){return s([e,t])}}function s(o){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(a=o[0]&2?r["return"]:o[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,o[1])).done)return a;if(r=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;r=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1];a=o;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(o);break}if(a[2])n.ops.pop();n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e];r=0}finally{i=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./index-a3a55419.system.js"],(function(e){"use strict";var t,n,i,r,a;return{setters:[function(e){t=e.r;n=e.e;i=e.h;r=e.f;a=e.g}],execute:function(){var o=":host{display:block}#container{max-height:0;overflow:hidden;-webkit-transition:max-height 300ms ease-in-out;transition:max-height 300ms ease-in-out}";var u=e("dnn_collapsible",function(){function e(e){t(this,e);this.dnnCollapsibleHeightChanged=n(this,"dnnCollapsibleHeightChanged",7);this.expanded=false;this.transitionDuration=150}e.prototype.handleHeightChanged=function(){var e=this;requestAnimationFrame((function(){e.updateSize()}))};e.prototype.updateSize=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){if(this.expanded){requestAnimationFrame((function(){e.container.style.maxHeight=e.container.scrollHeight+"px"}));setTimeout((function(){e.container.style.maxHeight="none"}),this.transitionDuration)}return[2]}))}))};e.prototype.handledExpandedChanged=function(e){var t=this;if(e){this.updateSize()}else{requestAnimationFrame((function(){t.container.style.maxHeight=t.container.scrollHeight+"px";requestAnimationFrame((function(){t.container.style.maxHeight="0px"}))}))}setTimeout((function(){requestAnimationFrame((function(){t.dnnCollapsibleHeightChanged.emit()}))}),this.transitionDuration)};e.prototype.render=function(){var e=this;return i(r,null,i("div",{id:"container",class:this.expanded&&"expanded",ref:function(t){return e.container=t}},i("slot",null)))};Object.defineProperty(e.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{expanded:["handledExpandedChanged"]}},enumerable:false,configurable:true});return e}());u.style=o}}}));
2
2
  //# sourceMappingURL=dnn-collapsible.system.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["src/components/dnn-collapsible/dnn-collapsible.scss?tag=dnn-collapsible&encapsulation=shadow","src/components/dnn-collapsible/dnn-collapsible.tsx"],"names":["dnnCollapsibleCss","DnnCollapsible","exports","class_1","hostRef","this","expanded","transitionDuration","prototype","handleHeightChanged","_this","requestAnimationFrame","updateSize","container","style","maxHeight","scrollHeight","setTimeout","handledExpandedChanged","dnnCollapsibleHeightChanged","emit","render","h","Host","id","class","ref","el"],"mappings":"+lDAAA,IAAMA,EAAoB,2JCObC,EAAcC,EAAA,kBAAA,WAL3B,SAAAC,EAAAC,sFAUyBC,KAAAC,SAAoB,MAGnCD,KAAAE,mBAA8B,IAMtCJ,EAAAK,UAAAC,oBAAA,WAAA,IAAAC,EAAAL,KACEM,uBAAsB,WACpBD,EAAKE,iBAQHT,EAAAK,UAAAI,WAAN,2GACE,GAAIP,KAAKC,SAAS,CACdK,uBAAsB,WACpBD,EAAKG,UAAUC,MAAMC,UAAeL,EAAKG,UAAUG,aAAY,QAEjEC,YAAW,WACTP,EAAKG,UAAUC,MAAMC,UAAY,SAChCV,KAAKE,qCAKdJ,EAAAK,UAAAU,uBAAA,SAAuBZ,GAAvB,IAAAI,EAAAL,KACE,GAAIC,EAAS,CACXD,KAAKO,iBAEH,CACFP,KAAKQ,UAAUC,MAAMC,UAAY,MAEnCE,YAAW,WACTN,uBAAsB,WACpBD,EAAKS,4BAA4BC,YAElCf,KAAKE,qBAKVJ,EAAAK,UAAAa,OAAA,WAAA,IAAAX,EAAAL,KACE,OACEiB,EAACC,EAAI,KACHD,EAAA,MAAA,CAAKE,GAAG,YAAYC,MAAOpB,KAAKC,UAAY,WAAYoB,IAAK,SAAAC,GAAM,OAAAjB,EAAKG,UAAYc,IAChFL,EAAA,OAAA,mQAxDe","sourcesContent":[":host {\r\n display: block;\r\n}\r\n#container{\r\n max-height:0;\r\n overflow: hidden;\r\n transition: max-height 300ms ease-in-out;\r\n}","import { Component, Host, h, Prop, Element, Event, EventEmitter, Watch, Listen, Method } from '@stencil/core';\r\n\r\n@Component({\r\n tag: \"dnn-collapsible\",\r\n styleUrl: \"dnn-collapsible.scss\",\r\n shadow: true\r\n})\r\nexport class DnnCollapsible {\r\n\r\n @Element() el: HTMLDnnCollapsibleElement;\r\n\r\n /** Defines if the panel is expanded or not. */\r\n @Prop({reflect: true}) expanded: boolean = false;\r\n\r\n /** Defines the transition time in ms, defaults to 100ms */\r\n @Prop() transitionDuration?: number = 150;\r\n\r\n /** Fires whenever the collapsible height has changed */\r\n @Event({bubbles: true, composed: true}) dnnCollapsibleHeightChanged: EventEmitter<void>;\r\n\r\n @Listen(\"dnnCollapsibleHeightChanged\")\r\n handleHeightChanged(){\r\n requestAnimationFrame(() => {\r\n this.updateSize();\r\n })\r\n }\r\n\r\n /**\r\n * Updates the component height, use to update after a slot content changes.\r\n */\r\n @Method()\r\n async updateSize() {\r\n if (this.expanded){\r\n requestAnimationFrame(() => {\r\n this.container.style.maxHeight = `${this.container.scrollHeight}px`;\r\n });\r\n setTimeout(() => {\r\n this.container.style.maxHeight = \"none\";\r\n }, this.transitionDuration);\r\n }\r\n }\r\n \r\n @Watch(\"expanded\")\r\n handledExpandedChanged(expanded: boolean){\r\n if (expanded){\r\n this.updateSize();\r\n }\r\n else{\r\n this.container.style.maxHeight = \"0px\";\r\n }\r\n setTimeout(() => {\r\n requestAnimationFrame(() => {\r\n this.dnnCollapsibleHeightChanged.emit();\r\n });\r\n }, this.transitionDuration);\r\n }\r\n \r\n private container: HTMLDivElement;\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div id=\"container\" class={this.expanded && \"expanded\"} ref={el => this.container = el}>\r\n <slot></slot>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n\r\n}\r\n"]}
1
+ {"version":3,"sources":["src/components/dnn-collapsible/dnn-collapsible.scss?tag=dnn-collapsible&encapsulation=shadow","src/components/dnn-collapsible/dnn-collapsible.tsx"],"names":["dnnCollapsibleCss","DnnCollapsible","exports","class_1","hostRef","this","expanded","transitionDuration","prototype","handleHeightChanged","_this","requestAnimationFrame","updateSize","container","style","maxHeight","scrollHeight","setTimeout","handledExpandedChanged","dnnCollapsibleHeightChanged","emit","render","h","Host","id","class","ref","el"],"mappings":"+lDAAA,IAAMA,EAAoB,2JCObC,EAAcC,EAAA,kBAAA,WAL3B,SAAAC,EAAAC,sFAUyBC,KAAAC,SAAoB,MAGnCD,KAAAE,mBAA8B,IAMtCJ,EAAAK,UAAAC,oBAAA,WAAA,IAAAC,EAAAL,KACEM,uBAAsB,WACpBD,EAAKE,iBAQHT,EAAAK,UAAAI,WAAN,2GACE,GAAIP,KAAKC,SAAS,CACdK,uBAAsB,WACpBD,EAAKG,UAAUC,MAAMC,UAAeL,EAAKG,UAAUG,aAAY,QAEjEC,YAAW,WACTP,EAAKG,UAAUC,MAAMC,UAAY,SAChCV,KAAKE,qCAKdJ,EAAAK,UAAAU,uBAAA,SAAuBZ,GAAvB,IAAAI,EAAAL,KACE,GAAIC,EAAS,CACXD,KAAKO,iBAEH,CACFD,uBAAsB,WACpBD,EAAKG,UAAUC,MAAMC,UAAeL,EAAKG,UAAUG,aAAY,KAC/DL,uBAAsB,WACpBD,EAAKG,UAAUC,MAAMC,UAAY,YAIvCE,YAAW,WACTN,uBAAsB,WACpBD,EAAKS,4BAA4BC,YAElCf,KAAKE,qBAKVJ,EAAAK,UAAAa,OAAA,WAAA,IAAAX,EAAAL,KACE,OACEiB,EAACC,EAAI,KACHD,EAAA,MAAA,CAAKE,GAAG,YAAYC,MAAOpB,KAAKC,UAAY,WAAYoB,IAAK,SAAAC,GAAM,OAAAjB,EAAKG,UAAYc,IAChFL,EAAA,OAAA,mQA7De","sourcesContent":[":host {\r\n display: block;\r\n}\r\n#container{\r\n max-height:0;\r\n overflow: hidden;\r\n transition: max-height 300ms ease-in-out;\r\n}","import { Component, Host, h, Prop, Element, Event, EventEmitter, Watch, Listen, Method } from '@stencil/core';\r\n\r\n@Component({\r\n tag: \"dnn-collapsible\",\r\n styleUrl: \"dnn-collapsible.scss\",\r\n shadow: true\r\n})\r\nexport class DnnCollapsible {\r\n\r\n @Element() el: HTMLDnnCollapsibleElement;\r\n\r\n /** Defines if the panel is expanded or not. */\r\n @Prop({reflect: true}) expanded: boolean = false;\r\n\r\n /** Defines the transition time in ms, defaults to 100ms */\r\n @Prop() transitionDuration?: number = 150;\r\n\r\n /** Fires whenever the collapsible height has changed */\r\n @Event({bubbles: true, composed: true}) dnnCollapsibleHeightChanged: EventEmitter<void>;\r\n\r\n @Listen(\"dnnCollapsibleHeightChanged\")\r\n handleHeightChanged(){\r\n requestAnimationFrame(() => {\r\n this.updateSize();\r\n })\r\n }\r\n\r\n /**\r\n * Updates the component height, use to update after a slot content changes.\r\n */\r\n @Method()\r\n async updateSize() {\r\n if (this.expanded){\r\n requestAnimationFrame(() => {\r\n this.container.style.maxHeight = `${this.container.scrollHeight}px`;\r\n });\r\n setTimeout(() => {\r\n this.container.style.maxHeight = \"none\";\r\n }, this.transitionDuration);\r\n }\r\n }\r\n \r\n @Watch(\"expanded\")\r\n handledExpandedChanged(expanded: boolean){\r\n if (expanded){\r\n this.updateSize();\r\n }\r\n else{\r\n requestAnimationFrame(() => {\r\n this.container.style.maxHeight = `${this.container.scrollHeight}px`;\r\n requestAnimationFrame(() => {\r\n this.container.style.maxHeight = \"0px\";\r\n });\r\n });\r\n }\r\n setTimeout(() => {\r\n requestAnimationFrame(() => {\r\n this.dnnCollapsibleHeightChanged.emit();\r\n });\r\n }, this.transitionDuration);\r\n }\r\n \r\n private container: HTMLDivElement;\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div id=\"container\" class={this.expanded && \"expanded\"} ref={el => this.container = el}>\r\n <slot></slot>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n\r\n}\r\n"]}