panel.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866
  1. /*!
  2. * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  3. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
  4. * v1.0.0-beta.97
  5. */
  6. import { h, Fragment } from "@stencil/core";
  7. import { CSS, HEADING_LEVEL, ICONS, SLOTS, TEXT } from "./resources";
  8. import { getElementDir, toAriaBoolean } from "../../utils/dom";
  9. import { Heading } from "../functional/Heading";
  10. import { SLOTS as ACTION_MENU_SLOTS } from "../action-menu/resources";
  11. import { updateHostInteraction } from "../../utils/interactive";
  12. import { createObserver } from "../../utils/observers";
  13. /**
  14. * @slot - A slot for adding custom content.
  15. * @slot header-actions-start - A slot for adding actions or content to the start side of the header.
  16. * @slot header-actions-end - A slot for adding actions or content to the end side of the header.
  17. * @slot header-content - A slot for adding custom content to the header.
  18. * @slot header-menu-actions - A slot for adding an overflow menu with actions inside a `calcite-dropdown`.
  19. * @slot fab - A slot for adding a `calcite-fab` (floating action button) to perform an action.
  20. * @slot footer-actions - A slot for adding buttons to the footer.
  21. * @slot footer - A slot for adding custom content to the footer.
  22. */
  23. export class Panel {
  24. constructor() {
  25. // --------------------------------------------------------------------------
  26. //
  27. // Properties
  28. //
  29. // --------------------------------------------------------------------------
  30. /**
  31. * When `true`, hides the component.
  32. *
  33. * @deprecated use `closed` instead.
  34. */
  35. this.dismissed = false;
  36. /** When `true`, the component will be hidden. */
  37. this.closed = false;
  38. /**
  39. * When `true`, interaction is prevented and the component is displayed with lower opacity.
  40. */
  41. this.disabled = false;
  42. /**
  43. * When `true`, a close button is added to the component.
  44. *
  45. * @deprecated use `closable` instead
  46. */
  47. this.dismissible = false;
  48. /** When `true`, displays a close button in the trailing side of the header. */
  49. this.closable = false;
  50. /**
  51. * When `true`, displays a back button in the header.
  52. *
  53. * @deprecated use `calcite-flow-item` instead.
  54. */
  55. this.showBackButton = false;
  56. /**
  57. * When `true`, a busy indicator is displayed.
  58. */
  59. this.loading = false;
  60. /**
  61. * When `true`, the action menu items in the `header-menu-actions` slot are open.
  62. */
  63. this.menuOpen = false;
  64. this.resizeObserver = createObserver("resize", () => this.resizeHandler());
  65. this.hasStartActions = false;
  66. this.hasEndActions = false;
  67. this.hasMenuItems = false;
  68. this.hasHeaderContent = false;
  69. this.hasFooterContent = false;
  70. this.hasFooterActions = false;
  71. this.hasFab = false;
  72. // --------------------------------------------------------------------------
  73. //
  74. // Private Methods
  75. //
  76. // --------------------------------------------------------------------------
  77. this.resizeHandler = () => {
  78. const { panelScrollEl } = this;
  79. if (!panelScrollEl ||
  80. typeof panelScrollEl.scrollHeight !== "number" ||
  81. typeof panelScrollEl.offsetHeight !== "number") {
  82. return;
  83. }
  84. panelScrollEl.tabIndex = panelScrollEl.scrollHeight > panelScrollEl.offsetHeight ? 0 : -1;
  85. };
  86. this.setContainerRef = (node) => {
  87. this.containerEl = node;
  88. };
  89. this.setCloseRef = (node) => {
  90. this.closeButtonEl = node;
  91. };
  92. this.setBackRef = (node) => {
  93. this.backButtonEl = node;
  94. };
  95. this.panelKeyDownHandler = (event) => {
  96. if (this.closable && event.key === "Escape" && !event.defaultPrevented) {
  97. this.close();
  98. event.preventDefault();
  99. }
  100. };
  101. this.close = () => {
  102. this.closed = true;
  103. this.calcitePanelDismiss.emit();
  104. this.calcitePanelClose.emit();
  105. };
  106. this.panelScrollHandler = () => {
  107. this.calcitePanelScroll.emit();
  108. };
  109. this.backButtonClick = () => {
  110. this.calcitePanelBackClick.emit();
  111. };
  112. this.handleHeaderActionsStartSlotChange = (event) => {
  113. const elements = event.target.assignedElements({
  114. flatten: true
  115. });
  116. this.hasStartActions = !!elements.length;
  117. };
  118. this.handleHeaderActionsEndSlotChange = (event) => {
  119. const elements = event.target.assignedElements({
  120. flatten: true
  121. });
  122. this.hasEndActions = !!elements.length;
  123. };
  124. this.handleHeaderMenuActionsSlotChange = (event) => {
  125. const elements = event.target.assignedElements({
  126. flatten: true
  127. });
  128. this.hasMenuItems = !!elements.length;
  129. };
  130. this.handleHeaderContentSlotChange = (event) => {
  131. const elements = event.target.assignedElements({
  132. flatten: true
  133. });
  134. this.hasHeaderContent = !!elements.length;
  135. };
  136. this.handleFooterSlotChange = (event) => {
  137. const elements = event.target.assignedElements({
  138. flatten: true
  139. });
  140. this.hasFooterContent = !!elements.length;
  141. };
  142. this.handleFooterActionsSlotChange = (event) => {
  143. const elements = event.target.assignedElements({
  144. flatten: true
  145. });
  146. this.hasFooterActions = !!elements.length;
  147. };
  148. this.handleFabSlotChange = (event) => {
  149. const elements = event.target.assignedElements({
  150. flatten: true
  151. });
  152. this.hasFab = !!elements.length;
  153. };
  154. this.setPanelScrollEl = (el) => {
  155. var _a, _b;
  156. this.panelScrollEl = el;
  157. (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
  158. if (el) {
  159. (_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.observe(el);
  160. this.resizeHandler();
  161. }
  162. };
  163. }
  164. dismissedHandler(value) {
  165. this.closed = value;
  166. this.calcitePanelDismissedChange.emit();
  167. }
  168. closedHandler(value) {
  169. this.dismissed = value;
  170. }
  171. dismissibleHandler(value) {
  172. this.closable = value;
  173. }
  174. closableHandler(value) {
  175. this.dismissible = value;
  176. }
  177. //--------------------------------------------------------------------------
  178. //
  179. // Lifecycle
  180. //
  181. //--------------------------------------------------------------------------
  182. componentDidRender() {
  183. updateHostInteraction(this);
  184. }
  185. // --------------------------------------------------------------------------
  186. //
  187. // Lifecycle
  188. //
  189. // --------------------------------------------------------------------------
  190. connectedCallback() {
  191. const isClosed = this.dismissed || this.closed;
  192. const isClosable = this.dismissible || this.closable;
  193. if (isClosed) {
  194. this.dismissedHandler(isClosed);
  195. this.closedHandler(isClosed);
  196. }
  197. if (isClosable) {
  198. this.dismissibleHandler(isClosable);
  199. this.closableHandler(isClosable);
  200. }
  201. }
  202. disconnectedCallback() {
  203. var _a;
  204. (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
  205. }
  206. // --------------------------------------------------------------------------
  207. //
  208. // Methods
  209. //
  210. // --------------------------------------------------------------------------
  211. /**
  212. * Sets focus on the component.
  213. *
  214. * @param focusId
  215. */
  216. async setFocus(focusId) {
  217. const { backButtonEl, closeButtonEl, containerEl } = this;
  218. if (focusId === "back-button") {
  219. backButtonEl === null || backButtonEl === void 0 ? void 0 : backButtonEl.setFocus();
  220. return;
  221. }
  222. if (focusId === "dismiss-button") {
  223. closeButtonEl === null || closeButtonEl === void 0 ? void 0 : closeButtonEl.setFocus();
  224. return;
  225. }
  226. if (backButtonEl) {
  227. backButtonEl.setFocus();
  228. return;
  229. }
  230. if (closeButtonEl) {
  231. closeButtonEl.setFocus();
  232. return;
  233. }
  234. containerEl === null || containerEl === void 0 ? void 0 : containerEl.focus();
  235. }
  236. /**
  237. * Scrolls the component's content to a specified set of coordinates.
  238. *
  239. * @example
  240. * myCalciteFlowItem.scrollContentTo({
  241. * left: 0, // Specifies the number of pixels along the X axis to scroll the window or element.
  242. * top: 0, // Specifies the number of pixels along the Y axis to scroll the window or element
  243. * behavior: "auto" // Specifies whether the scrolling should animate smoothly (smooth), or happen instantly in a single jump (auto, the default value).
  244. * });
  245. * @param options
  246. */
  247. async scrollContentTo(options) {
  248. var _a;
  249. (_a = this.panelScrollEl) === null || _a === void 0 ? void 0 : _a.scrollTo(options);
  250. }
  251. // --------------------------------------------------------------------------
  252. //
  253. // Render Methods
  254. //
  255. // --------------------------------------------------------------------------
  256. renderBackButton() {
  257. const { el } = this;
  258. const rtl = getElementDir(el) === "rtl";
  259. const { showBackButton, intlBack, backButtonClick } = this;
  260. const label = intlBack || TEXT.back;
  261. const icon = rtl ? ICONS.backRight : ICONS.backLeft;
  262. return showBackButton ? (h("calcite-action", { "aria-label": label, class: CSS.backButton, icon: icon, key: "back-button", onClick: backButtonClick, ref: this.setBackRef, scale: "s", slot: SLOTS.headerActionsStart, text: label })) : null;
  263. }
  264. renderHeaderContent() {
  265. const { heading, headingLevel, summary, description, hasHeaderContent } = this;
  266. const headingNode = heading ? (h(Heading, { class: CSS.heading, level: headingLevel || HEADING_LEVEL }, heading)) : null;
  267. const descriptionNode = description || summary ? h("span", { class: CSS.description }, description || summary) : null;
  268. return !hasHeaderContent && (headingNode || descriptionNode) ? (h("div", { class: CSS.headerContent, key: "header-content" }, headingNode, descriptionNode)) : null;
  269. }
  270. /**
  271. * Allows user to override the entire header-content node.
  272. */
  273. renderHeaderSlottedContent() {
  274. return (h("div", { class: CSS.headerContent, hidden: !this.hasHeaderContent, key: "slotted-header-content" }, h("slot", { name: SLOTS.headerContent, onSlotchange: this.handleHeaderContentSlotChange })));
  275. }
  276. renderHeaderStartActions() {
  277. const { hasStartActions } = this;
  278. return (h("div", { class: { [CSS.headerActionsStart]: true, [CSS.headerActions]: true }, hidden: !hasStartActions, key: "header-actions-start" }, h("slot", { name: SLOTS.headerActionsStart, onSlotchange: this.handleHeaderActionsStartSlotChange })));
  279. }
  280. renderHeaderActionsEnd() {
  281. const { close, hasEndActions, intlClose, closable } = this;
  282. const text = intlClose || TEXT.close;
  283. const closableNode = closable ? (h("calcite-action", { "aria-label": text, icon: ICONS.close, onClick: close, ref: this.setCloseRef, text: text })) : null;
  284. const slotNode = (h("slot", { name: SLOTS.headerActionsEnd, onSlotchange: this.handleHeaderActionsEndSlotChange }));
  285. const showContainer = hasEndActions || closableNode;
  286. return (h("div", { class: { [CSS.headerActionsEnd]: true, [CSS.headerActions]: true }, hidden: !showContainer, key: "header-actions-end" }, slotNode, closableNode));
  287. }
  288. renderMenu() {
  289. const { hasMenuItems, intlOptions, menuOpen } = this;
  290. return (h("calcite-action-menu", { flipPlacements: ["top", "bottom"], hidden: !hasMenuItems, key: "menu", label: intlOptions || TEXT.options, open: menuOpen, placement: "bottom-end" }, h("calcite-action", { icon: ICONS.menu, slot: ACTION_MENU_SLOTS.trigger, text: intlOptions || TEXT.options }), h("slot", { name: SLOTS.headerMenuActions, onSlotchange: this.handleHeaderMenuActionsSlotChange })));
  291. }
  292. renderHeaderNode() {
  293. const { showBackButton, hasHeaderContent, hasStartActions, hasEndActions, closable, hasMenuItems } = this;
  294. const headerContentNode = this.renderHeaderContent();
  295. const showHeader = showBackButton ||
  296. hasHeaderContent ||
  297. headerContentNode ||
  298. hasStartActions ||
  299. hasEndActions ||
  300. closable ||
  301. hasMenuItems;
  302. return (h("header", { class: CSS.header, hidden: !showHeader }, this.renderBackButton(), this.renderHeaderStartActions(), this.renderHeaderSlottedContent(), headerContentNode, this.renderHeaderActionsEnd(), this.renderMenu()));
  303. }
  304. renderFooterNode() {
  305. const { hasFooterContent, hasFooterActions } = this;
  306. const showFooter = hasFooterContent || hasFooterActions;
  307. return (h("footer", { class: CSS.footer, hidden: !showFooter }, h("slot", { key: "footer-slot", name: SLOTS.footer, onSlotchange: this.handleFooterSlotChange }), h("slot", { key: "footer-actions-slot", name: SLOTS.footerActions, onSlotchange: this.handleFooterActionsSlotChange })));
  308. }
  309. renderContent() {
  310. const { hasFab } = this;
  311. const defaultSlotNode = h("slot", { key: "default-slot" });
  312. const containerNode = hasFab ? (h("section", { class: CSS.contentContainer }, defaultSlotNode)) : (defaultSlotNode);
  313. return (h("div", { class: {
  314. [CSS.contentWrapper]: true,
  315. [CSS.contentContainer]: !hasFab,
  316. [CSS.contentHeight]: hasFab
  317. }, onScroll: this.panelScrollHandler, ref: this.setPanelScrollEl }, containerNode, this.renderFab()));
  318. }
  319. renderFab() {
  320. return (h("div", { class: CSS.fabContainer, hidden: !this.hasFab }, h("slot", { name: SLOTS.fab, onSlotchange: this.handleFabSlotChange })));
  321. }
  322. render() {
  323. const { loading, panelKeyDownHandler, closed, closable } = this;
  324. const panelNode = (h("article", { "aria-busy": toAriaBoolean(loading), class: CSS.container, hidden: closed, onKeyDown: panelKeyDownHandler, ref: this.setContainerRef, tabIndex: closable ? 0 : -1 }, this.renderHeaderNode(), this.renderContent(), this.renderFooterNode()));
  325. return (h(Fragment, null, loading ? h("calcite-scrim", { loading: loading }) : null, panelNode));
  326. }
  327. static get is() { return "calcite-panel"; }
  328. static get encapsulation() { return "shadow"; }
  329. static get originalStyleUrls() {
  330. return {
  331. "$": ["panel.scss"]
  332. };
  333. }
  334. static get styleUrls() {
  335. return {
  336. "$": ["panel.css"]
  337. };
  338. }
  339. static get properties() {
  340. return {
  341. "dismissed": {
  342. "type": "boolean",
  343. "mutable": true,
  344. "complexType": {
  345. "original": "boolean",
  346. "resolved": "boolean",
  347. "references": {}
  348. },
  349. "required": false,
  350. "optional": false,
  351. "docs": {
  352. "tags": [{
  353. "name": "deprecated",
  354. "text": "use `closed` instead."
  355. }],
  356. "text": "When `true`, hides the component."
  357. },
  358. "attribute": "dismissed",
  359. "reflect": true,
  360. "defaultValue": "false"
  361. },
  362. "closed": {
  363. "type": "boolean",
  364. "mutable": true,
  365. "complexType": {
  366. "original": "boolean",
  367. "resolved": "boolean",
  368. "references": {}
  369. },
  370. "required": false,
  371. "optional": false,
  372. "docs": {
  373. "tags": [],
  374. "text": "When `true`, the component will be hidden."
  375. },
  376. "attribute": "closed",
  377. "reflect": true,
  378. "defaultValue": "false"
  379. },
  380. "beforeBack": {
  381. "type": "unknown",
  382. "mutable": false,
  383. "complexType": {
  384. "original": "() => Promise<void>",
  385. "resolved": "() => Promise<void>",
  386. "references": {
  387. "Promise": {
  388. "location": "global"
  389. }
  390. }
  391. },
  392. "required": false,
  393. "optional": true,
  394. "docs": {
  395. "tags": [{
  396. "name": "deprecated",
  397. "text": "use `calcite-flow-item` instead."
  398. }],
  399. "text": "When provided, this method will be called before it is removed from the parent flow."
  400. }
  401. },
  402. "disabled": {
  403. "type": "boolean",
  404. "mutable": false,
  405. "complexType": {
  406. "original": "boolean",
  407. "resolved": "boolean",
  408. "references": {}
  409. },
  410. "required": false,
  411. "optional": false,
  412. "docs": {
  413. "tags": [],
  414. "text": "When `true`, interaction is prevented and the component is displayed with lower opacity."
  415. },
  416. "attribute": "disabled",
  417. "reflect": true,
  418. "defaultValue": "false"
  419. },
  420. "dismissible": {
  421. "type": "boolean",
  422. "mutable": true,
  423. "complexType": {
  424. "original": "boolean",
  425. "resolved": "boolean",
  426. "references": {}
  427. },
  428. "required": false,
  429. "optional": false,
  430. "docs": {
  431. "tags": [{
  432. "name": "deprecated",
  433. "text": "use `closable` instead"
  434. }],
  435. "text": "When `true`, a close button is added to the component."
  436. },
  437. "attribute": "dismissible",
  438. "reflect": true,
  439. "defaultValue": "false"
  440. },
  441. "closable": {
  442. "type": "boolean",
  443. "mutable": true,
  444. "complexType": {
  445. "original": "boolean",
  446. "resolved": "boolean",
  447. "references": {}
  448. },
  449. "required": false,
  450. "optional": false,
  451. "docs": {
  452. "tags": [],
  453. "text": "When `true`, displays a close button in the trailing side of the header."
  454. },
  455. "attribute": "closable",
  456. "reflect": true,
  457. "defaultValue": "false"
  458. },
  459. "headingLevel": {
  460. "type": "number",
  461. "mutable": false,
  462. "complexType": {
  463. "original": "HeadingLevel",
  464. "resolved": "1 | 2 | 3 | 4 | 5 | 6",
  465. "references": {
  466. "HeadingLevel": {
  467. "location": "import",
  468. "path": "../functional/Heading"
  469. }
  470. }
  471. },
  472. "required": false,
  473. "optional": false,
  474. "docs": {
  475. "tags": [],
  476. "text": "Specifies the number at which section headings should start."
  477. },
  478. "attribute": "heading-level",
  479. "reflect": true
  480. },
  481. "showBackButton": {
  482. "type": "boolean",
  483. "mutable": false,
  484. "complexType": {
  485. "original": "boolean",
  486. "resolved": "boolean",
  487. "references": {}
  488. },
  489. "required": false,
  490. "optional": false,
  491. "docs": {
  492. "tags": [{
  493. "name": "deprecated",
  494. "text": "use `calcite-flow-item` instead."
  495. }],
  496. "text": "When `true`, displays a back button in the header."
  497. },
  498. "attribute": "show-back-button",
  499. "reflect": true,
  500. "defaultValue": "false"
  501. },
  502. "intlBack": {
  503. "type": "string",
  504. "mutable": false,
  505. "complexType": {
  506. "original": "string",
  507. "resolved": "string",
  508. "references": {}
  509. },
  510. "required": false,
  511. "optional": true,
  512. "docs": {
  513. "tags": [{
  514. "name": "deprecated",
  515. "text": "use `calcite-flow-item` instead."
  516. }],
  517. "text": "Accessible name for the component's back button. The back button will only be shown when `showBackButton` is `true`."
  518. },
  519. "attribute": "intl-back",
  520. "reflect": false
  521. },
  522. "heightScale": {
  523. "type": "string",
  524. "mutable": false,
  525. "complexType": {
  526. "original": "Scale",
  527. "resolved": "\"l\" | \"m\" | \"s\"",
  528. "references": {
  529. "Scale": {
  530. "location": "import",
  531. "path": "../interfaces"
  532. }
  533. }
  534. },
  535. "required": false,
  536. "optional": true,
  537. "docs": {
  538. "tags": [],
  539. "text": "Specifies the maximum height of the component."
  540. },
  541. "attribute": "height-scale",
  542. "reflect": true
  543. },
  544. "widthScale": {
  545. "type": "string",
  546. "mutable": false,
  547. "complexType": {
  548. "original": "Scale",
  549. "resolved": "\"l\" | \"m\" | \"s\"",
  550. "references": {
  551. "Scale": {
  552. "location": "import",
  553. "path": "../interfaces"
  554. }
  555. }
  556. },
  557. "required": false,
  558. "optional": true,
  559. "docs": {
  560. "tags": [],
  561. "text": "Specifies the width of the component."
  562. },
  563. "attribute": "width-scale",
  564. "reflect": true
  565. },
  566. "loading": {
  567. "type": "boolean",
  568. "mutable": false,
  569. "complexType": {
  570. "original": "boolean",
  571. "resolved": "boolean",
  572. "references": {}
  573. },
  574. "required": false,
  575. "optional": false,
  576. "docs": {
  577. "tags": [],
  578. "text": "When `true`, a busy indicator is displayed."
  579. },
  580. "attribute": "loading",
  581. "reflect": true,
  582. "defaultValue": "false"
  583. },
  584. "intlClose": {
  585. "type": "string",
  586. "mutable": false,
  587. "complexType": {
  588. "original": "string",
  589. "resolved": "string",
  590. "references": {}
  591. },
  592. "required": false,
  593. "optional": true,
  594. "docs": {
  595. "tags": [],
  596. "text": "Accessible name for the component's close button. The close button will only be shown when `closeable` is `true`."
  597. },
  598. "attribute": "intl-close",
  599. "reflect": false
  600. },
  601. "intlOptions": {
  602. "type": "string",
  603. "mutable": false,
  604. "complexType": {
  605. "original": "string",
  606. "resolved": "string",
  607. "references": {}
  608. },
  609. "required": false,
  610. "optional": true,
  611. "docs": {
  612. "tags": [],
  613. "text": "Accessible name for the component's actions menu."
  614. },
  615. "attribute": "intl-options",
  616. "reflect": false
  617. },
  618. "heading": {
  619. "type": "string",
  620. "mutable": false,
  621. "complexType": {
  622. "original": "string",
  623. "resolved": "string",
  624. "references": {}
  625. },
  626. "required": false,
  627. "optional": true,
  628. "docs": {
  629. "tags": [],
  630. "text": "The component header text."
  631. },
  632. "attribute": "heading",
  633. "reflect": false
  634. },
  635. "summary": {
  636. "type": "string",
  637. "mutable": false,
  638. "complexType": {
  639. "original": "string",
  640. "resolved": "string",
  641. "references": {}
  642. },
  643. "required": false,
  644. "optional": true,
  645. "docs": {
  646. "tags": [{
  647. "name": "deprecated",
  648. "text": "use `description` instead."
  649. }],
  650. "text": "Summary text. A description displayed underneath the heading."
  651. },
  652. "attribute": "summary",
  653. "reflect": false
  654. },
  655. "description": {
  656. "type": "string",
  657. "mutable": false,
  658. "complexType": {
  659. "original": "string",
  660. "resolved": "string",
  661. "references": {}
  662. },
  663. "required": false,
  664. "optional": false,
  665. "docs": {
  666. "tags": [],
  667. "text": "A description for the component."
  668. },
  669. "attribute": "description",
  670. "reflect": false
  671. },
  672. "menuOpen": {
  673. "type": "boolean",
  674. "mutable": false,
  675. "complexType": {
  676. "original": "boolean",
  677. "resolved": "boolean",
  678. "references": {}
  679. },
  680. "required": false,
  681. "optional": false,
  682. "docs": {
  683. "tags": [],
  684. "text": "When `true`, the action menu items in the `header-menu-actions` slot are open."
  685. },
  686. "attribute": "menu-open",
  687. "reflect": true,
  688. "defaultValue": "false"
  689. }
  690. };
  691. }
  692. static get states() {
  693. return {
  694. "hasStartActions": {},
  695. "hasEndActions": {},
  696. "hasMenuItems": {},
  697. "hasHeaderContent": {},
  698. "hasFooterContent": {},
  699. "hasFooterActions": {},
  700. "hasFab": {}
  701. };
  702. }
  703. static get events() {
  704. return [{
  705. "method": "calcitePanelClose",
  706. "name": "calcitePanelClose",
  707. "bubbles": true,
  708. "cancelable": false,
  709. "composed": true,
  710. "docs": {
  711. "tags": [],
  712. "text": "Fires when the close button is clicked."
  713. },
  714. "complexType": {
  715. "original": "void",
  716. "resolved": "void",
  717. "references": {}
  718. }
  719. }, {
  720. "method": "calcitePanelDismiss",
  721. "name": "calcitePanelDismiss",
  722. "bubbles": true,
  723. "cancelable": false,
  724. "composed": true,
  725. "docs": {
  726. "tags": [{
  727. "name": "deprecated",
  728. "text": "use `calcitePanelClose` instead."
  729. }],
  730. "text": "Fires when the close button is clicked."
  731. },
  732. "complexType": {
  733. "original": "void",
  734. "resolved": "void",
  735. "references": {}
  736. }
  737. }, {
  738. "method": "calcitePanelDismissedChange",
  739. "name": "calcitePanelDismissedChange",
  740. "bubbles": true,
  741. "cancelable": false,
  742. "composed": true,
  743. "docs": {
  744. "tags": [{
  745. "name": "deprecated",
  746. "text": "use `calcitePanelClose` instead."
  747. }],
  748. "text": "Fires when there is a change to the `dismissed` property value ."
  749. },
  750. "complexType": {
  751. "original": "void",
  752. "resolved": "void",
  753. "references": {}
  754. }
  755. }, {
  756. "method": "calcitePanelScroll",
  757. "name": "calcitePanelScroll",
  758. "bubbles": true,
  759. "cancelable": false,
  760. "composed": true,
  761. "docs": {
  762. "tags": [],
  763. "text": "Fires when the content is scrolled."
  764. },
  765. "complexType": {
  766. "original": "void",
  767. "resolved": "void",
  768. "references": {}
  769. }
  770. }, {
  771. "method": "calcitePanelBackClick",
  772. "name": "calcitePanelBackClick",
  773. "bubbles": true,
  774. "cancelable": false,
  775. "composed": true,
  776. "docs": {
  777. "tags": [{
  778. "name": "deprecated",
  779. "text": "use `calcite-flow-item` instead."
  780. }],
  781. "text": "Fires when the back button is clicked."
  782. },
  783. "complexType": {
  784. "original": "void",
  785. "resolved": "void",
  786. "references": {}
  787. }
  788. }];
  789. }
  790. static get methods() {
  791. return {
  792. "setFocus": {
  793. "complexType": {
  794. "signature": "(focusId?: \"back-button\" | \"dismiss-button\") => Promise<void>",
  795. "parameters": [{
  796. "tags": [{
  797. "name": "param",
  798. "text": "focusId"
  799. }],
  800. "text": ""
  801. }],
  802. "references": {
  803. "Promise": {
  804. "location": "global"
  805. }
  806. },
  807. "return": "Promise<void>"
  808. },
  809. "docs": {
  810. "text": "Sets focus on the component.",
  811. "tags": [{
  812. "name": "param",
  813. "text": "focusId"
  814. }]
  815. }
  816. },
  817. "scrollContentTo": {
  818. "complexType": {
  819. "signature": "(options?: ScrollToOptions) => Promise<void>",
  820. "parameters": [{
  821. "tags": [{
  822. "name": "param",
  823. "text": "options"
  824. }],
  825. "text": ""
  826. }],
  827. "references": {
  828. "Promise": {
  829. "location": "global"
  830. },
  831. "ScrollToOptions": {
  832. "location": "global"
  833. }
  834. },
  835. "return": "Promise<void>"
  836. },
  837. "docs": {
  838. "text": "Scrolls the component's content to a specified set of coordinates.",
  839. "tags": [{
  840. "name": "example",
  841. "text": "myCalciteFlowItem.scrollContentTo({\n left: 0, // Specifies the number of pixels along the X axis to scroll the window or element.\n top: 0, // Specifies the number of pixels along the Y axis to scroll the window or element\n behavior: \"auto\" // Specifies whether the scrolling should animate smoothly (smooth), or happen instantly in a single jump (auto, the default value).\n});"
  842. }, {
  843. "name": "param",
  844. "text": "options"
  845. }]
  846. }
  847. }
  848. };
  849. }
  850. static get elementRef() { return "el"; }
  851. static get watchers() {
  852. return [{
  853. "propName": "dismissed",
  854. "methodName": "dismissedHandler"
  855. }, {
  856. "propName": "closed",
  857. "methodName": "closedHandler"
  858. }, {
  859. "propName": "dismissible",
  860. "methodName": "dismissibleHandler"
  861. }, {
  862. "propName": "closable",
  863. "methodName": "closableHandler"
  864. }];
  865. }
  866. }