etudes 3.9.0 → 3.9.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.
package/lib/Accordion.js CHANGED
@@ -252,7 +252,7 @@ function getFixedStyles(_a) {
252
252
  height: '100%',
253
253
  }),
254
254
  list: {},
255
- header: __assign({ border: 'none', cursor: 'pointer', margin: '0', outline: 'none' }, orientation === 'vertical' ? {
255
+ header: __assign({ cursor: 'pointer', margin: '0' }, orientation === 'vertical' ? {
256
256
  width: '100%',
257
257
  } : {
258
258
  height: '100%',
@@ -275,7 +275,7 @@ function getDefaultStyles(_a) {
275
275
  } : {
276
276
  transitionProperty: 'width, margin',
277
277
  }),
278
- header: __assign({ alignItems: 'center', background: '#fff', boxSizing: 'border-box', display: 'flex', flexDirection: 'row', justifyContent: 'space-between', padding: '0 10px', transitionDuration: '100ms', transitionProperty: 'transform, opacity, background, color', transitionTimingFunction: 'ease-out' }, orientation === 'vertical' ? {
278
+ header: __assign({ border: 'none', outline: 'none', alignItems: 'center', background: '#fff', boxSizing: 'border-box', display: 'flex', flexDirection: 'row', justifyContent: 'space-between', padding: '0 10px', transitionDuration: '100ms', transitionProperty: 'transform, opacity, background, color', transitionTimingFunction: 'ease-out' }, orientation === 'vertical' ? {
279
279
  height: '50px',
280
280
  } : {
281
281
  width: '50px',
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.js","sourceRoot":"/","sources":["Accordion.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAAmC;AACnC,gEAA+C;AAC/C,6CAA4J;AAC5J,gDAAyB;AACzB,sDAA+B;AAC/B,gDAA+G;AAC/G,oEAA6C;AAC7C,4EAAqD;AACrD,oEAA6C;AAC7C,kFAA2D;AAC3D,0DAAmC;AA2JnC,kBAAe,IAAA,kBAAU,EAAC,UAAC,EAyB1B,EAAE,GAAG;I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EAAE,QAAQ;YACzB,kBAAkB,EAAE,OAAO;YAC3B,kBAAkB,EAAE,WAAW;YAC/B,wBAAwB,EAAE,UAAU;YACpC,KAAK,EAAE,MAAM;SACd;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import classNames from 'classnames'\nimport isDeepEqual from 'fast-deep-equal/react'\nimport React, { forwardRef, useEffect, useState, type ComponentType, type HTMLAttributes, type PropsWithChildren, type ReactElement, type Ref } from 'react'\nimport Each from './Each'\nimport FlatSVG from './FlatSVG'\nimport List, { type ListItemProps, type ListOrientation, type ListProps, type ListSelectionMode } from './List'\nimport usePrevious from './hooks/usePrevious'\nimport asClassNameDict from './utils/asClassNameDict'\nimport asStyleDict from './utils/asStyleDict'\nimport cloneStyledElement from './utils/cloneStyledElement'\nimport styles from './utils/styles'\n\nexport type AccordionSelection = Record<number, number[]>\n\nexport type AccordionSection<T> = Pick<ListProps<T>, 'isSelectionTogglable' | 'itemLength' | 'itemPadding' | 'items' | 'layout' | 'numSegments'> & {\n /**\n * Label for the header.\n */\n label: string\n\n /**\n * Maximum number of visible rows (if section orientation is `vertical`) or\n * columns (if section orientation is `horizontal`). If number of rows exceeds\n * the number of visible, a scrollbar will be put in place.\n */\n maxVisible?: number\n}\n\nexport type AccordionItemProps<T> = ListItemProps<T>\n\nexport type AccordionHeaderProps<I, S extends AccordionSection<I> = AccordionSection<I>> = HTMLAttributes<HTMLElement> & PropsWithChildren<{\n index: number\n isCollapsed: boolean\n section: S\n onCustomEvent?: (name: string, info?: any) => void\n}>\n\nexport type AccordionProps<I, S extends AccordionSection<I> = AccordionSection<I>> = HTMLAttributes<HTMLDivElement> & PropsWithChildren<{\n /**\n * Specifies if expanded sections should automatically collapse upon expanding\n * another section.\n */\n autoCollapseSections?: boolean\n\n /**\n * SVG markup to be put in the section header as the collapse icon.\n */\n collapseIconSvg?: string\n\n /**\n * Indices of sections that are expanded.\n */\n expandedSectionIndices?: number[]\n\n /**\n * SVG markup to be put in the section header as the expand icon.\n */\n expandIconSvg?: string\n\n /**\n * React component type to be used to generate items for each section.\n */\n itemComponentType?: ComponentType<AccordionItemProps<I>>\n\n /**\n * Orientation of this component.\n */\n orientation?: ListOrientation\n\n /**\n * Padding (in pixels) between each section.\n */\n sectionPadding?: number\n\n /**\n * Data provided to each section.\n */\n sections: S[]\n\n /**\n * Indices of selected items per section.\n */\n selection?: AccordionSelection\n\n /**\n * Selection mode of each section.\n */\n selectionMode?: ListSelectionMode\n\n /**\n * React component type to be used for generating headers inside the\n * component. When absent, one will be generated automatically.\n */\n headerComponentType?: ComponentType<AccordionHeaderProps<I, S>>\n\n /**\n * Specifies if the component should use default styles.\n */\n useDefaultStyles?: boolean\n\n /**\n * Handler invoked when an item is activated in a section.\n *\n * @param itemIndex Item index.\n * @param sectionIndex Section index.\n */\n onActivateAt?: (itemIndex: number, sectionIndex: number) => void\n\n /**\n * Handler invoked when a section is collapsed.\n *\n * @param sectionIndex Section index.\n */\n onCollapseSectionAt?: (sectionIndex: number) => void\n\n /**\n * Handler invoked when an item is deselected in a section.\n *\n * @param itemIndex Item index.\n * @param sectionIndex Section index.\n */\n onDeselectAt?: (itemIndex: number, sectionIndex: number) => void\n\n /**\n * Handler invoked when a section is expanded.\n *\n * @param sectionIndex Section index.\n */\n onExpandSectionAt?: (sectionIndex: number) => void\n\n /**\n * Handler invoked when a custom event is dispatched from a section header.\n *\n * @param sectionIndex Index of the section which the header belongs.\n * @param eventName Name of the dispatched event.\n * @param eventInfo Optional info of the dispatched event.\n */\n onHeaderCustomEvent?: (sectionIndex: number, eventName: string, eventInfo?: any) => void\n\n /**\n * Handler invoked when a custom event is dispatched from an item.\n *\n * @param itemIndex Item index.\n * @param sectionIndex Section index.\n * @param eventName Name of the dispatched event.\n * @param eventInfo Optional info of the dispatched event.\n */\n onItemCustomEvent?: (itemIndex: number, sectionIndex: number, eventName: string, eventInfo?: any) => void\n\n /**\n * Handler invoked when an item is selected in a section.\n *\n * @param itemIndex Item index.\n * @param sectionIndex Section index.\n */\n onSelectAt?: (itemIndex: number, sectionIndex: number) => void\n\n /**\n * Handler invoked when selected items have changed.\n *\n * @param selectedIndices Dictionary of indices of selected items per section.\n */\n onSelectionChange?: (selection: AccordionSelection) => void\n}>\n\nexport default forwardRef(({\n children,\n className,\n style,\n autoCollapseSections = false,\n collapseIconSvg,\n expandedSectionIndices: externalExpandedSectionIndices = [],\n expandIconSvg,\n itemComponentType,\n orientation = 'vertical',\n sectionPadding = 0,\n sections,\n selection: externalSelection = {},\n selectionMode = 'single',\n useDefaultStyles = false,\n headerComponentType: HeaderComponent,\n onActivateAt,\n onCollapseSectionAt,\n onDeselectAt,\n onExpandSectionAt,\n onHeaderCustomEvent,\n onItemCustomEvent,\n onSelectAt,\n onSelectionChange,\n ...props\n}, ref) => {\n const isSectionIndexOutOfRange = (sectionIndex: number) => {\n if (sectionIndex >= sections.length) return true\n if (sectionIndex < 0) return true\n\n return false\n }\n\n const isItemIndexOutOfRange = (itemIndex: number, sectionIndex: number) => {\n if (isSectionIndexOutOfRange(sectionIndex)) return true\n\n const items = sections[sectionIndex].items\n\n if (itemIndex >= items.length) return true\n if (itemIndex < 0) return true\n\n return false\n }\n\n const sanitizeExpandedSectionIndices = (sectionIndices: number[]) => sectionIndices.sort().filter(t => !isSectionIndexOutOfRange(t))\n\n const sanitizeSelection = (selection: AccordionSelection) => {\n const newValue: AccordionSelection = {}\n\n for (const sectionIndex in sections) {\n if (!Object.prototype.hasOwnProperty.call(sections, sectionIndex)) continue\n\n const indices = [...selection[sectionIndex] ?? []].sort()\n\n newValue[Number(sectionIndex)] = indices.sort().filter(t => !isItemIndexOutOfRange(t, Number(sectionIndex)))\n }\n\n return newValue\n }\n\n const isSectionExpandedAt = (sectionIndex: number) => expandedSectionIndices.indexOf(sectionIndex) >= 0\n\n const toggleSectionAt = (sectionIndex: number) => {\n if (isSectionExpandedAt(sectionIndex)) {\n setExpandedSectionIndices(prev => prev.filter(t => t !== sectionIndex))\n }\n else if (autoCollapseSections) {\n setExpandedSectionIndices([sectionIndex])\n }\n else {\n setExpandedSectionIndices(prev => [...prev.filter(t => t !== sectionIndex), sectionIndex])\n }\n }\n\n const selectAt = (itemIndex: number, sectionIndex: number) => {\n switch (selectionMode) {\n case 'multiple':\n setSelection(prev => ({\n ...prev,\n [sectionIndex]: [...(prev[sectionIndex] ?? []).filter(t => t !== itemIndex), itemIndex].sort(),\n }))\n\n onSelectAt?.(itemIndex, sectionIndex)\n\n break\n case 'single':\n setSelection({\n [sectionIndex]: [itemIndex],\n })\n\n onSelectAt?.(itemIndex, sectionIndex)\n\n break\n default:\n break\n }\n }\n\n const deselectAt = (itemIndex: number, sectionIndex: number) => {\n setSelection(prev => {\n const newValue = { ...prev }\n newValue[sectionIndex] = prev[sectionIndex].filter(t => t !== itemIndex)\n\n return newValue\n })\n\n onDeselectAt?.(itemIndex, sectionIndex)\n }\n\n const sanitizedExpandedSectionIndices = sanitizeExpandedSectionIndices(externalExpandedSectionIndices)\n const [expandedSectionIndices, setExpandedSectionIndices] = useState(sanitizedExpandedSectionIndices)\n const prevExpandedSectionIndices = usePrevious(expandedSectionIndices)\n\n const sanitizedExternalSelection = sanitizeSelection(externalSelection)\n const [selection, setSelection] = useState(sanitizedExternalSelection)\n\n useEffect(() => {\n if (isDeepEqual(sanitizedExpandedSectionIndices, expandedSectionIndices)) return\n\n setExpandedSectionIndices(sanitizedExpandedSectionIndices)\n }, [JSON.stringify(sanitizedExpandedSectionIndices)])\n\n useEffect(() => {\n if (!prevExpandedSectionIndices) return\n\n const collapsed = prevExpandedSectionIndices?.filter(t => expandedSectionIndices.indexOf(t) === -1) ?? []\n const expanded = expandedSectionIndices.filter(t => prevExpandedSectionIndices?.indexOf(t) === -1)\n\n collapsed.map(t => onCollapseSectionAt?.(t))\n expanded.map(t => onExpandSectionAt?.(t))\n }, [JSON.stringify(expandedSectionIndices)])\n\n useEffect(() => {\n if (isDeepEqual(sanitizedExternalSelection, selection)) return\n\n setSelection(sanitizedExternalSelection)\n }, [JSON.stringify(sanitizedExternalSelection)])\n\n useEffect(() => {\n onSelectionChange?.(selection)\n }, [JSON.stringify(selection)])\n\n const fixedClassNames = getFixedClassNames({ orientation })\n const fixedStyles = getFixedStyles({ orientation })\n const defaultStyles: Record<string, any> = useDefaultStyles ? getDefaultStyles({ orientation }) : {}\n\n return (\n <div {...props} className={classNames(className, fixedClassNames.root)} style={styles(style, fixedStyles.root)} ref={ref}>\n <Each in={sections}>\n {(section, sectionIndex) => {\n const { items, itemLength = 50, itemPadding = 0, isSelectionTogglable, layout = 'list', maxVisible = -1, numSegments = 1 } = section\n const allVisible = layout === 'list' ? items.length : Math.ceil(items.length / numSegments)\n const numVisible = maxVisible < 0 ? allVisible : Math.min(allVisible, maxVisible)\n const maxLength = itemLength * numVisible + itemPadding * (numVisible - 1)\n const isCollapsed = !isSectionExpandedAt(sectionIndex)\n const expandIconComponent = expandIconSvg ? <FlatSVG svg={expandIconSvg} style={defaultStyles.expandIcon}/> : <></>\n const collapseIconComponent = collapseIconSvg ? <FlatSVG svg={collapseIconSvg} style={defaultStyles.collapseIcon}/> : expandIconComponent\n\n return (\n <div style={styles(fixedStyles.section, orientation === 'vertical' ? {\n marginTop: sectionIndex === 0 ? '0px' : `${sectionPadding}px`,\n } : {\n marginLeft: sectionIndex === 0 ? '0px' : `${sectionPadding}px`,\n })}>\n {HeaderComponent ? (\n <HeaderComponent\n className={classNames(fixedClassNames.header, { collapsed: isCollapsed, expanded: !isCollapsed })}\n style={styles(fixedStyles.header)}\n index={sectionIndex}\n isCollapsed={isCollapsed}\n section={section}\n onClick={() => toggleSectionAt(sectionIndex)}\n onCustomEvent={(name, info) => onHeaderCustomEvent?.(sectionIndex, name, info)}\n />\n ) : (\n <button\n className={classNames(fixedClassNames.header, { collapsed: isCollapsed, expanded: !isCollapsed })}\n style={styles(fixedStyles.header, defaultStyles.header)}\n onClick={() => toggleSectionAt(sectionIndex)}\n >\n <label style={styles(defaultStyles.headerLabel)} dangerouslySetInnerHTML={{ __html: section.label }}/>\n {cloneStyledElement(isCollapsed ? expandIconComponent : collapseIconComponent, {\n className: classNames(isCollapsed ? fixedClassNames.expandIcon : fixedClassNames.collapseIcon),\n style: styles(isCollapsed ? fixedStyles.expandIcon : fixedStyles.collapseIcon),\n })}\n </button>\n )}\n <List\n style={styles(fixedStyles.list, defaultStyles.list, orientation === 'vertical' ? {\n width: '100%',\n top: '100%',\n height: isCollapsed ? '0px' : `${maxLength}px`,\n marginTop: isCollapsed ? '0px' : `${itemPadding}px`,\n overflowY: maxVisible < 0 ? 'hidden' : maxVisible < allVisible ? 'scroll' : 'hidden',\n } : {\n marginLeft: isCollapsed ? '0px' : `${itemPadding}px`,\n overflowX: maxVisible < 0 ? 'hidden' : maxVisible < allVisible ? 'scroll' : 'hidden',\n width: isCollapsed ? '0px' : `${maxLength}px`,\n height: '100%',\n left: '100%',\n })}\n selectionMode={selectionMode}\n isSelectionTogglable={isSelectionTogglable}\n itemComponentType={itemComponentType}\n itemLength={itemLength}\n itemPadding={itemPadding}\n items={items}\n orientation={orientation}\n layout={layout}\n numSegments={numSegments}\n selection={selection[sectionIndex] ?? []}\n onActivateAt={itemIndex => onActivateAt?.(itemIndex, sectionIndex)}\n onDeselectAt={itemIndex => deselectAt(itemIndex, sectionIndex)}\n onItemCustomEvent={(itemIndex, eventName, eventInfo) => onItemCustomEvent?.(itemIndex, sectionIndex, eventName, eventInfo)}\n onSelectAt={itemIndex => selectAt(itemIndex, sectionIndex)}\n />\n </div>\n )\n }}\n </Each>\n </div>\n )\n}) as <I, S extends AccordionSection<I> = AccordionSection<I>>(props: AccordionProps<I, S> & { ref?: Ref<HTMLDivElement> }) => ReactElement\n\ntype StylesProps = {\n borderThickness?: number\n orientation?: ListOrientation\n}\n\nfunction getFixedClassNames({ orientation }: StylesProps) {\n return asClassNameDict({\n root: classNames(orientation),\n header: classNames(orientation),\n expandIcon: classNames(orientation),\n collapseIcon: classNames(orientation),\n })\n}\n\nfunction getFixedStyles({ orientation }: StylesProps) {\n return asStyleDict({\n root: {\n alignItems: 'center',\n boxSizing: 'border-box',\n display: 'flex',\n flex: '0 0 auto',\n justifyContent: 'flex-start',\n padding: '0',\n ...orientation === 'vertical' ? {\n flexDirection: 'column',\n height: 'auto',\n } : {\n flexDirection: 'row',\n width: 'auto',\n },\n },\n section: {\n alignItems: 'flex-start',\n display: 'flex',\n flex: '0 0 auto',\n justifyContent: 'flex-start',\n margin: '0',\n padding: '0',\n ...orientation === 'vertical' ? {\n flexDirection: 'column',\n width: '100%',\n } : {\n flexDirection: 'row',\n height: '100%',\n },\n },\n list: {\n\n },\n header: {\n border: 'none',\n cursor: 'pointer',\n margin: '0',\n outline: 'none',\n ...orientation === 'vertical' ? {\n width: '100%',\n } : {\n height: '100%',\n },\n },\n expandIcon: {\n margin: '0',\n padding: '0',\n },\n collapseIcon: {\n margin: '0',\n padding: '0',\n },\n })\n}\n\nfunction getDefaultStyles({ orientation }: StylesProps) {\n return asStyleDict({\n list: {\n transitionDuration: '100ms',\n transitionTimingFunction: 'ease-out',\n ...orientation === 'vertical' ? {\n transitionProperty: 'height, margin',\n } : {\n transitionProperty: 'width, margin',\n },\n },\n header: {\n alignItems: 'center',\n background: '#fff',\n boxSizing: 'border-box',\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: '0 10px',\n transitionDuration: '100ms',\n transitionProperty: 'transform, opacity, background, color',\n transitionTimingFunction: 'ease-out',\n ...orientation === 'vertical' ? {\n height: '50px',\n } : {\n width: '50px',\n },\n },\n headerLabel: {\n color: 'inherit',\n fontFamily: 'inherit',\n fontSize: 'inherit',\n fontWeight: 'inherit',\n letterSpacing: 'inherit',\n lineHeight: 'inherit',\n pointerEvents: 'none',\n transition: 'inherit',\n },\n expandIcon: {\n boxSizing: 'border-box',\n display: 'block',\n fill: '#000',\n height: '15px',\n transformOrigin: 'center',\n transitionDuration: '100ms',\n transitionProperty: 'transform',\n transitionTimingFunction: 'ease-out',\n width: '15px',\n },\n collapseIcon: {\n boxSizing: 'border-box',\n display: 'block',\n fill: '#000',\n height: '15px',\n transformOrigin: 'center',\n transitionDuration: '100ms',\n transitionProperty: 'transform',\n transitionTimingFunction: 'ease-out',\n width: '15px',\n },\n })\n}\n"]}
1
+ {"version":3,"file":"Accordion.js","sourceRoot":"/","sources":["Accordion.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAAmC;AACnC,gEAA+C;AAC/C,6CAA4J;AAC5J,gDAAyB;AACzB,sDAA+B;AAC/B,gDAA+G;AAC/G,oEAA6C;AAC7C,4EAAqD;AACrD,oEAA6C;AAC7C,kFAA2D;AAC3D,0DAAmC;AA2JnC,kBAAe,IAAA,kBAAU,EAAC,UAAC,EAyB1B,EAAE,GAAG;IAxBJ,IAAA,QAAQ,cAAA,EACR,SAAS,eAAA,EACT,KAAK,WAAA,EACL,4BAA4B,EAA5B,oBAAoB,mBAAG,KAAK,KAAA,EAC5B,eAAe,qBAAA,EACf,8BAA2D,EAAnC,8BAA8B,mBAAG,EAAE,KAAA,EAC3D,aAAa,mBAAA,EACb,iBAAiB,uBAAA,EACjB,mBAAwB,EAAxB,WAAW,mBAAG,UAAU,KAAA,EACxB,sBAAkB,EAAlB,cAAc,mBAAG,CAAC,KAAA,EAClB,QAAQ,cAAA,EACR,iBAAiC,EAAtB,iBAAiB,mBAAG,EAAE,KAAA,EACjC,qBAAwB,EAAxB,aAAa,mBAAG,QAAQ,KAAA,EACxB,wBAAwB,EAAxB,gBAAgB,mBAAG,KAAK,KAAA,EACH,eAAe,yBAAA,EACpC,YAAY,kBAAA,EACZ,mBAAmB,yBAAA,EACnB,YAAY,kBAAA,EACZ,iBAAiB,uBAAA,EACjB,mBAAmB,yBAAA,EACnB,iBAAiB,uBAAA,EACjB,UAAU,gBAAA,EACV,iBAAiB,uBAAA,EACd,KAAK,cAxBiB,8ZAyB1B,CADS;IAER,IA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,SAAS;YACrB,QAAQ,EAAE,SAAS;YACnB,UAAU,EAAE,SAAS;YACrB,aAAa,EAAE,SAAS;YACxB,UAAU,EAAE,SAAS;YACrB,aAAa,EAAE,MAAM;YACrB,UAAU,EAAE,SAAS;SACtB;QACD,UAAU,EAAE;YACV,SAAS,EAAE,YAAY;YACvB,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,MAAM;YACd,eAAe,EAAE,QAAQ;YACzB,kBAAkB,EAAE,OAAO;YAC3B,kBAAkB,EAAE,WAAW;YAC/B,wBAAwB,EAAE,UAAU;YACpC,KAAK,EAAE,MAAM;SACd;QACD,YAAY,EAAE;YACZ,SAAS,EAAE,YAAY;YACvB,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,MAAM;YACd,eAAe,EAAE,QAAQ;YACzB,kBAAkB,EAAE,OAAO;YAC3B,kBAAkB,EAAE,WAAW;YAC/B,wBAAwB,EAAE,UAAU;YACpC,KAAK,EAAE,MAAM;SACd;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import classNames from 'classnames'\nimport isDeepEqual from 'fast-deep-equal/react'\nimport React, { forwardRef, useEffect, useState, type ComponentType, type HTMLAttributes, type PropsWithChildren, type ReactElement, type Ref } from 'react'\nimport Each from './Each'\nimport FlatSVG from './FlatSVG'\nimport List, { type ListItemProps, type ListOrientation, type ListProps, type ListSelectionMode } from './List'\nimport usePrevious from './hooks/usePrevious'\nimport asClassNameDict from './utils/asClassNameDict'\nimport asStyleDict from './utils/asStyleDict'\nimport cloneStyledElement from './utils/cloneStyledElement'\nimport styles from './utils/styles'\n\nexport type AccordionSelection = Record<number, number[]>\n\nexport type AccordionSection<T> = Pick<ListProps<T>, 'isSelectionTogglable' | 'itemLength' | 'itemPadding' | 'items' | 'layout' | 'numSegments'> & {\n /**\n * Label for the header.\n */\n label: string\n\n /**\n * Maximum number of visible rows (if section orientation is `vertical`) or\n * columns (if section orientation is `horizontal`). If number of rows exceeds\n * the number of visible, a scrollbar will be put in place.\n */\n maxVisible?: number\n}\n\nexport type AccordionItemProps<T> = ListItemProps<T>\n\nexport type AccordionHeaderProps<I, S extends AccordionSection<I> = AccordionSection<I>> = HTMLAttributes<HTMLElement> & PropsWithChildren<{\n index: number\n isCollapsed: boolean\n section: S\n onCustomEvent?: (name: string, info?: any) => void\n}>\n\nexport type AccordionProps<I, S extends AccordionSection<I> = AccordionSection<I>> = HTMLAttributes<HTMLDivElement> & PropsWithChildren<{\n /**\n * Specifies if expanded sections should automatically collapse upon expanding\n * another section.\n */\n autoCollapseSections?: boolean\n\n /**\n * SVG markup to be put in the section header as the collapse icon.\n */\n collapseIconSvg?: string\n\n /**\n * Indices of sections that are expanded.\n */\n expandedSectionIndices?: number[]\n\n /**\n * SVG markup to be put in the section header as the expand icon.\n */\n expandIconSvg?: string\n\n /**\n * React component type to be used to generate items for each section.\n */\n itemComponentType?: ComponentType<AccordionItemProps<I>>\n\n /**\n * Orientation of this component.\n */\n orientation?: ListOrientation\n\n /**\n * Padding (in pixels) between each section.\n */\n sectionPadding?: number\n\n /**\n * Data provided to each section.\n */\n sections: S[]\n\n /**\n * Indices of selected items per section.\n */\n selection?: AccordionSelection\n\n /**\n * Selection mode of each section.\n */\n selectionMode?: ListSelectionMode\n\n /**\n * React component type to be used for generating headers inside the\n * component. When absent, one will be generated automatically.\n */\n headerComponentType?: ComponentType<AccordionHeaderProps<I, S>>\n\n /**\n * Specifies if the component should use default styles.\n */\n useDefaultStyles?: boolean\n\n /**\n * Handler invoked when an item is activated in a section.\n *\n * @param itemIndex Item index.\n * @param sectionIndex Section index.\n */\n onActivateAt?: (itemIndex: number, sectionIndex: number) => void\n\n /**\n * Handler invoked when a section is collapsed.\n *\n * @param sectionIndex Section index.\n */\n onCollapseSectionAt?: (sectionIndex: number) => void\n\n /**\n * Handler invoked when an item is deselected in a section.\n *\n * @param itemIndex Item index.\n * @param sectionIndex Section index.\n */\n onDeselectAt?: (itemIndex: number, sectionIndex: number) => void\n\n /**\n * Handler invoked when a section is expanded.\n *\n * @param sectionIndex Section index.\n */\n onExpandSectionAt?: (sectionIndex: number) => void\n\n /**\n * Handler invoked when a custom event is dispatched from a section header.\n *\n * @param sectionIndex Index of the section which the header belongs.\n * @param eventName Name of the dispatched event.\n * @param eventInfo Optional info of the dispatched event.\n */\n onHeaderCustomEvent?: (sectionIndex: number, eventName: string, eventInfo?: any) => void\n\n /**\n * Handler invoked when a custom event is dispatched from an item.\n *\n * @param itemIndex Item index.\n * @param sectionIndex Section index.\n * @param eventName Name of the dispatched event.\n * @param eventInfo Optional info of the dispatched event.\n */\n onItemCustomEvent?: (itemIndex: number, sectionIndex: number, eventName: string, eventInfo?: any) => void\n\n /**\n * Handler invoked when an item is selected in a section.\n *\n * @param itemIndex Item index.\n * @param sectionIndex Section index.\n */\n onSelectAt?: (itemIndex: number, sectionIndex: number) => void\n\n /**\n * Handler invoked when selected items have changed.\n *\n * @param selectedIndices Dictionary of indices of selected items per section.\n */\n onSelectionChange?: (selection: AccordionSelection) => void\n}>\n\nexport default forwardRef(({\n children,\n className,\n style,\n autoCollapseSections = false,\n collapseIconSvg,\n expandedSectionIndices: externalExpandedSectionIndices = [],\n expandIconSvg,\n itemComponentType,\n orientation = 'vertical',\n sectionPadding = 0,\n sections,\n selection: externalSelection = {},\n selectionMode = 'single',\n useDefaultStyles = false,\n headerComponentType: HeaderComponent,\n onActivateAt,\n onCollapseSectionAt,\n onDeselectAt,\n onExpandSectionAt,\n onHeaderCustomEvent,\n onItemCustomEvent,\n onSelectAt,\n onSelectionChange,\n ...props\n}, ref) => {\n const isSectionIndexOutOfRange = (sectionIndex: number) => {\n if (sectionIndex >= sections.length) return true\n if (sectionIndex < 0) return true\n\n return false\n }\n\n const isItemIndexOutOfRange = (itemIndex: number, sectionIndex: number) => {\n if (isSectionIndexOutOfRange(sectionIndex)) return true\n\n const items = sections[sectionIndex].items\n\n if (itemIndex >= items.length) return true\n if (itemIndex < 0) return true\n\n return false\n }\n\n const sanitizeExpandedSectionIndices = (sectionIndices: number[]) => sectionIndices.sort().filter(t => !isSectionIndexOutOfRange(t))\n\n const sanitizeSelection = (selection: AccordionSelection) => {\n const newValue: AccordionSelection = {}\n\n for (const sectionIndex in sections) {\n if (!Object.prototype.hasOwnProperty.call(sections, sectionIndex)) continue\n\n const indices = [...selection[sectionIndex] ?? []].sort()\n\n newValue[Number(sectionIndex)] = indices.sort().filter(t => !isItemIndexOutOfRange(t, Number(sectionIndex)))\n }\n\n return newValue\n }\n\n const isSectionExpandedAt = (sectionIndex: number) => expandedSectionIndices.indexOf(sectionIndex) >= 0\n\n const toggleSectionAt = (sectionIndex: number) => {\n if (isSectionExpandedAt(sectionIndex)) {\n setExpandedSectionIndices(prev => prev.filter(t => t !== sectionIndex))\n }\n else if (autoCollapseSections) {\n setExpandedSectionIndices([sectionIndex])\n }\n else {\n setExpandedSectionIndices(prev => [...prev.filter(t => t !== sectionIndex), sectionIndex])\n }\n }\n\n const selectAt = (itemIndex: number, sectionIndex: number) => {\n switch (selectionMode) {\n case 'multiple':\n setSelection(prev => ({\n ...prev,\n [sectionIndex]: [...(prev[sectionIndex] ?? []).filter(t => t !== itemIndex), itemIndex].sort(),\n }))\n\n onSelectAt?.(itemIndex, sectionIndex)\n\n break\n case 'single':\n setSelection({\n [sectionIndex]: [itemIndex],\n })\n\n onSelectAt?.(itemIndex, sectionIndex)\n\n break\n default:\n break\n }\n }\n\n const deselectAt = (itemIndex: number, sectionIndex: number) => {\n setSelection(prev => {\n const newValue = { ...prev }\n newValue[sectionIndex] = prev[sectionIndex].filter(t => t !== itemIndex)\n\n return newValue\n })\n\n onDeselectAt?.(itemIndex, sectionIndex)\n }\n\n const sanitizedExpandedSectionIndices = sanitizeExpandedSectionIndices(externalExpandedSectionIndices)\n const [expandedSectionIndices, setExpandedSectionIndices] = useState(sanitizedExpandedSectionIndices)\n const prevExpandedSectionIndices = usePrevious(expandedSectionIndices)\n\n const sanitizedExternalSelection = sanitizeSelection(externalSelection)\n const [selection, setSelection] = useState(sanitizedExternalSelection)\n\n useEffect(() => {\n if (isDeepEqual(sanitizedExpandedSectionIndices, expandedSectionIndices)) return\n\n setExpandedSectionIndices(sanitizedExpandedSectionIndices)\n }, [JSON.stringify(sanitizedExpandedSectionIndices)])\n\n useEffect(() => {\n if (!prevExpandedSectionIndices) return\n\n const collapsed = prevExpandedSectionIndices?.filter(t => expandedSectionIndices.indexOf(t) === -1) ?? []\n const expanded = expandedSectionIndices.filter(t => prevExpandedSectionIndices?.indexOf(t) === -1)\n\n collapsed.map(t => onCollapseSectionAt?.(t))\n expanded.map(t => onExpandSectionAt?.(t))\n }, [JSON.stringify(expandedSectionIndices)])\n\n useEffect(() => {\n if (isDeepEqual(sanitizedExternalSelection, selection)) return\n\n setSelection(sanitizedExternalSelection)\n }, [JSON.stringify(sanitizedExternalSelection)])\n\n useEffect(() => {\n onSelectionChange?.(selection)\n }, [JSON.stringify(selection)])\n\n const fixedClassNames = getFixedClassNames({ orientation })\n const fixedStyles = getFixedStyles({ orientation })\n const defaultStyles: Record<string, any> = useDefaultStyles ? getDefaultStyles({ orientation }) : {}\n\n return (\n <div {...props} className={classNames(className, fixedClassNames.root)} style={styles(style, fixedStyles.root)} ref={ref}>\n <Each in={sections}>\n {(section, sectionIndex) => {\n const { items, itemLength = 50, itemPadding = 0, isSelectionTogglable, layout = 'list', maxVisible = -1, numSegments = 1 } = section\n const allVisible = layout === 'list' ? items.length : Math.ceil(items.length / numSegments)\n const numVisible = maxVisible < 0 ? allVisible : Math.min(allVisible, maxVisible)\n const maxLength = itemLength * numVisible + itemPadding * (numVisible - 1)\n const isCollapsed = !isSectionExpandedAt(sectionIndex)\n const expandIconComponent = expandIconSvg ? <FlatSVG svg={expandIconSvg} style={defaultStyles.expandIcon}/> : <></>\n const collapseIconComponent = collapseIconSvg ? <FlatSVG svg={collapseIconSvg} style={defaultStyles.collapseIcon}/> : expandIconComponent\n\n return (\n <div style={styles(fixedStyles.section, orientation === 'vertical' ? {\n marginTop: sectionIndex === 0 ? '0px' : `${sectionPadding}px`,\n } : {\n marginLeft: sectionIndex === 0 ? '0px' : `${sectionPadding}px`,\n })}>\n {HeaderComponent ? (\n <HeaderComponent\n className={classNames(fixedClassNames.header, { collapsed: isCollapsed, expanded: !isCollapsed })}\n style={styles(fixedStyles.header)}\n index={sectionIndex}\n isCollapsed={isCollapsed}\n section={section}\n onClick={() => toggleSectionAt(sectionIndex)}\n onCustomEvent={(name, info) => onHeaderCustomEvent?.(sectionIndex, name, info)}\n />\n ) : (\n <button\n className={classNames(fixedClassNames.header, { collapsed: isCollapsed, expanded: !isCollapsed })}\n style={styles(fixedStyles.header, defaultStyles.header)}\n onClick={() => toggleSectionAt(sectionIndex)}\n >\n <label style={styles(defaultStyles.headerLabel)} dangerouslySetInnerHTML={{ __html: section.label }}/>\n {cloneStyledElement(isCollapsed ? expandIconComponent : collapseIconComponent, {\n className: classNames(isCollapsed ? fixedClassNames.expandIcon : fixedClassNames.collapseIcon),\n style: styles(isCollapsed ? fixedStyles.expandIcon : fixedStyles.collapseIcon),\n })}\n </button>\n )}\n <List\n style={styles(fixedStyles.list, defaultStyles.list, orientation === 'vertical' ? {\n width: '100%',\n top: '100%',\n height: isCollapsed ? '0px' : `${maxLength}px`,\n marginTop: isCollapsed ? '0px' : `${itemPadding}px`,\n overflowY: maxVisible < 0 ? 'hidden' : maxVisible < allVisible ? 'scroll' : 'hidden',\n } : {\n marginLeft: isCollapsed ? '0px' : `${itemPadding}px`,\n overflowX: maxVisible < 0 ? 'hidden' : maxVisible < allVisible ? 'scroll' : 'hidden',\n width: isCollapsed ? '0px' : `${maxLength}px`,\n height: '100%',\n left: '100%',\n })}\n selectionMode={selectionMode}\n isSelectionTogglable={isSelectionTogglable}\n itemComponentType={itemComponentType}\n itemLength={itemLength}\n itemPadding={itemPadding}\n items={items}\n orientation={orientation}\n layout={layout}\n numSegments={numSegments}\n selection={selection[sectionIndex] ?? []}\n onActivateAt={itemIndex => onActivateAt?.(itemIndex, sectionIndex)}\n onDeselectAt={itemIndex => deselectAt(itemIndex, sectionIndex)}\n onItemCustomEvent={(itemIndex, eventName, eventInfo) => onItemCustomEvent?.(itemIndex, sectionIndex, eventName, eventInfo)}\n onSelectAt={itemIndex => selectAt(itemIndex, sectionIndex)}\n />\n </div>\n )\n }}\n </Each>\n </div>\n )\n}) as <I, S extends AccordionSection<I> = AccordionSection<I>>(props: AccordionProps<I, S> & { ref?: Ref<HTMLDivElement> }) => ReactElement\n\ntype StylesProps = {\n borderThickness?: number\n orientation?: ListOrientation\n}\n\nfunction getFixedClassNames({ orientation }: StylesProps) {\n return asClassNameDict({\n root: classNames(orientation),\n header: classNames(orientation),\n expandIcon: classNames(orientation),\n collapseIcon: classNames(orientation),\n })\n}\n\nfunction getFixedStyles({ orientation }: StylesProps) {\n return asStyleDict({\n root: {\n alignItems: 'center',\n boxSizing: 'border-box',\n display: 'flex',\n flex: '0 0 auto',\n justifyContent: 'flex-start',\n padding: '0',\n ...orientation === 'vertical' ? {\n flexDirection: 'column',\n height: 'auto',\n } : {\n flexDirection: 'row',\n width: 'auto',\n },\n },\n section: {\n alignItems: 'flex-start',\n display: 'flex',\n flex: '0 0 auto',\n justifyContent: 'flex-start',\n margin: '0',\n padding: '0',\n ...orientation === 'vertical' ? {\n flexDirection: 'column',\n width: '100%',\n } : {\n flexDirection: 'row',\n height: '100%',\n },\n },\n list: {\n\n },\n header: {\n cursor: 'pointer',\n margin: '0',\n ...orientation === 'vertical' ? {\n width: '100%',\n } : {\n height: '100%',\n },\n },\n expandIcon: {\n margin: '0',\n padding: '0',\n },\n collapseIcon: {\n margin: '0',\n padding: '0',\n },\n })\n}\n\nfunction getDefaultStyles({ orientation }: StylesProps) {\n return asStyleDict({\n list: {\n transitionDuration: '100ms',\n transitionTimingFunction: 'ease-out',\n ...orientation === 'vertical' ? {\n transitionProperty: 'height, margin',\n } : {\n transitionProperty: 'width, margin',\n },\n },\n header: {\n border: 'none',\n outline: 'none',\n alignItems: 'center',\n background: '#fff',\n boxSizing: 'border-box',\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: '0 10px',\n transitionDuration: '100ms',\n transitionProperty: 'transform, opacity, background, color',\n transitionTimingFunction: 'ease-out',\n ...orientation === 'vertical' ? {\n height: '50px',\n } : {\n width: '50px',\n },\n },\n headerLabel: {\n color: 'inherit',\n fontFamily: 'inherit',\n fontSize: 'inherit',\n fontWeight: 'inherit',\n letterSpacing: 'inherit',\n lineHeight: 'inherit',\n pointerEvents: 'none',\n transition: 'inherit',\n },\n expandIcon: {\n boxSizing: 'border-box',\n display: 'block',\n fill: '#000',\n height: '15px',\n transformOrigin: 'center',\n transitionDuration: '100ms',\n transitionProperty: 'transform',\n transitionTimingFunction: 'ease-out',\n width: '15px',\n },\n collapseIcon: {\n boxSizing: 'border-box',\n display: 'block',\n fill: '#000',\n height: '15px',\n transformOrigin: 'center',\n transitionDuration: '100ms',\n transitionProperty: 'transform',\n transitionTimingFunction: 'ease-out',\n width: '15px',\n },\n })\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "etudes",
3
- "version": "3.9.0",
3
+ "version": "3.9.1",
4
4
  "description": "A study of headless React components",
5
5
  "main": "lib",
6
6
  "scripts": {