All Downloads are FREE. Search and download functionalities are using the official Maven repository.

theme.keycloak.v2.admin.resources.assets.ExpandableSection-DLsX7rbK.js.map Maven / Gradle / Ivy

There is a newer version: 26.0.7
Show newest version
{"version":3,"file":"ExpandableSection-DLsX7rbK.js","sources":["../../../../../node_modules/.pnpm/@[email protected]/node_modules/@patternfly/react-styles/css/components/ExpandableSection/expandable-section.mjs","../../../../../node_modules/.pnpm/@[email protected]/node_modules/@patternfly/react-tokens/dist/esm/c_expandable_section_m_truncate__content_LineClamp.js","../../../../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@patternfly/react-core/dist/esm/components/ExpandableSection/ExpandableSection.js"],"sourcesContent":["import './expandable-section.css';\nexport default {\n  \"dirRtl\": \"pf-v5-m-dir-rtl\",\n  \"expandableSection\": \"pf-v5-c-expandable-section\",\n  \"expandableSectionContent\": \"pf-v5-c-expandable-section__content\",\n  \"expandableSectionToggle\": \"pf-v5-c-expandable-section__toggle\",\n  \"expandableSectionToggleIcon\": \"pf-v5-c-expandable-section__toggle-icon\",\n  \"expandableSectionToggleText\": \"pf-v5-c-expandable-section__toggle-text\",\n  \"modifiers\": {\n    \"expanded\": \"pf-m-expanded\",\n    \"detached\": \"pf-m-detached\",\n    \"truncate\": \"pf-m-truncate\",\n    \"limitWidth\": \"pf-m-limit-width\",\n    \"displayLg\": \"pf-m-display-lg\",\n    \"indented\": \"pf-m-indented\",\n    \"active\": \"pf-m-active\",\n    \"expandTop\": \"pf-m-expand-top\"\n  }\n};","export const c_expandable_section_m_truncate__content_LineClamp = {\n  \"name\": \"--pf-v5-c-expandable-section--m-truncate__content--LineClamp\",\n  \"value\": \"3\",\n  \"var\": \"var(--pf-v5-c-expandable-section--m-truncate__content--LineClamp)\"\n};\nexport default c_expandable_section_m_truncate__content_LineClamp;","import { __rest } from \"tslib\";\nimport * as React from 'react';\nimport styles from '@patternfly/react-styles/css/components/ExpandableSection/expandable-section.mjs';\nimport { css } from '@patternfly/react-styles';\nimport lineClamp from '@patternfly/react-tokens/dist/esm/c_expandable_section_m_truncate__content_LineClamp';\nimport AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';\nimport { debounce, getUniqueId } from '../../helpers/util';\nimport { getResizeObserver } from '../../helpers/resizeObserver';\nexport var ExpandableSectionVariant;\n(function (ExpandableSectionVariant) {\n    ExpandableSectionVariant[\"default\"] = \"default\";\n    ExpandableSectionVariant[\"truncate\"] = \"truncate\";\n})(ExpandableSectionVariant || (ExpandableSectionVariant = {}));\nconst setLineClamp = (lines, element) => {\n    if (!element || lines < 1) {\n        return;\n    }\n    element.style.setProperty(lineClamp.name, lines.toString());\n};\nclass ExpandableSection extends React.Component {\n    constructor(props) {\n        super(props);\n        this.expandableContentRef = React.createRef();\n        this.observer = () => { };\n        this.checkToggleVisibility = () => {\n            var _a;\n            if ((_a = this.expandableContentRef) === null || _a === void 0 ? void 0 : _a.current) {\n                const maxLines = this.props.truncateMaxLines || parseInt(lineClamp.value);\n                const totalLines = this.expandableContentRef.current.scrollHeight /\n                    parseInt(getComputedStyle(this.expandableContentRef.current).lineHeight);\n                this.setState({\n                    hasToggle: totalLines > maxLines\n                });\n            }\n        };\n        this.resize = () => {\n            const { offsetWidth } = this.expandableContentRef.current;\n            if (this.state.previousWidth !== offsetWidth) {\n                this.setState({ previousWidth: offsetWidth });\n                this.checkToggleVisibility();\n            }\n        };\n        this.handleResize = debounce(this.resize, 250);\n        this.state = {\n            isExpanded: props.isExpanded,\n            hasToggle: true,\n            previousWidth: undefined\n        };\n    }\n    calculateToggleText(toggleText, toggleTextExpanded, toggleTextCollapsed, propOrStateIsExpanded) {\n        if (propOrStateIsExpanded && toggleTextExpanded !== '') {\n            return toggleTextExpanded;\n        }\n        if (!propOrStateIsExpanded && toggleTextCollapsed !== '') {\n            return toggleTextCollapsed;\n        }\n        return toggleText;\n    }\n    componentDidMount() {\n        if (this.props.variant === ExpandableSectionVariant.truncate) {\n            const expandableContent = this.expandableContentRef.current;\n            this.setState({ previousWidth: expandableContent.offsetWidth });\n            this.observer = getResizeObserver(expandableContent, this.handleResize, false);\n            if (this.props.truncateMaxLines) {\n                setLineClamp(this.props.truncateMaxLines, expandableContent);\n            }\n            this.checkToggleVisibility();\n        }\n    }\n    componentDidUpdate(prevProps) {\n        if (this.props.variant === ExpandableSectionVariant.truncate &&\n            (prevProps.truncateMaxLines !== this.props.truncateMaxLines || prevProps.children !== this.props.children)) {\n            const expandableContent = this.expandableContentRef.current;\n            setLineClamp(this.props.truncateMaxLines, expandableContent);\n            this.checkToggleVisibility();\n        }\n    }\n    componentWillUnmount() {\n        if (this.props.variant === ExpandableSectionVariant.truncate) {\n            this.observer();\n        }\n    }\n    render() {\n        const _a = this.props, { onToggle: onToggleProp, \n        // eslint-disable-next-line @typescript-eslint/no-unused-vars\n        isActive, className, toggleText, toggleTextExpanded, toggleTextCollapsed, toggleContent, children, isExpanded, isDetached, displaySize, isWidthLimited, isIndented, contentId, toggleId, variant, \n        // eslint-disable-next-line @typescript-eslint/no-unused-vars\n        truncateMaxLines } = _a, props = __rest(_a, [\"onToggle\", \"isActive\", \"className\", \"toggleText\", \"toggleTextExpanded\", \"toggleTextCollapsed\", \"toggleContent\", \"children\", \"isExpanded\", \"isDetached\", \"displaySize\", \"isWidthLimited\", \"isIndented\", \"contentId\", \"toggleId\", \"variant\", \"truncateMaxLines\"]);\n        if (isDetached && !toggleId) {\n            /* eslint-disable no-console */\n            console.warn('ExpandableSection: The toggleId value must be passed in and must match the toggleId of the ExpandableSectionToggle.');\n        }\n        let onToggle = onToggleProp;\n        let propOrStateIsExpanded = isExpanded;\n        const uniqueContentId = contentId || getUniqueId('expandable-section-content');\n        const uniqueToggleId = toggleId || getUniqueId('expandable-section-toggle');\n        // uncontrolled\n        if (isExpanded === undefined) {\n            propOrStateIsExpanded = this.state.isExpanded;\n            onToggle = (event, isOpen) => {\n                this.setState({ isExpanded: isOpen }, () => onToggleProp(event, this.state.isExpanded));\n            };\n        }\n        const computedToggleText = this.calculateToggleText(toggleText, toggleTextExpanded, toggleTextCollapsed, propOrStateIsExpanded);\n        const expandableToggle = !isDetached && (React.createElement(\"button\", { className: css(styles.expandableSectionToggle), type: \"button\", \"aria-expanded\": propOrStateIsExpanded, \"aria-controls\": uniqueContentId, id: uniqueToggleId, onClick: (event) => onToggle(event, !propOrStateIsExpanded) },\n            variant !== ExpandableSectionVariant.truncate && (React.createElement(\"span\", { className: css(styles.expandableSectionToggleIcon) },\n                React.createElement(AngleRightIcon, { \"aria-hidden\": true }))),\n            React.createElement(\"span\", { className: css(styles.expandableSectionToggleText) }, toggleContent || computedToggleText)));\n        return (React.createElement(\"div\", Object.assign({ className: css(styles.expandableSection, propOrStateIsExpanded && styles.modifiers.expanded, isActive && styles.modifiers.active, isDetached && styles.modifiers.detached, displaySize === 'lg' && styles.modifiers.displayLg, isWidthLimited && styles.modifiers.limitWidth, isIndented && styles.modifiers.indented, variant === ExpandableSectionVariant.truncate && styles.modifiers.truncate, className) }, props),\n            variant === ExpandableSectionVariant.default && expandableToggle,\n            React.createElement(\"div\", { ref: this.expandableContentRef, className: css(styles.expandableSectionContent), hidden: variant !== ExpandableSectionVariant.truncate && !propOrStateIsExpanded, id: uniqueContentId, \"aria-labelledby\": uniqueToggleId, role: \"region\" }, children),\n            variant === ExpandableSectionVariant.truncate && this.state.hasToggle && expandableToggle));\n    }\n}\nExpandableSection.displayName = 'ExpandableSection';\nExpandableSection.defaultProps = {\n    className: '',\n    toggleText: '',\n    toggleTextExpanded: '',\n    toggleTextCollapsed: '',\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    onToggle: (event, isExpanded) => undefined,\n    isActive: false,\n    isDetached: false,\n    displaySize: 'default',\n    isWidthLimited: false,\n    isIndented: false,\n    variant: 'default'\n};\nexport { ExpandableSection };\n//# sourceMappingURL=ExpandableSection.js.map"],"names":["styles","c_expandable_section_m_truncate__content_LineClamp","ExpandableSectionVariant","setLineClamp","lines","element","lineClamp","ExpandableSection","React","props","_a","maxLines","totalLines","offsetWidth","debounce","toggleText","toggleTextExpanded","toggleTextCollapsed","propOrStateIsExpanded","expandableContent","getResizeObserver","prevProps","onToggleProp","isActive","className","toggleContent","children","isExpanded","isDetached","displaySize","isWidthLimited","isIndented","contentId","toggleId","variant","truncateMaxLines","__rest","onToggle","uniqueContentId","getUniqueId","uniqueToggleId","event","isOpen","computedToggleText","expandableToggle","css","AngleRightIcon"],"mappings":"sGACA,MAAeA,EAAA,CACb,OAAU,kBACV,kBAAqB,6BACrB,yBAA4B,sCAC5B,wBAA2B,qCAC3B,4BAA+B,0CAC/B,4BAA+B,0CAC/B,UAAa,CACX,SAAY,gBACZ,SAAY,gBACZ,SAAY,gBACZ,WAAc,mBACd,UAAa,kBACb,SAAY,gBACZ,OAAU,cACV,UAAa,iBACd,CACH,EClBaC,EAAqD,CAChE,KAAQ,+DACR,MAAS,IACT,IAAO,mEACT,ECIO,IAAIC,GACV,SAAUA,EAA0B,CACjCA,EAAyB,QAAa,UACtCA,EAAyB,SAAc,UAC3C,GAAGA,IAA6BA,EAA2B,CAAE,EAAC,EAC9D,MAAMC,EAAe,CAACC,EAAOC,IAAY,CACjC,CAACA,GAAWD,EAAQ,GAGxBC,EAAQ,MAAM,YAAYC,EAAU,KAAMF,EAAM,SAAQ,CAAE,CAC9D,EACA,MAAMG,UAA0BC,EAAM,SAAU,CAC5C,YAAYC,EAAO,CACf,MAAMA,CAAK,EACX,KAAK,qBAAuBD,EAAM,YAClC,KAAK,SAAW,IAAM,GACtB,KAAK,sBAAwB,IAAM,CAC/B,IAAIE,EACJ,GAAK,GAAAA,EAAK,KAAK,wBAA0B,MAAQA,IAAO,SAAkBA,EAAG,QAAS,CAClF,MAAMC,EAAW,KAAK,MAAM,kBAAoB,SAASL,EAAU,KAAK,EAClEM,EAAa,KAAK,qBAAqB,QAAQ,aACjD,SAAS,iBAAiB,KAAK,qBAAqB,OAAO,EAAE,UAAU,EAC3E,KAAK,SAAS,CACV,UAAWA,EAAaD,CAC5C,CAA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