@vitus-labs/attrs 1.0.1-alpha.6 → 1.1.0

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/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/hooks/useRef.ts","../src/utils/attrs.ts","../src/hoc/attrsHoc.tsx","../src/utils/statics.ts","../src/utils/chaining.ts","../src/utils/compose.ts","../src/attrs.tsx","../src/init.ts","../src/isAttrsComponent.tsx"],"sourcesContent":["import { useRef, useImperativeHandle, type ForwardedRef } from 'react'\n\ntype UseAttrsRef = (props: {\n $attrsRef?: ForwardedRef<unknown>\n ref?: ForwardedRef<unknown>\n}) => ForwardedRef<unknown>\n\nconst useAttrsStyleRef: UseAttrsRef = ({ $attrsRef, ref }) => {\n const internalRef = useRef(null)\n\n useImperativeHandle($attrsRef, () => internalRef.current)\n useImperativeHandle(ref, () => internalRef.current)\n\n return internalRef\n}\n\nexport default useAttrsStyleRef\n","/* eslint-disable no-param-reassign */\nimport { isEmpty } from '@vitus-labs/core'\n\n// --------------------------------------------------------\n// Remove undefined props\n// --------------------------------------------------------\ntype RemoveUndefinedProps = <T extends Record<string, any>>(\n props: T,\n) => { [I in keyof T as T[I] extends undefined ? never : I]: T[I] }\n\nexport const removeUndefinedProps: RemoveUndefinedProps = (props) =>\n Object.keys(props).reduce((acc, key) => {\n const currentValue = props[key]\n if (currentValue !== undefined) return { ...acc, [key]: currentValue }\n return acc\n }, {} as any)\n\n// --------------------------------------------------------\n// combine values\n// --------------------------------------------------------\ntype OptionFunc<A> = (...arg: A[]) => Record<string, unknown>\ntype CalculateChainOptions = <A>(\n options?: OptionFunc<A>[],\n) => (args: A[]) => ReturnType<OptionFunc<A>>\n\nexport const calculateChainOptions: CalculateChainOptions =\n (options) => (args) => {\n const result = {}\n if (!options || isEmpty(options)) return result\n\n return options.reduce((acc, item) => Object.assign(acc, item(...args)), {})\n }\n","import React, {\n forwardRef,\n type ForwardRefExoticComponent,\n type ComponentType,\n} from 'react'\nimport { calculateChainOptions, removeUndefinedProps } from '~/utils/attrs'\nimport type { Configuration } from '~/types/configuration'\n\nexport type AttrsStyleHOC = ({\n attrs,\n priorityAttrs,\n}: Pick<Configuration, 'attrs' | 'priorityAttrs'>) => (\n WrappedComponent: ComponentType<any>,\n) => ForwardRefExoticComponent<any>\n\nconst createAttrsHOC: AttrsStyleHOC = ({ attrs, priorityAttrs }) => {\n // --------------------------------------------------\n // .attrs(...)\n // first we need to calculate final props which are\n // being returned by using `attr` chaining method\n // --------------------------------------------------\n const calculateAttrs = calculateChainOptions(attrs)\n const calculatePriorityAttrs = calculateChainOptions(priorityAttrs)\n\n const attrsHoc = (WrappedComponent: ComponentType<any>) =>\n forwardRef<any, any>((props, ref) => {\n // --------------------------------------------------\n // remove undefined props not to override potential default props\n // only props with value (e.g. `null`) should override default props\n // --------------------------------------------------\n const filteredProps = removeUndefinedProps(props)\n\n const prioritizedAttrs = calculatePriorityAttrs([filteredProps])\n\n const finalAttrs = calculateAttrs([\n {\n ...prioritizedAttrs,\n ...filteredProps,\n },\n ])\n\n return (\n <WrappedComponent\n $attrsRef={ref}\n {...prioritizedAttrs}\n {...finalAttrs}\n {...filteredProps}\n />\n )\n })\n\n return attrsHoc\n}\n\nexport default createAttrsHOC\n","import { isEmpty } from '@vitus-labs/core'\n\n// --------------------------------------------------------\n// helpers for create statics on component\n// --------------------------------------------------------\ntype CreateStaticsEnhancers = (params: {\n context: Record<string, any>\n options: Record<string, any>\n}) => void\n\nexport const createStaticsEnhancers: CreateStaticsEnhancers = ({\n context,\n options,\n}) => {\n if (!isEmpty(options)) {\n Object.assign(context, options)\n }\n}\n","type Func = (...args: any) => Record<string, unknown>\ntype Obj = Record<string, unknown>\n\n// --------------------------------------------------------\n// Chain Options\n// --------------------------------------------------------\ntype ChainOptions = (\n opts: Obj | Func | undefined,\n defaultOpts: Func[],\n) => Func[]\n\nexport const chainOptions: ChainOptions = (opts, defaultOpts = []) => {\n const result = [...defaultOpts]\n\n if (typeof opts === 'function') result.push(opts)\n else if (typeof opts === 'object') result.push(() => opts)\n\n return result\n}\n","/* eslint-disable import/prefer-default-export */\ntype CalculateHocsFuncs = (\n options: Record<string, any>,\n) => ((arg: any) => any)[]\n\nexport const calculateHocsFuncs: CalculateHocsFuncs = (options = {}) =>\n Object.values(options)\n .filter((item) => typeof item === 'function')\n .reverse()\n","/* eslint-disable @typescript-eslint/ban-ts-comment */\n/* eslint-disable no-underscore-dangle */\nimport React, { forwardRef } from 'react'\nimport hoistNonReactStatics from 'hoist-non-react-statics'\nimport { pick, compose, omit } from '@vitus-labs/core'\nimport { useRef } from '~/hooks'\nimport { attrsHoc } from '~/hoc'\nimport { createStaticsEnhancers } from '~/utils/statics'\nimport { chainOptions } from '~/utils/chaining'\nimport { calculateHocsFuncs } from '~/utils/compose'\nimport { calculateChainOptions } from '~/utils/attrs'\nimport type {\n AttrsComponent as AttrsComponentType,\n ExoticComponent,\n InnerComponentProps,\n} from '~/types/AttrsComponent'\nimport type { InitAttrsComponent } from '~/types/InitAttrsComponent'\nimport type {\n Configuration,\n ExtendedConfiguration,\n} from '~/types/configuration'\n\n// --------------------------------------------------------\n// cloneAndEnhance\n// helper function which allows function chaining\n// always returns attrsComponent with static functions\n// assigned\n// --------------------------------------------------------\ntype CloneAndEnhance = (\n defaultOpts: Configuration,\n opts: Partial<ExtendedConfiguration>,\n) => ReturnType<typeof attrsComponent>\n\nconst cloneAndEnhance: CloneAndEnhance = (defaultOpts, opts) =>\n // @ts-ignore\n attrsComponent({\n ...defaultOpts,\n attrs: chainOptions(opts.attrs, defaultOpts.attrs),\n filterAttrs: [\n ...(defaultOpts.filterAttrs ?? []),\n ...(opts.filterAttrs ?? []),\n ],\n priorityAttrs: chainOptions(opts.priorityAttrs, defaultOpts.priorityAttrs),\n statics: { ...defaultOpts.statics, ...opts.statics },\n compose: { ...defaultOpts.compose, ...opts.compose },\n })\n\n// --------------------------------------------------------\n// styleComponent\n// helper function which allows function chaining\n// always returns a valid React component with static functions\n// assigned, so it can be even rendered as a valid component\n// or styles can be extended via its statics\n// --------------------------------------------------------\n// @ts-ignore\nconst attrsComponent: InitAttrsComponent = (options) => {\n const componentName =\n options.name ?? options.component.displayName ?? options.component.name\n\n // --------------------------------------------------------\n // COMPONENT - Final component to be rendered\n // --------------------------------------------------------\n const RenderComponent = options.component\n\n // --------------------------------------------------------\n // COMPOSE - high-order components\n // --------------------------------------------------------\n const hocsFuncs = [attrsHoc(options), ...calculateHocsFuncs(options.compose)]\n\n // --------------------------------------------------------\n // ENHANCED COMPONENT (returned component)\n // --------------------------------------------------------\n // .attrs() chaining option is calculated in HOC and passed as props already\n // eslint-disable-next-line react/display-name\n const EnhancedComponent: ExoticComponent<InnerComponentProps> = forwardRef(\n (\n {\n $attrsRef, // it's forwarded from HOC which is always on top of all hocs\n ...props\n },\n ref,\n ) => {\n // --------------------------------------------------\n // handle refs\n // (1) one is passed from inner HOC - $attrsStyleRef\n // (2) second one is used to be used directly (e.g. inside hocs)\n // --------------------------------------------------\n const internalRef = useRef({ $attrsRef, ref })\n\n // --------------------------------------------------\n // final props\n // final props passed to WrappedComponent\n // excluding: styling props\n // including: $attrsStyle, $attrsState\n // --------------------------------------------------\n const newProps: Record<string, any> = {\n // this removes styling state from props and passes its state\n // under attrsState key only\n ...props,\n ref: ref ?? $attrsRef ? internalRef : undefined,\n }\n\n const finalProps: Record<string, any> = omit(\n newProps,\n options.filterAttrs,\n )\n\n // all the development stuff injected\n if (process.env.NODE_ENV !== 'production') {\n finalProps['data-attrs'] = componentName\n }\n\n return <RenderComponent {...finalProps} />\n },\n )\n\n // ------------------------------------------------------\n // This will hoist and generate dynamically next static methods\n // for all dimensions available in configuration\n // ------------------------------------------------------\n const AttrsComponent: AttrsComponentType = compose(...hocsFuncs)(\n EnhancedComponent,\n )\n\n AttrsComponent.IS_ATTRS = true\n AttrsComponent.displayName = componentName\n\n hoistNonReactStatics(AttrsComponent, options.component)\n\n // ------------------------------------------------------\n AttrsComponent.IS_ATTRS = true\n AttrsComponent.displayName = componentName\n AttrsComponent.meta = {}\n // ------------------------------------------------------\n\n // ------------------------------------------------------\n // enhance for statics\n // ------------------------------------------------------\n createStaticsEnhancers({\n context: AttrsComponent.meta,\n options: options.statics,\n })\n\n // @ts-ignore\n AttrsComponent.attrs = (attrs, { priority, filter } = {}) => {\n const result: Record<string, any> = {}\n\n if (filter) {\n result.filterAttrs = filter\n }\n\n if (priority) {\n result.priorityAttrs = attrs as ExtendedConfiguration['priorityAttrs']\n\n return cloneAndEnhance(options, result)\n }\n\n result.attrs = attrs as ExtendedConfiguration['attrs']\n\n return cloneAndEnhance(options, result)\n }\n\n // @ts-ignore\n AttrsComponent.config = (opts = {}) => {\n const result = pick(opts)\n\n return cloneAndEnhance(options, result)\n }\n\n // @ts-ignore\n AttrsComponent.statics = (opts) =>\n // @ts-ignore\n cloneAndEnhance(options, { statics: opts })\n\n AttrsComponent.getDefaultAttrs = (props) =>\n calculateChainOptions(options.attrs)([props])\n\n return AttrsComponent\n}\n\nexport default attrsComponent\n","import { isEmpty } from '@vitus-labs/core'\nimport attrsComponent from '~/attrs'\nimport type { ElementType } from '~/types/utils'\nimport type { InitAttrsComponent } from '~/types/InitAttrsComponent'\n\nexport type Attrs = <C extends ElementType<any>>({\n name,\n component,\n}: {\n name: string\n component: C\n}) => ReturnType<InitAttrsComponent<C>>\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst attrs: Attrs = ({ name, component }) => {\n // --------------------------------------------------------\n // handle ERRORS in development mode\n // --------------------------------------------------------\n if (process.env.NODE_ENV !== 'production') {\n type Errors = Partial<{\n component: string\n name: string\n }>\n\n const errors: Errors = {}\n if (!component) {\n errors.component = 'Parameter `component` is missing in params!'\n }\n\n if (!name) {\n errors.name = 'Parameter `name` is missing in params!'\n }\n\n if (!isEmpty(errors)) {\n throw Error(JSON.stringify(errors))\n }\n }\n\n return attrsComponent({\n name,\n component,\n attrs: [],\n priorityAttrs: [],\n filterAttrs: [],\n compose: {},\n statics: {},\n })\n}\n\nexport default attrs\n","export type IsAttrsComponent = <T>(component: T) => boolean\n\nconst isAttrsComponent: IsAttrsComponent = (component) => {\n if (\n component &&\n typeof component === 'object' &&\n component !== null &&\n Object.prototype.hasOwnProperty.call(component, 'IS_ATTRS')\n ) {\n return true\n }\n\n return false\n}\n\nexport default isAttrsComponent\n"],"names":["attrsHoc","useRef"],"mappings":";;;;AAOA,MAAM,gBAAgB,GAAgB,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,KAAI;AAC3D,IAAA,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;IAEhC,mBAAmB,CAAC,SAAS,EAAE,MAAM,WAAW,CAAC,OAAO,CAAC,CAAA;IACzD,mBAAmB,CAAC,GAAG,EAAE,MAAM,WAAW,CAAC,OAAO,CAAC,CAAA;AAEnD,IAAA,OAAO,WAAW,CAAA;AACpB,CAAC;;ACdD;AAUO,MAAM,oBAAoB,GAAyB,CAAC,KAAK,KAC9D,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAI;AACrC,IAAA,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,CAAA;IAC/B,IAAI,YAAY,KAAK,SAAS;QAAE,OAAO,EAAE,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,YAAY,EAAE,CAAA;AACtE,IAAA,OAAO,GAAG,CAAA;AACZ,CAAC,EAAE,EAAS,CAAC,CAAA;AAUR,MAAM,qBAAqB,GAChC,CAAC,OAAO,KAAK,CAAC,IAAI,KAAI;IACpB,MAAM,MAAM,GAAG,EAAE,CAAA;AACjB,IAAA,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;AAAE,QAAA,OAAO,MAAM,CAAA;IAE/C,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAA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G,CAAC,QAAQ,KAAK,YAAY,EAAE;QAMzC,MAAM,MAAM,GAAW,EAAE,CAAA;QACzB,IAAI,CAAC,SAAS,EAAE;AACd,YAAA,MAAM,CAAC,SAAS,GAAG,6CAA6C,CAAA;SACjE;QAED,IAAI,CAAC,IAAI,EAAE;AACT,YAAA,MAAM,CAAC,IAAI,GAAG,wCAAwC,CAAA;SACvD;AAED,QAAA,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACpB,MAAM,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;SACpC;KACF;AAED,IAAA,OAAO,cAAc,CAAC;QACpB,IAAI;QACJ,SAAS;AACT,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,aAAa,EAAE,EAAE;AACjB,QAAA,WAAW,EAAE,EAAE;AACf,QAAA,OAAO,EAAE,EAAE;AACX,QAAA,OAAO,EAAE,EAAE;AACZ,KAAA,CAAC,CAAA;AACJ;;AC9CA,MAAM,gBAAgB,GAAqB,CAAC,SAAS,KAAI;AACvD,IAAA,IACE,SAAS;QACT,OAAO,SAAS,KAAK,QAAQ;AAC7B,QAAA,SAAS,KAAK,IAAI;AAClB,QAAA,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,EAC3D;AACA,QAAA,OAAO,IAAI,CAAA;KACZ;AAED,IAAA,OAAO,KAAK,CAAA;AACd;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/hooks/useRef.ts","../src/utils/attrs.ts","../src/hoc/attrsHoc.tsx","../src/utils/statics.ts","../src/utils/chaining.ts","../src/utils/compose.ts","../src/attrs.tsx","../src/init.ts","../src/isAttrsComponent.tsx"],"sourcesContent":["import { useRef, useImperativeHandle, type ForwardedRef } from 'react'\n\ntype UseAttrsRef = (props: {\n $attrsRef?: ForwardedRef<unknown>\n ref?: ForwardedRef<unknown>\n}) => ForwardedRef<unknown>\n\nconst useAttrsStyleRef: UseAttrsRef = ({ $attrsRef, ref }) => {\n const internalRef = useRef(null)\n\n useImperativeHandle($attrsRef, () => internalRef.current)\n useImperativeHandle(ref, () => internalRef.current)\n\n return internalRef\n}\n\nexport default useAttrsStyleRef\n","/* eslint-disable no-param-reassign */\nimport { isEmpty } from '@vitus-labs/core'\n\n// --------------------------------------------------------\n// Remove undefined props\n// --------------------------------------------------------\ntype RemoveUndefinedProps = <T extends Record<string, any>>(\n props: T,\n) => { [I in keyof T as T[I] extends undefined ? never : I]: T[I] }\n\nexport const removeUndefinedProps: RemoveUndefinedProps = (props) =>\n Object.keys(props).reduce((acc, key) => {\n const currentValue = props[key]\n if (currentValue !== undefined) return { ...acc, [key]: currentValue }\n return acc\n }, {} as any)\n\n// --------------------------------------------------------\n// combine values\n// --------------------------------------------------------\ntype OptionFunc<A> = (...arg: A[]) => Record<string, unknown>\ntype CalculateChainOptions = <A>(\n options?: OptionFunc<A>[],\n) => (args: A[]) => ReturnType<OptionFunc<A>>\n\nexport const calculateChainOptions: CalculateChainOptions =\n (options) => (args) => {\n const result = {}\n if (!options || isEmpty(options)) return result\n\n return options.reduce((acc, item) => Object.assign(acc, item(...args)), {})\n }\n","import React, {\n forwardRef,\n type ForwardRefExoticComponent,\n type ComponentType,\n} from 'react'\nimport { calculateChainOptions, removeUndefinedProps } from '~/utils/attrs'\nimport type { Configuration } from '~/types/configuration'\n\nexport type AttrsStyleHOC = ({\n attrs,\n priorityAttrs,\n}: Pick<Configuration, 'attrs' | 'priorityAttrs'>) => (\n WrappedComponent: ComponentType<any>,\n) => ForwardRefExoticComponent<any>\n\nconst createAttrsHOC: AttrsStyleHOC = ({ attrs, priorityAttrs }) => {\n // --------------------------------------------------\n // .attrs(...)\n // first we need to calculate final props which are\n // being returned by using `attr` chaining method\n // --------------------------------------------------\n const calculateAttrs = calculateChainOptions(attrs)\n const calculatePriorityAttrs = calculateChainOptions(priorityAttrs)\n\n const attrsHoc = (WrappedComponent: ComponentType<any>) =>\n forwardRef<any, any>((props, ref) => {\n // --------------------------------------------------\n // remove undefined props not to override potential default props\n // only props with value (e.g. `null`) should override default props\n // --------------------------------------------------\n const filteredProps = removeUndefinedProps(props)\n\n const prioritizedAttrs = calculatePriorityAttrs([filteredProps])\n\n const finalAttrs = calculateAttrs([\n {\n ...prioritizedAttrs,\n ...filteredProps,\n },\n ])\n\n return (\n <WrappedComponent\n $attrsRef={ref}\n {...prioritizedAttrs}\n {...finalAttrs}\n {...filteredProps}\n />\n )\n })\n\n return attrsHoc\n}\n\nexport default createAttrsHOC\n","import { isEmpty } from '@vitus-labs/core'\n\n// --------------------------------------------------------\n// helpers for create statics on component\n// --------------------------------------------------------\ntype CreateStaticsEnhancers = (params: {\n context: Record<string, any>\n options: Record<string, any>\n}) => void\n\nexport const createStaticsEnhancers: CreateStaticsEnhancers = ({\n context,\n options,\n}) => {\n if (!isEmpty(options)) {\n Object.assign(context, options)\n }\n}\n","type Func = (...args: any) => Record<string, unknown>\ntype Obj = Record<string, unknown>\n\n// --------------------------------------------------------\n// Chain Options\n// --------------------------------------------------------\ntype ChainOptions = (\n opts: Obj | Func | undefined,\n defaultOpts: Func[],\n) => Func[]\n\nexport const chainOptions: ChainOptions = (opts, defaultOpts = []) => {\n const result = [...defaultOpts]\n\n if (typeof opts === 'function') result.push(opts)\n else if (typeof opts === 'object') result.push(() => opts)\n\n return result\n}\n","/* eslint-disable import/prefer-default-export */\ntype CalculateHocsFuncs = (\n options: Record<string, any>,\n) => ((arg: any) => any)[]\n\nexport const calculateHocsFuncs: CalculateHocsFuncs = (options = {}) =>\n Object.values(options)\n .filter((item) => typeof item === 'function')\n .reverse()\n","/* eslint-disable @typescript-eslint/ban-ts-comment */\n/* eslint-disable no-underscore-dangle */\nimport React, { forwardRef } from 'react'\nimport hoistNonReactStatics from 'hoist-non-react-statics'\nimport { pick, compose, omit } from '@vitus-labs/core'\nimport { useRef } from '~/hooks'\nimport { attrsHoc } from '~/hoc'\nimport { createStaticsEnhancers } from '~/utils/statics'\nimport { chainOptions } from '~/utils/chaining'\nimport { calculateHocsFuncs } from '~/utils/compose'\nimport { calculateChainOptions } from '~/utils/attrs'\nimport type {\n AttrsComponent as AttrsComponentType,\n ExoticComponent,\n InnerComponentProps,\n} from '~/types/AttrsComponent'\nimport type { InitAttrsComponent } from '~/types/InitAttrsComponent'\nimport type {\n Configuration,\n ExtendedConfiguration,\n} from '~/types/configuration'\n\n// --------------------------------------------------------\n// cloneAndEnhance\n// helper function which allows function chaining\n// always returns attrsComponent with static functions\n// assigned\n// --------------------------------------------------------\ntype CloneAndEnhance = (\n defaultOpts: Configuration,\n opts: Partial<ExtendedConfiguration>,\n) => ReturnType<typeof attrsComponent>\n\nconst cloneAndEnhance: CloneAndEnhance = (defaultOpts, opts) =>\n // @ts-ignore\n attrsComponent({\n ...defaultOpts,\n attrs: chainOptions(opts.attrs, defaultOpts.attrs),\n filterAttrs: [\n ...(defaultOpts.filterAttrs ?? []),\n ...(opts.filterAttrs ?? []),\n ],\n priorityAttrs: chainOptions(opts.priorityAttrs, defaultOpts.priorityAttrs),\n statics: { ...defaultOpts.statics, ...opts.statics },\n compose: { ...defaultOpts.compose, ...opts.compose },\n })\n\n// --------------------------------------------------------\n// styleComponent\n// helper function which allows function chaining\n// always returns a valid React component with static functions\n// assigned, so it can be even rendered as a valid component\n// or styles can be extended via its statics\n// --------------------------------------------------------\n// @ts-ignore\nconst attrsComponent: InitAttrsComponent = (options) => {\n const componentName =\n options.name ?? options.component.displayName ?? options.component.name\n\n // --------------------------------------------------------\n // COMPONENT - Final component to be rendered\n // --------------------------------------------------------\n const RenderComponent = options.component\n\n // --------------------------------------------------------\n // COMPOSE - high-order components\n // --------------------------------------------------------\n const hocsFuncs = [attrsHoc(options), ...calculateHocsFuncs(options.compose)]\n\n // --------------------------------------------------------\n // ENHANCED COMPONENT (returned component)\n // --------------------------------------------------------\n // .attrs() chaining option is calculated in HOC and passed as props already\n // eslint-disable-next-line react/display-name\n const EnhancedComponent: ExoticComponent<InnerComponentProps> = forwardRef(\n (\n {\n $attrsRef, // it's forwarded from HOC which is always on top of all hocs\n ...props\n },\n ref,\n ) => {\n // --------------------------------------------------\n // handle refs\n // (1) one is passed from inner HOC - $attrsStyleRef\n // (2) second one is used to be used directly (e.g. inside hocs)\n // --------------------------------------------------\n const internalRef = useRef({ $attrsRef, ref })\n\n // --------------------------------------------------\n // final props\n // final props passed to WrappedComponent\n // excluding: styling props\n // including: $attrsStyle, $attrsState\n // --------------------------------------------------\n const newProps: Record<string, any> = {\n // this removes styling state from props and passes its state\n // under attrsState key only\n ...props,\n ref: ref ?? $attrsRef ? internalRef : undefined,\n }\n\n const finalProps: Record<string, any> = omit(\n newProps,\n options.filterAttrs,\n )\n\n // all the development stuff injected\n if (process.env.NODE_ENV !== 'production') {\n finalProps['data-attrs'] = componentName\n }\n\n return <RenderComponent {...finalProps} />\n },\n )\n\n // ------------------------------------------------------\n // This will hoist and generate dynamically next static methods\n // for all dimensions available in configuration\n // ------------------------------------------------------\n const AttrsComponent: AttrsComponentType = compose(...hocsFuncs)(\n EnhancedComponent,\n )\n\n AttrsComponent.IS_ATTRS = true\n AttrsComponent.displayName = componentName\n\n hoistNonReactStatics(AttrsComponent, options.component)\n\n // ------------------------------------------------------\n AttrsComponent.IS_ATTRS = true\n AttrsComponent.displayName = componentName\n AttrsComponent.meta = {}\n // ------------------------------------------------------\n\n // ------------------------------------------------------\n // enhance for statics\n // ------------------------------------------------------\n createStaticsEnhancers({\n context: AttrsComponent.meta,\n options: options.statics,\n })\n\n // @ts-ignore\n AttrsComponent.attrs = (attrs, { priority, filter } = {}) => {\n const result: Record<string, any> = {}\n\n if (filter) {\n result.filterAttrs = filter\n }\n\n if (priority) {\n result.priorityAttrs = attrs as ExtendedConfiguration['priorityAttrs']\n\n return cloneAndEnhance(options, result)\n }\n\n result.attrs = attrs as ExtendedConfiguration['attrs']\n\n return cloneAndEnhance(options, result)\n }\n\n // @ts-ignore\n AttrsComponent.config = (opts = {}) => {\n const result = pick(opts)\n\n return cloneAndEnhance(options, result)\n }\n\n // @ts-ignore\n AttrsComponent.statics = (opts) =>\n // @ts-ignore\n cloneAndEnhance(options, { statics: opts })\n\n AttrsComponent.getDefaultAttrs = (props) =>\n calculateChainOptions(options.attrs)([props])\n\n return AttrsComponent\n}\n\nexport default attrsComponent\n","import { isEmpty } from '@vitus-labs/core'\nimport attrsComponent from '~/attrs'\nimport type { ElementType } from '~/types/utils'\nimport type { InitAttrsComponent } from '~/types/InitAttrsComponent'\n\nexport type Attrs = <C extends ElementType<any>>({\n name,\n component,\n}: {\n name: string\n component: C\n}) => ReturnType<InitAttrsComponent<C>>\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst attrs: Attrs = ({ name, component }) => {\n // --------------------------------------------------------\n // handle ERRORS in development mode\n // --------------------------------------------------------\n if (process.env.NODE_ENV !== 'production') {\n type Errors = Partial<{\n component: string\n name: string\n }>\n\n const errors: Errors = {}\n if (!component) {\n errors.component = 'Parameter `component` is missing in params!'\n }\n\n if (!name) {\n errors.name = 'Parameter `name` is missing in params!'\n }\n\n if (!isEmpty(errors)) {\n throw Error(JSON.stringify(errors))\n }\n }\n\n return attrsComponent({\n name,\n component,\n attrs: [],\n priorityAttrs: [],\n filterAttrs: [],\n compose: {},\n statics: {},\n })\n}\n\nexport default attrs\n","export type IsAttrsComponent = <T>(component: T) => boolean\n\nconst isAttrsComponent: IsAttrsComponent = (component) => {\n if (\n component &&\n typeof component === 'object' &&\n component !== null &&\n Object.prototype.hasOwnProperty.call(component, 'IS_ATTRS')\n ) {\n return true\n }\n\n return false\n}\n\nexport default isAttrsComponent\n"],"names":["attrsHoc","useRef"],"mappings":";;;;AAOA,MAAM,gBAAgB,GAAgB,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,KAAI;AAC3D,IAAA,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC;IAEhC,mBAAmB,CAAC,SAAS,EAAE,MAAM,WAAW,CAAC,OAAO,C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AK;AACd;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitus-labs/attrs",
3
- "version": "1.0.1-alpha.6",
3
+ "version": "1.1.0",
4
4
  "license": "MIT",
