How to use the cnbuilder function in cnbuilder

To help you get started, we’ve selected a few cnbuilder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xobotyi / react-scrollbars-custom / tests / Scrollbar.spec.tsx View on Github external
renderer: props => (
              <span style="{props.style}">
            )
          }}</span>
github xobotyi / react-scrollbars-custom / tests / Scrollbar.spec.tsx View on Github external
renderer: props =&gt; (
              <span style="{props.style}">
            )
          }}</span>
github xobotyi / react-scrollbars-custom / tests / Scrollbar.spec.tsx View on Github external
renderer: props =&gt; (
              <span style="{props.style}">
            )
          }}</span>
github xobotyi / react-scrollbars-custom / tests / Scrollbar.spec.tsx View on Github external
renderer: props =&gt; (
              <span style="{props.style}">
            )
          }}</span>
github xobotyi / react-scrollbars-custom / tests / Scrollbar.spec.tsx View on Github external
renderer: props =&gt; (
              <span style="{props.style}">
            )
          }}</span>
github xobotyi / react-scrollbars-custom / tests / Scrollbar.spec.tsx View on Github external
renderer: props =&gt; (
              <span style="{props.style}">
            )
          }}</span>
github xobotyi / react-scrollbars-custom / src / Scrollbar.tsx View on Github external
const contentProps = {
      ...propsContentProps,
      key: "ScrollbarsCustom-Content",
      className: cnb("ScrollbarsCustom-Content", propsContentProps!.className),
      style: styles.content,
      children: createContext ? (
        
      ) : (
        children
      )
    } as ElementPropsWithElementRefAndRenderer;

    const scrollerProps = {
      ...propsScrollerProps,
      key: "ScrollbarsCustom-Scroller",
      className: cnb("ScrollbarsCustom-Scroller", propsScrollerProps!.className),
      style: styles.scroller,
      children: renderDivWithRenderer(contentProps, this.elementRefContent),
      onScroll: this.handleScrollerScroll
    } as ElementPropsWithElementRefAndRenderer;

    const wrapperProps = {
      ...propsWrapperProps,
      key: "ScrollbarsCustom-Wrapper",
      className: cnb("ScrollbarsCustom-Wrapper", propsWrapperProps!.className),
      style: styles.wrapper,
      children: renderDivWithRenderer(scrollerProps, this.elementRefScroller)
    } as ElementPropsWithElementRefAndRenderer;

    holderChildren.push(renderDivWithRenderer(wrapperProps, this.elementRefWrapper));

    if (this.state.trackYVisible || (!removeTracksWhenNotUsed &amp;&amp; !removeTrackYWhenNotUsed)) {
github xobotyi / react-scrollbars-custom / src / Scrollbar.tsx View on Github external
)
    } as ElementPropsWithElementRefAndRenderer;

    const scrollerProps = {
      ...propsScrollerProps,
      key: "ScrollbarsCustom-Scroller",
      className: cnb("ScrollbarsCustom-Scroller", propsScrollerProps!.className),
      style: styles.scroller,
      children: renderDivWithRenderer(contentProps, this.elementRefContent),
      onScroll: this.handleScrollerScroll
    } as ElementPropsWithElementRefAndRenderer;

    const wrapperProps = {
      ...propsWrapperProps,
      key: "ScrollbarsCustom-Wrapper",
      className: cnb("ScrollbarsCustom-Wrapper", propsWrapperProps!.className),
      style: styles.wrapper,
      children: renderDivWithRenderer(scrollerProps, this.elementRefScroller)
    } as ElementPropsWithElementRefAndRenderer;

    holderChildren.push(renderDivWithRenderer(wrapperProps, this.elementRefWrapper));

    if (this.state.trackYVisible || (!removeTracksWhenNotUsed && !removeTrackYWhenNotUsed)) {
      const thumbYProps = {
        ...propsThumbYProps,
        key: "ScrollbarsCustom-ThumbY",
        style: styles.thumbY,
        elementRef: this.elementRefThumbY,
        onDrag: this.handleThumbYDrag,
        onDragEnd: this.handleThumbYDrag,
        axis: AXIS_DIRECTION.Y
      } as ScrollbarThumbProps;
github xobotyi / react-scrollbars-custom / src / Scrollbar.tsx View on Github external
children: renderDivWithRenderer(contentProps, this.elementRefContent),
        renderer: propsScrollerProps!.renderer,
        elementRef: propsScrollerProps!.elementRef
      } as ElementPropsWithElementRefAndRenderer;

      return renderDivWithRenderer(scrollerProps, this.elementRefScroller);
    }

    const styles = Scrollbar.calculateStyles(this.props, this.state, this.scrollValues, scrollbarWidth);

    const holderChildren = [] as Array;

    const contentProps = {
      ...propsContentProps,
      key: "ScrollbarsCustom-Content",
      className: cnb("ScrollbarsCustom-Content", propsContentProps!.className),
      style: styles.content,
      children: createContext ? (
        
      ) : (
        children
      )
    } as ElementPropsWithElementRefAndRenderer;

    const scrollerProps = {
      ...propsScrollerProps,
      key: "ScrollbarsCustom-Scroller",
      className: cnb("ScrollbarsCustom-Scroller", propsScrollerProps!.className),
      style: styles.scroller,
      children: renderDivWithRenderer(contentProps, this.elementRefContent),
      onScroll: this.handleScrollerScroll
    } as ElementPropsWithElementRefAndRenderer;
github xobotyi / react-scrollbars-custom / src / Scrollbar.tsx View on Github external
...((disableTracksMousewheelScrolling || disableTrackXMousewheelScrolling) &amp;&amp; {
          onWheel: this.handleTrackXMouseWheel
        }),
        axis: AXIS_DIRECTION.X
      } as ScrollbarTrackProps;

      trackXProps.children = ;
      holderChildren.push();
    } else {
      this.elementRefTrackX(null);
      this.elementRefThumbX(null);
    }

    const holderProps = {
      ...propsHolderProps,
      className: cnb(
        "ScrollbarsCustom",
        this.state.trackYVisible &amp;&amp; "trackYVisible",
        this.state.trackXVisible &amp;&amp; "trackXVisible",
        this.state.isRTL &amp;&amp; "rtl",
        propsHolderProps.className
      ),
      style: styles.holder,
      children: holderChildren
    } as ElementPropsWithElementRefAndRenderer;

    return renderDivWithRenderer(holderProps, this.elementRefHolder);
  }

cnbuilder

Yet another classname string builder (the fastest one)

MIT
Latest version published 2 years ago

Package Health Score

50 / 100
Full package analysis

Popular cnbuilder functions