@spectrum-web-components/split-view 0.4.3-express.12 → 0.4.4
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.
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@spectrum-web-components/split-view",
|
3
|
-
"version": "0.4.
|
3
|
+
"version": "0.4.4",
|
4
4
|
"publishConfig": {
|
5
5
|
"access": "public"
|
6
6
|
},
|
@@ -44,16 +44,16 @@
|
|
44
44
|
"lit-html"
|
45
45
|
],
|
46
46
|
"dependencies": {
|
47
|
-
"@spectrum-web-components/base": "^0.5.
|
47
|
+
"@spectrum-web-components/base": "^0.5.3",
|
48
48
|
"tslib": "^2.0.0"
|
49
49
|
},
|
50
50
|
"devDependencies": {
|
51
|
-
"@spectrum-css/splitview": "^3.0.
|
51
|
+
"@spectrum-css/splitview": "^3.0.14"
|
52
52
|
},
|
53
53
|
"types": "./src/index.d.ts",
|
54
54
|
"customElements": "custom-elements.json",
|
55
55
|
"sideEffects": [
|
56
56
|
"./sp-*.js"
|
57
57
|
],
|
58
|
-
"gitHead": "
|
58
|
+
"gitHead": "57aba8030b6af96af4015a0aa830e342a17dc219"
|
59
59
|
}
|
package/src/SplitView.js
CHANGED
@@ -111,7 +111,11 @@ export class SplitView extends SpectrumElement {
|
|
111
111
|
start: ['pointerdown', this.onPointerdown],
|
112
112
|
streamInside: ['pointermove', this.onPointermove],
|
113
113
|
end: [
|
114
|
-
[
|
114
|
+
[
|
115
|
+
'pointerup',
|
116
|
+
'pointercancel',
|
117
|
+
'pointerleave',
|
118
|
+
],
|
115
119
|
this.onPointerup,
|
116
120
|
],
|
117
121
|
})}
|
package/src/SplitView.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SplitView.js","sourceRoot":"","sources":["SplitView.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,EAEJ,OAAO,EA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,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;8CAC1B;AAI5B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;+CAC/B;AAIxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;+CAChB;AAIvC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;8CACzC;AAI5B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;gDACd;AAG/B;IADC,QAAQ,EAAE;wCACW;AAGtB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;iDACf;AAG/B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CACN;AAGrB;IADC,KAAK,CAAC,MAAM,CAAC;2CACqB;AAGnC;IADC,KAAK,CAAC,WAAW,CAAC;2CACe","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n LitElement,\n nothing,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n classMap,\n ifDefined,\n} from '@spectrum-web-components/base/src/directives.js';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { streamingListener } from '@spectrum-web-components/base/src/streaming-listener.js';\n\nimport { WithSWCResizeObserver } from './types';\n\nimport styles from './split-view.css.js';\n\nconst DEFAULT_MAX_SIZE = 3840;\n\nconst SPLITTERSIZE = 2;\n\nconst ARROW_KEY_CHANGE_VALUE = 10;\n\nconst PAGEUPDOWN_KEY_CHANGE_VALUE = 50;\n\nconst COLLAPSE_THREASHOLD = 50;\n\n/**\n * @element sp-split-view\n *\n * @slot Two sibling elements to be sized by the element attritubes\n */\nexport class SplitView extends SpectrumElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: Boolean, reflect: true })\n public vertical = false;\n\n @property({ type: Boolean, reflect: true })\n public resizable = false;\n\n @property({ type: Boolean, reflect: true })\n public collapsible = false;\n\n /** The minimum size of the primary pane */\n @property({ type: Number, attribute: 'primary-min' })\n public primaryMin = 0;\n\n /** The maximum size of the primary pane */\n @property({ type: Number, attribute: 'primary-max' })\n public primaryMax = DEFAULT_MAX_SIZE;\n\n /**\n * The start size of the primary pane, can be a real pixel number|string, percentage or \"auto\"\n * For example: \"100\", \"120px\", \"75%\" or \"auto\" are valid values\n * @type {number | number + \"px\" | number + \"%\" | \"auto\"}\n * @attr\n */\n @property({ type: String, attribute: 'primary-size' })\n public primarySize?: string;\n\n /** The minimum size of the secondary pane */\n @property({ type: Number, attribute: 'secondary-min' })\n public secondaryMin = 0;\n\n /** The maximum size of the secondary pane */\n @property({ type: Number, attribute: 'secondary-max' })\n public secondaryMax = DEFAULT_MAX_SIZE;\n\n /** The current splitter position of split-view */\n @property({ type: Number, reflect: true, attribute: 'splitter-pos' })\n public splitterPos?: number;\n\n /** The current size of first pane of split-view */\n @property({ type: String, attribute: false })\n private firstPaneSize = 'auto';\n\n @property()\n public label?: string;\n\n @property({ type: Boolean, attribute: false })\n private enoughChildren = false;\n\n @property({ type: Number })\n private viewSize = 0;\n\n @query('slot')\n private paneSlot!: HTMLSlotElement;\n\n @query('#splitter')\n private splitter!: HTMLDivElement;\n\n private offset = 0;\n\n private minPos = 0;\n\n private maxPos = DEFAULT_MAX_SIZE;\n\n private observer?: WithSWCResizeObserver['ResizeObserver'];\n\n private rect?: DOMRect;\n\n private _splitterSize?: number;\n\n public constructor() {\n super();\n const RO = (window as unknown as WithSWCResizeObserver).ResizeObserver;\n if (RO) {\n this.observer = new RO(() => {\n this.rect = undefined;\n this.updateMinMax();\n });\n }\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n this.observer?.observe(this);\n }\n\n public disconnectedCallback(): void {\n this.observer?.unobserve(this);\n super.disconnectedCallback();\n }\n\n /**\n * @private\n **/\n public get splitterSize(): number {\n if (!this._splitterSize) {\n this._splitterSize =\n (this.splitter &&\n Math.round(\n parseFloat(\n window\n .getComputedStyle(this.splitter)\n .getPropertyValue(\n this.vertical ? 'height' : 'width'\n )\n )\n )) ||\n SPLITTERSIZE;\n }\n return this._splitterSize;\n }\n\n protected render(): TemplateResult {\n const splitterClasses = {\n 'is-resized-start': this.splitterPos === this.minPos,\n 'is-resized-end': (this.splitterPos &&\n this.splitterPos > this.splitterSize &&\n this.splitterPos === this.maxPos) as boolean,\n 'is-collapsed-start': this.splitterPos === 0,\n 'is-collapsed-end': (this.splitterPos &&\n this.splitterPos >=\n Math.max(\n this.splitterSize,\n this.viewSize - this.splitterSize\n )) as boolean,\n };\n return html`\n <slot\n @slotchange=${this.onContentSlotChange}\n style=\"--spectrum-split-view-first-pane-size: ${this\n .firstPaneSize}\"\n ></slot>\n ${this.enoughChildren\n ? html`\n <div\n id=\"splitter\"\n class=${classMap(splitterClasses)}\n role=\"separator\"\n aria-label=${ifDefined(this.label || undefined)}\n tabindex=${ifDefined(\n this.resizable ? '0' : undefined\n )}\n @keydown=${this.onKeydown}\n ${streamingListener({\n start: ['pointerdown', this.onPointerdown],\n streamInside: ['pointermove', this.onPointermove],\n end: [\n ['pointerup', 'pointercancel'],\n this.onPointerup,\n ],\n })}\n >\n ${this.resizable\n ? html`\n <div id=\"gripper\"></div>\n `\n : html``}\n </div>\n `\n : nothing}\n `;\n }\n\n private onContentSlotChange(): void {\n this.enoughChildren = this.children.length > 1;\n this.checkResize();\n }\n\n private onPointerdown(event: PointerEvent): void {\n if (!this.resizable || (event.button && event.button !== 0)) {\n event.preventDefault();\n return;\n }\n this.splitter.setPointerCapture(event.pointerId);\n this.offset = this.getOffset();\n }\n\n private onPointermove(event: PointerEvent): void {\n event.preventDefault();\n let pos =\n this.vertical || this.isLTR\n ? this.getPosition(event) - this.offset\n : this.offset - this.getPosition(event);\n if (this.collapsible && pos < this.minPos - COLLAPSE_THREASHOLD) {\n pos = 0;\n }\n if (this.collapsible && pos > this.maxPos + COLLAPSE_THREASHOLD) {\n pos = this.viewSize - this.splitterSize;\n }\n this.updatePosition(pos);\n }\n\n private onPointerup(event: PointerEvent): void {\n this.splitter.releasePointerCapture(event.pointerId);\n }\n\n private getOffset(): number {\n if (!this.rect) {\n this.rect = this.getBoundingClientRect();\n }\n const offsetX = this.isLTR ? this.rect.left : this.rect.right;\n return this.vertical ? this.rect.top : offsetX;\n }\n\n private getPosition(event: PointerEvent): number {\n return this.vertical ? event.clientY : event.clientX;\n }\n\n private movePosition(event: KeyboardEvent, offset: number): void {\n event.preventDefault();\n if (this.splitterPos !== undefined) {\n this.updatePosition(this.splitterPos + offset);\n }\n }\n\n private onKeydown(event: KeyboardEvent): void {\n if (!this.resizable) {\n return;\n }\n let direction = 0;\n const isLTRorVertical = this.isLTR || this.vertical;\n switch (event.key) {\n case 'Home':\n event.preventDefault();\n this.updatePosition(this.collapsible ? 0 : this.minPos);\n return;\n case 'End':\n event.preventDefault();\n this.updatePosition(\n this.collapsible\n ? this.viewSize - this.splitterSize\n : this.maxPos\n );\n return;\n case 'ArrowLeft':\n direction = isLTRorVertical ? -1 : 1;\n break;\n case 'ArrowRight':\n direction = isLTRorVertical ? 1 : -1;\n break;\n case 'ArrowUp':\n direction = this.vertical ? -1 : 1;\n break;\n case 'ArrowDown':\n direction = this.vertical ? 1 : -1;\n break;\n case 'PageUp':\n direction = this.vertical ? -1 : 1;\n break;\n case 'PageDown':\n direction = this.vertical ? 1 : -1;\n break;\n }\n if (direction !== 0) {\n const moveBy = event.key.startsWith('Page')\n ? PAGEUPDOWN_KEY_CHANGE_VALUE\n : ARROW_KEY_CHANGE_VALUE;\n this.movePosition(event, moveBy * direction);\n }\n }\n\n private async checkResize(): Promise<void> {\n if (!this.enoughChildren) {\n return;\n }\n this.updateMinMax();\n if (this.splitterPos === undefined) {\n const startPos = await this.calcStartPos();\n this.updatePosition(startPos);\n }\n }\n\n private updateMinMax(): void {\n this.viewSize = this.vertical ? this.offsetHeight : this.offsetWidth;\n this.minPos = Math.max(\n this.primaryMin,\n this.viewSize - this.secondaryMax\n );\n this.maxPos = Math.min(\n this.primaryMax,\n this.viewSize - Math.max(this.secondaryMin, this.splitterSize)\n );\n }\n\n private updatePosition(x: number): void {\n let pos = this.getLimitedPosition(x);\n if (this.collapsible && x <= 0) {\n pos = 0;\n }\n if (\n this.collapsible &&\n x > this.maxPos &&\n x >= this.viewSize - this.splitterSize\n ) {\n pos = this.viewSize - this.splitterSize;\n }\n if (pos !== this.splitterPos) {\n this.splitterPos = pos;\n this.dispatchChangeEvent();\n }\n }\n\n private getLimitedPosition(input: number): number {\n if (input <= this.minPos) {\n return this.minPos;\n }\n if (input >= this.maxPos) {\n return this.maxPos;\n }\n return Math.max(this.minPos, Math.min(this.maxPos, input));\n }\n\n private async calcStartPos(): Promise<number> {\n if (\n this.primarySize !== undefined &&\n /^\\d+(px)?$/.test(this.primarySize)\n ) {\n return parseInt(this.primarySize, 10);\n }\n if (this.primarySize !== undefined && /^\\d+%$/.test(this.primarySize)) {\n return (parseInt(this.primarySize, 10) * this.viewSize) / 100;\n }\n if (this.primarySize === 'auto') {\n this.firstPaneSize = 'auto';\n const nodes = this.paneSlot.assignedNodes({ flatten: true });\n const firstEl = nodes.find(\n (node) => node instanceof HTMLElement\n ) as LitElement;\n if (typeof firstEl.updateComplete !== 'undefined') {\n await firstEl.updateComplete;\n }\n if (firstEl) {\n const size = window\n .getComputedStyle(firstEl)\n .getPropertyValue(this.vertical ? 'height' : 'width');\n const size_i = parseFloat(size);\n if (!isNaN(size_i)) {\n return this.getLimitedPosition(Math.ceil(size_i));\n }\n }\n }\n return this.viewSize / 2;\n }\n\n private dispatchChangeEvent(): void {\n const changeEvent = new Event('change', {\n bubbles: true,\n composed: true,\n });\n this.dispatchEvent(changeEvent);\n }\n\n protected firstUpdated(changed: PropertyValues): void {\n super.firstUpdated(changed);\n this.checkResize();\n }\n\n protected updated(changed: PropertyValues): void {\n super.updated(changed);\n if (changed.has('primarySize')) {\n this.splitterPos = undefined;\n this.checkResize();\n }\n if (\n changed.has('splitterPos') &&\n this.splitterPos !== undefined &&\n this.enoughChildren\n ) {\n this.firstPaneSize = `${Math.round(this.splitterPos)}px`;\n }\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"SplitView.js","sourceRoot":"","sources":["SplitView.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,EAEJ,OAAO,EAEP,eAAe,GAElB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACH,QAAQ,EACR,SAAS,GACZ,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACH,QAAQ,EACR,KAAK,GACR,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAI5F,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAE9B,MAAM,YAAY,GAAG,CAAC,CAAC;AAEvB,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAElC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAEvC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAE/B;;;;GAIG;AACH,MAAM,OAAO,SAAU,SAAQ,eAAe;IA0E1C;QACI,KAAK,EAAE,CAAC;QArEL,aAAQ,GAAG,KAAK,CAAC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,SAAS,EAAE,KAAK,EAAE,CAAC;iDACf;AAG/B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CACN;AAGrB;IADC,KAAK,CAAC,MAAM,CAAC;2CACqB;AAGnC;IADC,KAAK,CAAC,WAAW,CAAC;2CACe","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n LitElement,\n nothing,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n classMap,\n ifDefined,\n} from '@spectrum-web-components/base/src/directives.js';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { streamingListener } from '@spectrum-web-components/base/src/streaming-listener.js';\n\nimport { WithSWCResizeObserver } from './types';\n\nimport styles from './split-view.css.js';\n\nconst DEFAULT_MAX_SIZE = 3840;\n\nconst SPLITTERSIZE = 2;\n\nconst ARROW_KEY_CHANGE_VALUE = 10;\n\nconst PAGEUPDOWN_KEY_CHANGE_VALUE = 50;\n\nconst COLLAPSE_THREASHOLD = 50;\n\n/**\n * @element sp-split-view\n *\n * @slot Two sibling elements to be sized by the element attritubes\n */\nexport class SplitView extends SpectrumElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: Boolean, reflect: true })\n public vertical = false;\n\n @property({ type: Boolean, reflect: true })\n public resizable = false;\n\n @property({ type: Boolean, reflect: true })\n public collapsible = false;\n\n /** The minimum size of the primary pane */\n @property({ type: Number, attribute: 'primary-min' })\n public primaryMin = 0;\n\n /** The maximum size of the primary pane */\n @property({ type: Number, attribute: 'primary-max' })\n public primaryMax = DEFAULT_MAX_SIZE;\n\n /**\n * The start size of the primary pane, can be a real pixel number|string, percentage or \"auto\"\n * For example: \"100\", \"120px\", \"75%\" or \"auto\" are valid values\n * @type {number | number + \"px\" | number + \"%\" | \"auto\"}\n * @attr\n */\n @property({ type: String, attribute: 'primary-size' })\n public primarySize?: string;\n\n /** The minimum size of the secondary pane */\n @property({ type: Number, attribute: 'secondary-min' })\n public secondaryMin = 0;\n\n /** The maximum size of the secondary pane */\n @property({ type: Number, attribute: 'secondary-max' })\n public secondaryMax = DEFAULT_MAX_SIZE;\n\n /** The current splitter position of split-view */\n @property({ type: Number, reflect: true, attribute: 'splitter-pos' })\n public splitterPos?: number;\n\n /** The current size of first pane of split-view */\n @property({ type: String, attribute: false })\n private firstPaneSize = 'auto';\n\n @property()\n public label?: string;\n\n @property({ type: Boolean, attribute: false })\n private enoughChildren = false;\n\n @property({ type: Number })\n private viewSize = 0;\n\n @query('slot')\n private paneSlot!: HTMLSlotElement;\n\n @query('#splitter')\n private splitter!: HTMLDivElement;\n\n private offset = 0;\n\n private minPos = 0;\n\n private maxPos = DEFAULT_MAX_SIZE;\n\n private observer?: WithSWCResizeObserver['ResizeObserver'];\n\n private rect?: DOMRect;\n\n private _splitterSize?: number;\n\n public constructor() {\n super();\n const RO = (window as unknown as WithSWCResizeObserver).ResizeObserver;\n if (RO) {\n this.observer = new RO(() => {\n this.rect = undefined;\n this.updateMinMax();\n });\n }\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n this.observer?.observe(this);\n }\n\n public disconnectedCallback(): void {\n this.observer?.unobserve(this);\n super.disconnectedCallback();\n }\n\n /**\n * @private\n **/\n public get splitterSize(): number {\n if (!this._splitterSize) {\n this._splitterSize =\n (this.splitter &&\n Math.round(\n parseFloat(\n window\n .getComputedStyle(this.splitter)\n .getPropertyValue(\n this.vertical ? 'height' : 'width'\n )\n )\n )) ||\n SPLITTERSIZE;\n }\n return this._splitterSize;\n }\n\n protected render(): TemplateResult {\n const splitterClasses = {\n 'is-resized-start': this.splitterPos === this.minPos,\n 'is-resized-end': (this.splitterPos &&\n this.splitterPos > this.splitterSize &&\n this.splitterPos === this.maxPos) as boolean,\n 'is-collapsed-start': this.splitterPos === 0,\n 'is-collapsed-end': (this.splitterPos &&\n this.splitterPos >=\n Math.max(\n this.splitterSize,\n this.viewSize - this.splitterSize\n )) as boolean,\n };\n return html`\n <slot\n @slotchange=${this.onContentSlotChange}\n style=\"--spectrum-split-view-first-pane-size: ${this\n .firstPaneSize}\"\n ></slot>\n ${this.enoughChildren\n ? html`\n <div\n id=\"splitter\"\n class=${classMap(splitterClasses)}\n role=\"separator\"\n aria-label=${ifDefined(this.label || undefined)}\n tabindex=${ifDefined(\n this.resizable ? '0' : undefined\n )}\n @keydown=${this.onKeydown}\n ${streamingListener({\n start: ['pointerdown', this.onPointerdown],\n streamInside: ['pointermove', this.onPointermove],\n end: [\n [\n 'pointerup',\n 'pointercancel',\n 'pointerleave',\n ],\n this.onPointerup,\n ],\n })}\n >\n ${this.resizable\n ? html`\n <div id=\"gripper\"></div>\n `\n : html``}\n </div>\n `\n : nothing}\n `;\n }\n\n private onContentSlotChange(): void {\n this.enoughChildren = this.children.length > 1;\n this.checkResize();\n }\n\n private onPointerdown(event: PointerEvent): void {\n if (!this.resizable || (event.button && event.button !== 0)) {\n event.preventDefault();\n return;\n }\n this.splitter.setPointerCapture(event.pointerId);\n this.offset = this.getOffset();\n }\n\n private onPointermove(event: PointerEvent): void {\n event.preventDefault();\n let pos =\n this.vertical || this.isLTR\n ? this.getPosition(event) - this.offset\n : this.offset - this.getPosition(event);\n if (this.collapsible && pos < this.minPos - COLLAPSE_THREASHOLD) {\n pos = 0;\n }\n if (this.collapsible && pos > this.maxPos + COLLAPSE_THREASHOLD) {\n pos = this.viewSize - this.splitterSize;\n }\n this.updatePosition(pos);\n }\n\n private onPointerup(event: PointerEvent): void {\n this.splitter.releasePointerCapture(event.pointerId);\n }\n\n private getOffset(): number {\n if (!this.rect) {\n this.rect = this.getBoundingClientRect();\n }\n const offsetX = this.isLTR ? this.rect.left : this.rect.right;\n return this.vertical ? this.rect.top : offsetX;\n }\n\n private getPosition(event: PointerEvent): number {\n return this.vertical ? event.clientY : event.clientX;\n }\n\n private movePosition(event: KeyboardEvent, offset: number): void {\n event.preventDefault();\n if (this.splitterPos !== undefined) {\n this.updatePosition(this.splitterPos + offset);\n }\n }\n\n private onKeydown(event: KeyboardEvent): void {\n if (!this.resizable) {\n return;\n }\n let direction = 0;\n const isLTRorVertical = this.isLTR || this.vertical;\n switch (event.key) {\n case 'Home':\n event.preventDefault();\n this.updatePosition(this.collapsible ? 0 : this.minPos);\n return;\n case 'End':\n event.preventDefault();\n this.updatePosition(\n this.collapsible\n ? this.viewSize - this.splitterSize\n : this.maxPos\n );\n return;\n case 'ArrowLeft':\n direction = isLTRorVertical ? -1 : 1;\n break;\n case 'ArrowRight':\n direction = isLTRorVertical ? 1 : -1;\n break;\n case 'ArrowUp':\n direction = this.vertical ? -1 : 1;\n break;\n case 'ArrowDown':\n direction = this.vertical ? 1 : -1;\n break;\n case 'PageUp':\n direction = this.vertical ? -1 : 1;\n break;\n case 'PageDown':\n direction = this.vertical ? 1 : -1;\n break;\n }\n if (direction !== 0) {\n const moveBy = event.key.startsWith('Page')\n ? PAGEUPDOWN_KEY_CHANGE_VALUE\n : ARROW_KEY_CHANGE_VALUE;\n this.movePosition(event, moveBy * direction);\n }\n }\n\n private async checkResize(): Promise<void> {\n if (!this.enoughChildren) {\n return;\n }\n this.updateMinMax();\n if (this.splitterPos === undefined) {\n const startPos = await this.calcStartPos();\n this.updatePosition(startPos);\n }\n }\n\n private updateMinMax(): void {\n this.viewSize = this.vertical ? this.offsetHeight : this.offsetWidth;\n this.minPos = Math.max(\n this.primaryMin,\n this.viewSize - this.secondaryMax\n );\n this.maxPos = Math.min(\n this.primaryMax,\n this.viewSize - Math.max(this.secondaryMin, this.splitterSize)\n );\n }\n\n private updatePosition(x: number): void {\n let pos = this.getLimitedPosition(x);\n if (this.collapsible && x <= 0) {\n pos = 0;\n }\n if (\n this.collapsible &&\n x > this.maxPos &&\n x >= this.viewSize - this.splitterSize\n ) {\n pos = this.viewSize - this.splitterSize;\n }\n if (pos !== this.splitterPos) {\n this.splitterPos = pos;\n this.dispatchChangeEvent();\n }\n }\n\n private getLimitedPosition(input: number): number {\n if (input <= this.minPos) {\n return this.minPos;\n }\n if (input >= this.maxPos) {\n return this.maxPos;\n }\n return Math.max(this.minPos, Math.min(this.maxPos, input));\n }\n\n private async calcStartPos(): Promise<number> {\n if (\n this.primarySize !== undefined &&\n /^\\d+(px)?$/.test(this.primarySize)\n ) {\n return parseInt(this.primarySize, 10);\n }\n if (this.primarySize !== undefined && /^\\d+%$/.test(this.primarySize)) {\n return (parseInt(this.primarySize, 10) * this.viewSize) / 100;\n }\n if (this.primarySize === 'auto') {\n this.firstPaneSize = 'auto';\n const nodes = this.paneSlot.assignedNodes({ flatten: true });\n const firstEl = nodes.find(\n (node) => node instanceof HTMLElement\n ) as LitElement;\n if (typeof firstEl.updateComplete !== 'undefined') {\n await firstEl.updateComplete;\n }\n if (firstEl) {\n const size = window\n .getComputedStyle(firstEl)\n .getPropertyValue(this.vertical ? 'height' : 'width');\n const size_i = parseFloat(size);\n if (!isNaN(size_i)) {\n return this.getLimitedPosition(Math.ceil(size_i));\n }\n }\n }\n return this.viewSize / 2;\n }\n\n private dispatchChangeEvent(): void {\n const changeEvent = new Event('change', {\n bubbles: true,\n composed: true,\n });\n this.dispatchEvent(changeEvent);\n }\n\n protected firstUpdated(changed: PropertyValues): void {\n super.firstUpdated(changed);\n this.checkResize();\n }\n\n protected updated(changed: PropertyValues): void {\n super.updated(changed);\n if (changed.has('primarySize')) {\n this.splitterPos = undefined;\n this.checkResize();\n }\n if (\n changed.has('splitterPos') &&\n this.splitterPos !== undefined &&\n this.enoughChildren\n ) {\n this.firstPaneSize = `${Math.round(this.splitterPos)}px`;\n }\n }\n}\n"]}
|
@@ -1,296 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
Copyright 2020 Adobe. All rights reserved.
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
6
|
-
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
10
|
-
governing permissions and limitations under the License.
|
11
|
-
*/
|
12
|
-
import { html } from '@spectrum-web-components/base';
|
13
|
-
import '../sp-split-view.js';
|
14
|
-
export default {
|
15
|
-
title: 'Split View',
|
16
|
-
component: 'sp-split-view',
|
17
|
-
args: {
|
18
|
-
primarySize: 100,
|
19
|
-
},
|
20
|
-
argTypes: {
|
21
|
-
primarySize: {
|
22
|
-
name: 'primarySize',
|
23
|
-
type: { name: 'number', required: false },
|
24
|
-
description: 'Size of the primary panel.',
|
25
|
-
table: {
|
26
|
-
type: { summary: 'number' },
|
27
|
-
defaultValue: { summary: undefined },
|
28
|
-
},
|
29
|
-
control: {
|
30
|
-
type: 'number',
|
31
|
-
},
|
32
|
-
},
|
33
|
-
},
|
34
|
-
};
|
35
|
-
export const Horizontal = (args) => {
|
36
|
-
return html `
|
37
|
-
<sp-split-view style="height: 200px" .primarySize="${args.primarySize}">
|
38
|
-
<div>First panel</div>
|
39
|
-
<div>Second panel</div>
|
40
|
-
</sp-split-view>
|
41
|
-
`;
|
42
|
-
};
|
43
|
-
export const HorizontalResizable = (args) => {
|
44
|
-
return html `
|
45
|
-
<sp-split-view
|
46
|
-
resizable
|
47
|
-
primary-min="50"
|
48
|
-
.primarySize="${args.primarySize}"
|
49
|
-
secondary-min="50"
|
50
|
-
>
|
51
|
-
<div>
|
52
|
-
<h1>First panel</h1>
|
53
|
-
<p>
|
54
|
-
Lorem Ipsum is simply dummy text of the printing and
|
55
|
-
typesetting industry.
|
56
|
-
</p>
|
57
|
-
</div>
|
58
|
-
<div>
|
59
|
-
<h2>Second panel</h2>
|
60
|
-
<p>
|
61
|
-
It is a long established fact that a reader will be
|
62
|
-
distracted by the readable content of a page when looking at
|
63
|
-
its layout.
|
64
|
-
</p>
|
65
|
-
</div>
|
66
|
-
</sp-split-view>
|
67
|
-
`;
|
68
|
-
};
|
69
|
-
export const HorizontalResizableCollapsible = (args) => {
|
70
|
-
return html `
|
71
|
-
<sp-split-view
|
72
|
-
resizable
|
73
|
-
collapsible
|
74
|
-
primary-min="50"
|
75
|
-
secondary-min="50"
|
76
|
-
style="height: 500px;"
|
77
|
-
.primarySize="${args.primarySize}"
|
78
|
-
>
|
79
|
-
<div>
|
80
|
-
<h1>First panel</h1>
|
81
|
-
<p>
|
82
|
-
Lorem Ipsum is simply dummy text of the printing and
|
83
|
-
typesetting industry. Lorem Ipsum has been the industry's
|
84
|
-
standard dummy text ever since the 1500s, when an unknown
|
85
|
-
printer took a galley of type and scrambled it to make a
|
86
|
-
type specimen book. It has survived not only five centuries,
|
87
|
-
but also the leap into electronic typesetting, remaining
|
88
|
-
essentially unchanged. It was popularised in the 1960s with
|
89
|
-
the release of Letraset sheets containing Lorem Ipsum
|
90
|
-
passages, and more recently with desktop publishing software
|
91
|
-
like Aldus PageMaker including versions of Lorem Ipsum.
|
92
|
-
</p>
|
93
|
-
</div>
|
94
|
-
<div>
|
95
|
-
<h2>Second panel</h2>
|
96
|
-
<p>
|
97
|
-
It is a long established fact that a reader will be
|
98
|
-
distracted by the readable content of a page when looking at
|
99
|
-
its layout. The point of using Lorem Ipsum is that it has a
|
100
|
-
more-or-less normal distribution of letters, as opposed to
|
101
|
-
using 'Content here, content here', making it look like
|
102
|
-
readable English. Many desktop publishing packages and web
|
103
|
-
page editors now use Lorem Ipsum as their default model
|
104
|
-
text, and a search for 'lorem ipsum' will uncover many web
|
105
|
-
sites still in their infancy. Various versions have evolved
|
106
|
-
over the years, sometimes by accident, sometimes on purpose
|
107
|
-
(injected humour and the like).
|
108
|
-
</p>
|
109
|
-
</div>
|
110
|
-
</sp-split-view>
|
111
|
-
`;
|
112
|
-
};
|
113
|
-
HorizontalResizableCollapsible.args = {
|
114
|
-
primarySize: undefined,
|
115
|
-
};
|
116
|
-
export const Vertical = (args) => {
|
117
|
-
return html `
|
118
|
-
<sp-split-view vertical .primarySize="${args.primarySize}">
|
119
|
-
<div>First panel</div>
|
120
|
-
<div>Second panel</div>
|
121
|
-
</sp-split-view>
|
122
|
-
`;
|
123
|
-
};
|
124
|
-
Vertical.args = {
|
125
|
-
primarySize: undefined,
|
126
|
-
};
|
127
|
-
export const VerticalResizable = (args) => {
|
128
|
-
return html `
|
129
|
-
<sp-split-view
|
130
|
-
vertical
|
131
|
-
resizable
|
132
|
-
primary-min="50"
|
133
|
-
primary-max="100"
|
134
|
-
secondary-min="50"
|
135
|
-
style="height: 400px;"
|
136
|
-
.primarySize="${args.primarySize}"
|
137
|
-
>
|
138
|
-
<div>
|
139
|
-
<h1>First panel</h1>
|
140
|
-
<p>
|
141
|
-
Lorem Ipsum is simply dummy text of the printing and
|
142
|
-
typesetting industry. Lorem Ipsum has been the industry's
|
143
|
-
standard dummy text ever since the 1500s, when an unknown
|
144
|
-
printer took a galley of type and scrambled it to make a
|
145
|
-
type specimen book. It has survived not only five centuries,
|
146
|
-
but also the leap into electronic typesetting, remaining
|
147
|
-
essentially unchanged. It was popularised in the 1960s with
|
148
|
-
the release of Letraset sheets containing Lorem Ipsum
|
149
|
-
passages, and more recently with desktop publishing software
|
150
|
-
like Aldus PageMaker including versions of Lorem Ipsum.
|
151
|
-
</p>
|
152
|
-
</div>
|
153
|
-
<div>
|
154
|
-
<h2>Second panel</h2>
|
155
|
-
<p>
|
156
|
-
It is a long established fact that a reader will be
|
157
|
-
distracted by the readable content of a page when looking at
|
158
|
-
its layout. The point of using Lorem Ipsum is that it has a
|
159
|
-
more-or-less normal distribution of letters, as opposed to
|
160
|
-
using 'Content here, content here', making it look like
|
161
|
-
readable English. Many desktop publishing packages and web
|
162
|
-
page editors now use Lorem Ipsum as their default model
|
163
|
-
text, and a search for 'lorem ipsum' will uncover many web
|
164
|
-
sites still in their infancy. Various versions have evolved
|
165
|
-
over the years, sometimes by accident, sometimes on purpose
|
166
|
-
(injected humour and the like).
|
167
|
-
</p>
|
168
|
-
</div>
|
169
|
-
</sp-split-view>
|
170
|
-
`;
|
171
|
-
};
|
172
|
-
VerticalResizable.args = {
|
173
|
-
primarySize: undefined,
|
174
|
-
};
|
175
|
-
export const VerticalResizableCollapsible = (args) => {
|
176
|
-
return html `
|
177
|
-
<sp-split-view
|
178
|
-
vertical
|
179
|
-
resizable
|
180
|
-
collapsible
|
181
|
-
primary-min="50"
|
182
|
-
secondary-min="40"
|
183
|
-
style="height: 400px;"
|
184
|
-
.primarySize="${args.primarySize}"
|
185
|
-
>
|
186
|
-
<div>
|
187
|
-
<h1>First panel</h1>
|
188
|
-
<p>
|
189
|
-
Lorem Ipsum is simply dummy text of the printing and
|
190
|
-
typesetting industry. Lorem Ipsum has been the industry's
|
191
|
-
standard dummy text ever since the 1500s, when an unknown
|
192
|
-
printer took a galley of type and scrambled it to make a
|
193
|
-
type specimen book. It has survived not only five centuries,
|
194
|
-
but also the leap into electronic typesetting, remaining
|
195
|
-
essentially unchanged. It was popularised in the 1960s with
|
196
|
-
the release of Letraset sheets containing Lorem Ipsum
|
197
|
-
passages, and more recently with desktop publishing software
|
198
|
-
like Aldus PageMaker including versions of Lorem Ipsum.
|
199
|
-
</p>
|
200
|
-
</div>
|
201
|
-
<div>
|
202
|
-
<h2>Second panel</h2>
|
203
|
-
<p>
|
204
|
-
It is a long established fact that a reader will be
|
205
|
-
distracted by the readable content of a page when looking at
|
206
|
-
its layout. The point of using Lorem Ipsum is that it has a
|
207
|
-
more-or-less normal distribution of letters, as opposed to
|
208
|
-
using 'Content here, content here', making it look like
|
209
|
-
readable English. Many desktop publishing packages and web
|
210
|
-
page editors now use Lorem Ipsum as their default model
|
211
|
-
text, and a search for 'lorem ipsum' will uncover many web
|
212
|
-
sites still in their infancy. Various versions have evolved
|
213
|
-
over the years, sometimes by accident, sometimes on purpose
|
214
|
-
(injected humour and the like).
|
215
|
-
</p>
|
216
|
-
</div>
|
217
|
-
</sp-split-view>
|
218
|
-
`;
|
219
|
-
};
|
220
|
-
VerticalResizableCollapsible.args = {
|
221
|
-
primarySize: 250,
|
222
|
-
};
|
223
|
-
export const MultipleLevels = (args) => {
|
224
|
-
return html `
|
225
|
-
<sp-split-view
|
226
|
-
resizable
|
227
|
-
primary-min="50"
|
228
|
-
primary-max="200"
|
229
|
-
secondary-min="50"
|
230
|
-
style="height: 400px; width: 600px;"
|
231
|
-
>
|
232
|
-
<div>
|
233
|
-
<h1>First panel - Level 1</h1>
|
234
|
-
<p>
|
235
|
-
Lorem Ipsum is simply dummy text of the printing and
|
236
|
-
typesetting industry. Lorem Ipsum has been the industry's
|
237
|
-
standard dummy text ever since the 1500s, when an unknown
|
238
|
-
printer took a galley of type and scrambled it to make a
|
239
|
-
type specimen book. It has survived not only five centuries,
|
240
|
-
but also the leap into electronic typesetting, remaining
|
241
|
-
essentially unchanged. It was popularised in the 1960s with
|
242
|
-
the release of Letraset sheets containing Lorem Ipsum
|
243
|
-
passages, and more recently with desktop publishing software
|
244
|
-
like Aldus PageMaker including versions of Lorem Ipsum.
|
245
|
-
</p>
|
246
|
-
</div>
|
247
|
-
<div>
|
248
|
-
<h2>Second panel - Level 1</h2>
|
249
|
-
<sp-split-view
|
250
|
-
vertical
|
251
|
-
resizable
|
252
|
-
primary-min="50"
|
253
|
-
.primarySize="${args.primarySize}"
|
254
|
-
secondary-min="50"
|
255
|
-
style="height: 300px;"
|
256
|
-
>
|
257
|
-
<div>
|
258
|
-
<h3>First panel - Level 2</h3>
|
259
|
-
<p>
|
260
|
-
Lorem Ipsum is simply dummy text of the printing and
|
261
|
-
typesetting industry.
|
262
|
-
</p>
|
263
|
-
</div>
|
264
|
-
<div>
|
265
|
-
<h4>Second panel - Level 2</h4>
|
266
|
-
<p>
|
267
|
-
It is a long established fact that a reader will be
|
268
|
-
distracted by the readable content of a page when
|
269
|
-
looking at its layout.
|
270
|
-
</p>
|
271
|
-
</div>
|
272
|
-
</sp-split-view>
|
273
|
-
</div>
|
274
|
-
</sp-split-view>
|
275
|
-
`;
|
276
|
-
};
|
277
|
-
export const OnePaneNoSplitter = (args) => {
|
278
|
-
return html `
|
279
|
-
<sp-split-view style="height: 200px" .primarySize="${args.primarySize}">
|
280
|
-
<div>First panel</div>
|
281
|
-
</sp-split-view>
|
282
|
-
`;
|
283
|
-
};
|
284
|
-
export const ShowFirstTwoPanes = (args) => {
|
285
|
-
return html `
|
286
|
-
<sp-split-view style="height: 200px" .primarySize="${args.primarySize}">
|
287
|
-
<div>First panel</div>
|
288
|
-
<div>Second panel</div>
|
289
|
-
<div>Third (invisible) panel</div>
|
290
|
-
</sp-split-view>
|
291
|
-
`;
|
292
|
-
};
|
293
|
-
ShowFirstTwoPanes.args = {
|
294
|
-
primarySize: undefined,
|
295
|
-
};
|
296
|
-
//# sourceMappingURL=split-view.stories.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"split-view.stories.js","sourceRoot":"","sources":["split-view.stories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AAErE,OAAO,qBAAqB,CAAC;AAE7B,eAAe;IACX,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,eAAe;IAC1B,IAAI,EAAE;QACF,WAAW,EAAE,GAAG;KACnB;IACD,QAAQ,EAAE;QACN,WAAW,EAAE;YACT,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;YACzC,WAAW,EAAE,4BAA4B;YACzC,KAAK,EAAE;gBACH,IAAI,EAAE,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,MAAM,4BAA4B,GAAG,CACxC,IAAgB,EACF,EAAE;IAChB,OAAO,IAAI,CAAA;;;;;;;;4BAQa,IAAI,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkCvC,CAAC;AACN,CAAC,CAAC;AAEF,4BAA4B,CAAC,IAAI,GAAG;IAChC,WAAW,EAAE,GAAG;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAgB,EAAkB,EAAE;IAC/D,OAAO,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCA6BqB,IAAI,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;KAsB/C,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAgB,EAAkB,EAAE;IAClE,OAAO,IAAI,CAAA;6DAC8C,IAAI,CAAC,WAAW;;;KAGxE,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAgB,EAAkB,EAAE;IAClE,OAAO,IAAI,CAAA;6DAC8C,IAAI,CAAC,WAAW;;;;;KAKxE,CAAC;AACN,CAAC,CAAC;AAEF,iBAAiB,CAAC,IAAI,GAAG;IACrB,WAAW,EAAE,SAAS;CACzB,CAAC","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '../sp-split-view.js';\n\nexport default {\n title: 'Split View',\n component: 'sp-split-view',\n args: {\n primarySize: 100,\n },\n argTypes: {\n primarySize: {\n name: 'primarySize',\n type: { name: 'number', required: false },\n description: 'Size of the primary panel.',\n table: {\n type: { summary: 'number' },\n defaultValue: { summary: undefined },\n },\n control: {\n type: 'number',\n },\n },\n },\n};\n\ninterface Properties {\n primarySize?: string;\n}\n\nexport const Horizontal = (args: Properties): TemplateResult => {\n return html`\n <sp-split-view style=\"height: 200px\" .primarySize=\"${args.primarySize}\">\n <div>First panel</div>\n <div>Second panel</div>\n </sp-split-view>\n `;\n};\n\nexport const HorizontalResizable = (args: Properties): TemplateResult => {\n return html`\n <sp-split-view\n resizable\n primary-min=\"50\"\n .primarySize=\"${args.primarySize}\"\n secondary-min=\"50\"\n >\n <div>\n <h1>First panel</h1>\n <p>\n Lorem Ipsum is simply dummy text of the printing and\n typesetting industry.\n </p>\n </div>\n <div>\n <h2>Second panel</h2>\n <p>\n It is a long established fact that a reader will be\n distracted by the readable content of a page when looking at\n its layout.\n </p>\n </div>\n </sp-split-view>\n `;\n};\n\nexport const HorizontalResizableCollapsible = (\n args: Properties\n): TemplateResult => {\n return html`\n <sp-split-view\n resizable\n collapsible\n primary-min=\"50\"\n secondary-min=\"50\"\n style=\"height: 500px;\"\n .primarySize=\"${args.primarySize}\"\n >\n <div>\n <h1>First panel</h1>\n <p>\n Lorem Ipsum is simply dummy text of the printing and\n typesetting industry. Lorem Ipsum has been the industry's\n standard dummy text ever since the 1500s, when an unknown\n printer took a galley of type and scrambled it to make a\n type specimen book. It has survived not only five centuries,\n but also the leap into electronic typesetting, remaining\n essentially unchanged. It was popularised in the 1960s with\n the release of Letraset sheets containing Lorem Ipsum\n passages, and more recently with desktop publishing software\n like Aldus PageMaker including versions of Lorem Ipsum.\n </p>\n </div>\n <div>\n <h2>Second panel</h2>\n <p>\n It is a long established fact that a reader will be\n distracted by the readable content of a page when looking at\n its layout. The point of using Lorem Ipsum is that it has a\n more-or-less normal distribution of letters, as opposed to\n using 'Content here, content here', making it look like\n readable English. Many desktop publishing packages and web\n page editors now use Lorem Ipsum as their default model\n text, and a search for 'lorem ipsum' will uncover many web\n sites still in their infancy. Various versions have evolved\n over the years, sometimes by accident, sometimes on purpose\n (injected humour and the like).\n </p>\n </div>\n </sp-split-view>\n `;\n};\n\nHorizontalResizableCollapsible.args = {\n primarySize: undefined,\n};\n\nexport const Vertical = (args: Properties): TemplateResult => {\n return html`\n <sp-split-view vertical .primarySize=\"${args.primarySize}\">\n <div>First panel</div>\n <div>Second panel</div>\n </sp-split-view>\n `;\n};\n\nVertical.args = {\n primarySize: undefined,\n};\n\nexport const VerticalResizable = (args: Properties): TemplateResult => {\n return html`\n <sp-split-view\n vertical\n resizable\n primary-min=\"50\"\n primary-max=\"100\"\n secondary-min=\"50\"\n style=\"height: 400px;\"\n .primarySize=\"${args.primarySize}\"\n >\n <div>\n <h1>First panel</h1>\n <p>\n Lorem Ipsum is simply dummy text of the printing and\n typesetting industry. Lorem Ipsum has been the industry's\n standard dummy text ever since the 1500s, when an unknown\n printer took a galley of type and scrambled it to make a\n type specimen book. It has survived not only five centuries,\n but also the leap into electronic typesetting, remaining\n essentially unchanged. It was popularised in the 1960s with\n the release of Letraset sheets containing Lorem Ipsum\n passages, and more recently with desktop publishing software\n like Aldus PageMaker including versions of Lorem Ipsum.\n </p>\n </div>\n <div>\n <h2>Second panel</h2>\n <p>\n It is a long established fact that a reader will be\n distracted by the readable content of a page when looking at\n its layout. The point of using Lorem Ipsum is that it has a\n more-or-less normal distribution of letters, as opposed to\n using 'Content here, content here', making it look like\n readable English. Many desktop publishing packages and web\n page editors now use Lorem Ipsum as their default model\n text, and a search for 'lorem ipsum' will uncover many web\n sites still in their infancy. Various versions have evolved\n over the years, sometimes by accident, sometimes on purpose\n (injected humour and the like).\n </p>\n </div>\n </sp-split-view>\n `;\n};\n\nVerticalResizable.args = {\n primarySize: undefined,\n};\n\nexport const VerticalResizableCollapsible = (\n args: Properties\n): TemplateResult => {\n return html`\n <sp-split-view\n vertical\n resizable\n collapsible\n primary-min=\"50\"\n secondary-min=\"40\"\n style=\"height: 400px;\"\n .primarySize=\"${args.primarySize}\"\n >\n <div>\n <h1>First panel</h1>\n <p>\n Lorem Ipsum is simply dummy text of the printing and\n typesetting industry. Lorem Ipsum has been the industry's\n standard dummy text ever since the 1500s, when an unknown\n printer took a galley of type and scrambled it to make a\n type specimen book. It has survived not only five centuries,\n but also the leap into electronic typesetting, remaining\n essentially unchanged. It was popularised in the 1960s with\n the release of Letraset sheets containing Lorem Ipsum\n passages, and more recently with desktop publishing software\n like Aldus PageMaker including versions of Lorem Ipsum.\n </p>\n </div>\n <div>\n <h2>Second panel</h2>\n <p>\n It is a long established fact that a reader will be\n distracted by the readable content of a page when looking at\n its layout. The point of using Lorem Ipsum is that it has a\n more-or-less normal distribution of letters, as opposed to\n using 'Content here, content here', making it look like\n readable English. Many desktop publishing packages and web\n page editors now use Lorem Ipsum as their default model\n text, and a search for 'lorem ipsum' will uncover many web\n sites still in their infancy. Various versions have evolved\n over the years, sometimes by accident, sometimes on purpose\n (injected humour and the like).\n </p>\n </div>\n </sp-split-view>\n `;\n};\n\nVerticalResizableCollapsible.args = {\n primarySize: 250,\n};\n\nexport const MultipleLevels = (args: Properties): TemplateResult => {\n return html`\n <sp-split-view\n resizable\n primary-min=\"50\"\n primary-max=\"200\"\n secondary-min=\"50\"\n style=\"height: 400px; width: 600px;\"\n >\n <div>\n <h1>First panel - Level 1</h1>\n <p>\n Lorem Ipsum is simply dummy text of the printing and\n typesetting industry. Lorem Ipsum has been the industry's\n standard dummy text ever since the 1500s, when an unknown\n printer took a galley of type and scrambled it to make a\n type specimen book. It has survived not only five centuries,\n but also the leap into electronic typesetting, remaining\n essentially unchanged. It was popularised in the 1960s with\n the release of Letraset sheets containing Lorem Ipsum\n passages, and more recently with desktop publishing software\n like Aldus PageMaker including versions of Lorem Ipsum.\n </p>\n </div>\n <div>\n <h2>Second panel - Level 1</h2>\n <sp-split-view\n vertical\n resizable\n primary-min=\"50\"\n .primarySize=\"${args.primarySize}\"\n secondary-min=\"50\"\n style=\"height: 300px;\"\n >\n <div>\n <h3>First panel - Level 2</h3>\n <p>\n Lorem Ipsum is simply dummy text of the printing and\n typesetting industry.\n </p>\n </div>\n <div>\n <h4>Second panel - Level 2</h4>\n <p>\n It is a long established fact that a reader will be\n distracted by the readable content of a page when\n looking at its layout.\n </p>\n </div>\n </sp-split-view>\n </div>\n </sp-split-view>\n `;\n};\n\nexport const OnePaneNoSplitter = (args: Properties): TemplateResult => {\n return html`\n <sp-split-view style=\"height: 200px\" .primarySize=\"${args.primarySize}\">\n <div>First panel</div>\n </sp-split-view>\n `;\n};\n\nexport const ShowFirstTwoPanes = (args: Properties): TemplateResult => {\n return html`\n <sp-split-view style=\"height: 200px\" .primarySize=\"${args.primarySize}\">\n <div>First panel</div>\n <div>Second panel</div>\n <div>Third (invisible) panel</div>\n </sp-split-view>\n `;\n};\n\nShowFirstTwoPanes.args = {\n primarySize: undefined,\n};\n"]}
|