5
5
  "author": "Vit Bokisch <vit@bokisch.cz>",
6
6
  "maintainers": [
@@ -56,13 +56,13 @@
56
56
  "hoist-non-react-statics": "^3.3.2"
57
57
  },
58
58
  "devDependencies": {
59
- "@types/hoist-non-react-statics": "^3.3.5",
60
- "@vitus-labs/core": "1.0.1-alpha.6",
61
- "@vitus-labs/tools-babel": "^1.3.0",
62
- "@vitus-labs/tools-rollup": "^1.3.0",
63
- "@vitus-labs/tools-storybook": "^1.3.0",
64
- "@vitus-labs/tools-types": "^1.3.0",
65
- "@vitus-labs/tools-typescript": "^1.3.0"
59
+ "@types/hoist-non-react-statics": "^3.3.6",
60
+ "@vitus-labs/core": "1.1.0",
61
+ "@vitus-labs/tools-babel": "^1.4.0",
62
+ "@vitus-labs/tools-rollup": "^1.4.0",
63
+ "@vitus-labs/tools-storybook": "^1.4.0",
64
+ "@vitus-labs/tools-types": "^1.4.0",
65
+ "@vitus-labs/tools-typescript": "^1.4.0"
66
66
  },
67
- "gitHead": "6647fd081cc46ace03870c20d0c6c3323f36af14"
67
+ "gitHead": "e6bc0892a141e3a015d03d231fbc57095373ec24"
68
68
  }