@primereact/hooks 11.0.0-alpha.8 → 11.0.0-rc.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.
Files changed (48) hide show
  1. package/LICENSE.md +45 -0
  2. package/README.md +34 -0
  3. package/index.d.ts +9 -0
  4. package/index.mjs +1 -1
  5. package/index.mjs.map +1 -1
  6. package/package.json +8 -12
  7. package/use-controlled-state/index.mjs +1 -1
  8. package/use-controlled-state/index.mjs.map +1 -1
  9. package/use-filter/_matchers.d.ts +23 -0
  10. package/use-filter/index.d.ts +94 -0
  11. package/use-filter/index.mjs +2 -0
  12. package/use-filter/index.mjs.map +1 -0
  13. package/use-hot-key/index.d.ts +25 -0
  14. package/use-hot-key/index.mjs +2 -0
  15. package/use-hot-key/index.mjs.map +1 -0
  16. package/use-is-mobile/index.d.ts +18 -0
  17. package/use-is-mobile/index.mjs +2 -0
  18. package/use-is-mobile/index.mjs.map +1 -0
  19. package/use-local-storage/index.d.ts +56 -0
  20. package/use-local-storage/index.mjs +2 -0
  21. package/use-local-storage/index.mjs.map +1 -0
  22. package/use-mask/index.d.ts +96 -67
  23. package/use-mask/index.mjs +1 -1
  24. package/use-mask/index.mjs.map +1 -1
  25. package/use-mounted/index.d.ts +36 -0
  26. package/use-mounted/index.mjs +2 -0
  27. package/use-mounted/index.mjs.map +1 -0
  28. package/use-number-formatter/index.d.ts +194 -0
  29. package/use-number-formatter/index.mjs +2 -0
  30. package/use-number-formatter/index.mjs.map +1 -0
  31. package/use-number-formatter/index.test.d.ts +0 -0
  32. package/use-presence/index.d.ts +1 -2
  33. package/use-presence/index.mjs +1 -1
  34. package/use-presence/index.mjs.map +1 -1
  35. package/use-props/index.d.ts +16 -11
  36. package/use-props/index.mjs +1 -1
  37. package/use-props/index.mjs.map +1 -1
  38. package/use-queue-task/index.d.ts +1 -0
  39. package/use-queue-task/index.mjs +2 -0
  40. package/use-queue-task/index.mjs.map +1 -0
  41. package/use-queue-task/index.test.d.ts +0 -0
  42. package/use-sortable-list/index.d.ts +43 -0
  43. package/use-sortable-list/index.mjs +2 -0
  44. package/use-sortable-list/index.mjs.map +1 -0
  45. package/use-tree-filter/index.d.ts +52 -0
  46. package/use-tree-filter/index.mjs +2 -0
  47. package/use-tree-filter/index.mjs.map +1 -0
  48. package/LICENSE +0 -21
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/use-tree-filter/index.ts"],"sourcesContent":["'use client';\nimport { useControlledState } from '@primereact/hooks/use-controlled-state';\nimport { BUILT_IN_MATCHERS, getGlobalMatchers, matchRule, registerMatcher, ruleHasValue, unregisterMatcher, type BuiltInMatchMode, type FilterMatcher, type FilterRule } from '@primereact/hooks/use-filter';\nimport { resolveFieldData } from '@primeuix/utils/object';\nimport * as React from 'react';\n\nexport { registerMatcher, unregisterMatcher };\n\nexport type TreeFilterMode = 'lenient' | 'strict';\n\nexport interface TreeNodeLike {\n key?: string | number;\n data?: Record<string, unknown>;\n children?: TreeNodeLike[];\n}\n\nexport interface UseTreeFilterOptions<TNode extends TreeNodeLike, TMode extends string = BuiltInMatchMode> {\n nodes: TNode[];\n rules?: FilterRule<TMode>[];\n defaultRules?: FilterRule<TMode>[];\n /**\n * Shorthand for the single-field case. When set, the hook synthesizes a single\n * `{ field, value, matchMode }` rule. Ignored when `rules` / `defaultRules` is provided.\n */\n field?: string | string[];\n /** Controlled value for the shorthand `field`. Omit to let the hook own the state. */\n value?: unknown;\n /** Initial value when the hook owns the state. */\n defaultValue?: unknown;\n /** Fires when the shorthand `value` changes. */\n onValueChange?: (value: unknown) => void;\n /** Match mode for the shorthand `field`. Defaults to `'contains'`. */\n matchMode?: TMode;\n matchers?: Partial<Record<TMode, FilterMatcher>> & Record<string, FilterMatcher>;\n filterMode?: TreeFilterMode;\n filterLocale?: string;\n filterDelay?: number;\n /** When true, `filteredNodes` is returned as-is; the consumer fetches filtered data itself. */\n lazy?: boolean;\n /** Fires after rules settle (honours `filterDelay`). The consumer is expected to fetch filtered tree data. */\n onLazyLoad?: (event: LazyTreeFilterEvent<TMode>) => void;\n onRulesChange?: (rules: FilterRule<TMode>[]) => void;\n}\n\nexport interface LazyTreeFilterEvent<TMode extends string = string> {\n rules: FilterRule<TMode>[];\n filterMode: TreeFilterMode;\n filterLocale?: string;\n}\n\nexport interface UseTreeFilterReturn<TNode extends TreeNodeLike, TMode extends string = string> {\n rules: FilterRule<TMode>[];\n filteredNodes: TNode[];\n isFiltered: boolean;\n setRules: (rules: FilterRule<TMode>[]) => void;\n value: unknown;\n setValue: (value: unknown) => void;\n clearAll: () => void;\n match: (node: TNode) => boolean;\n matchers: Readonly<Record<string, FilterMatcher>>;\n}\n\nfunction nodeTarget<TNode extends TreeNodeLike>(node: TNode, field: string): unknown {\n // Prefer `node.data` (DataTable-style node) when it's an object that owns the\n // field, otherwise fall back to the node itself (Tree-style where fields like\n // `label` live at the top level). `node.data` may also be a primitive (string\n // / number) — guard against that before using `in`.\n const dataIsObject = node.data !== null && typeof node.data === 'object';\n\n if (dataIsObject && field in (node.data as object)) {\n return (node.data as Record<string, unknown>)[field];\n }\n\n if (dataIsObject) {\n const fromData = resolveFieldData(node.data as Record<string, unknown>, field);\n\n if (fromData !== undefined) return fromData;\n }\n\n if (field in (node as Record<string, unknown>)) return (node as Record<string, unknown>)[field];\n\n return resolveFieldData(node as unknown as Record<string, unknown>, field);\n}\n\nfunction isLeaf(node: TreeNodeLike): boolean {\n return !node.children || node.children.length === 0;\n}\n\nfunction nodeMatchesDirect<TNode extends TreeNodeLike, TMode extends string>(node: TNode, rule: FilterRule<TMode>, matchers: Record<string, FilterMatcher>, locale: string | undefined): boolean {\n const fields = Array.isArray(rule.field) ? rule.field : [rule.field];\n const projected: Record<string, unknown> = {};\n\n for (const f of fields) projected[f] = nodeTarget(node, f);\n\n return matchRule(projected, { ...rule, field: fields } as FilterRule<TMode>, matchers, locale);\n}\n\nfunction filterTree<TNode extends TreeNodeLike, TMode extends string>(nodes: TNode[], rules: FilterRule<TMode>[], matchers: Record<string, FilterMatcher>, locale: string | undefined, strict: boolean): TNode[] {\n const out: TNode[] = [];\n\n for (const node of nodes) {\n const selfMatch = rules.every((rule) => nodeMatchesDirect(node, rule, matchers, locale));\n\n let childMatched: TNode[] | null = null;\n\n if (node.children && node.children.length > 0) {\n const kidsFiltered = filterTree(node.children as TNode[], rules, matchers, locale, strict);\n\n if (kidsFiltered.length > 0) childMatched = kidsFiltered;\n }\n\n // lenient: self match or any descendant match → keep (all original children)\n // strict: leaf → must self-match; parent → must have a matching descendant\n if (strict) {\n if (isLeaf(node)) {\n if (selfMatch) out.push(node);\n } else if (childMatched) {\n out.push({ ...node, children: childMatched } as TNode);\n }\n } else {\n if (selfMatch) {\n out.push(node);\n } else if (childMatched) {\n out.push({ ...node, children: childMatched } as TNode);\n }\n }\n }\n\n return out;\n}\n\nexport function useTreeFilter<TNode extends TreeNodeLike, TMode extends string = BuiltInMatchMode>(options: UseTreeFilterOptions<TNode, TMode>): UseTreeFilterReturn<TNode, TMode> {\n // ---- Shorthand mode (field / value / matchMode) -------------------------\n // Active only when `field` is provided AND no explicit `rules` / `defaultRules`.\n // `value` can be controlled (parent owns) or uncontrolled (hook owns via defaultValue).\n const isShorthand = options.field !== undefined && options.rules === undefined && options.defaultRules === undefined;\n const shorthandMatchMode = (options.matchMode ?? ('contains' as TMode)) as TMode;\n\n const [shorthandValue, setShorthandValue] = useControlledState<unknown, unknown>({\n value: options.value,\n defaultValue: options.defaultValue,\n onChange: options.onValueChange\n });\n\n const setValue = React.useCallback((next: unknown) => setShorthandValue(next), [setShorthandValue]);\n\n // ---- Rule-array mode (existing API) -------------------------------------\n const isControlled = options.rules !== undefined;\n const [internalRules, setInternalRules] = React.useState<FilterRule<TMode>[]>(options.defaultRules ?? []);\n\n const shorthandRules = React.useMemo<FilterRule<TMode>[]>(() => {\n if (!isShorthand) return [];\n\n return [{ field: options.field as string | string[], value: shorthandValue, matchMode: shorthandMatchMode } as FilterRule<TMode>];\n }, [isShorthand, options.field, shorthandValue, shorthandMatchMode]);\n\n const currentRules = isShorthand ? shorthandRules : isControlled ? (options.rules ?? []) : internalRules;\n\n const onRulesChangeRef = React.useRef(options.onRulesChange);\n\n onRulesChangeRef.current = options.onRulesChange;\n\n const commit = React.useCallback(\n (next: FilterRule<TMode>[]) => {\n if (isShorthand) {\n // In shorthand mode, the only mutable surface is `value`.\n setShorthandValue((next[0] as FilterRule<TMode> | undefined)?.value ?? null);\n } else if (!isControlled) {\n setInternalRules(next);\n }\n\n onRulesChangeRef.current?.(next);\n },\n [isShorthand, isControlled, setShorthandValue]\n );\n\n const filterLocale = options.filterLocale;\n const filterDelay = options.filterDelay ?? 0;\n const filterMode = options.filterMode ?? 'lenient';\n\n const matchers = React.useMemo<Record<string, FilterMatcher>>(() => ({ ...(BUILT_IN_MATCHERS as Record<string, FilterMatcher>), ...getGlobalMatchers(), ...(options.matchers ?? {}) }), [options.matchers]);\n\n const [debouncedRules, setDebouncedRules] = React.useState<FilterRule<TMode>[]>(currentRules);\n\n React.useEffect(() => {\n if (filterDelay <= 0) return;\n\n const t = setTimeout(() => setDebouncedRules(currentRules), filterDelay);\n\n return () => clearTimeout(t);\n }, [currentRules, filterDelay]);\n\n const activeRules = filterDelay > 0 ? debouncedRules : currentRules;\n const activeRulesNonEmpty = React.useMemo(() => activeRules.filter(ruleHasValue), [activeRules]);\n\n const match = React.useCallback((node: TNode) => activeRulesNonEmpty.every((rule) => nodeMatchesDirect(node, rule, matchers, filterLocale)), [activeRulesNonEmpty, matchers, filterLocale]);\n\n const lazy = !!options.lazy;\n\n const filteredNodes = React.useMemo(() => {\n if (lazy) return options.nodes;\n\n if (activeRulesNonEmpty.length === 0) return options.nodes;\n\n return filterTree(options.nodes, activeRulesNonEmpty, matchers, filterLocale, filterMode === 'strict');\n }, [lazy, options.nodes, activeRulesNonEmpty, matchers, filterLocale, filterMode]);\n\n const onLazyLoadRef = React.useRef(options.onLazyLoad);\n\n onLazyLoadRef.current = options.onLazyLoad;\n\n const lastLazyKeyRef = React.useRef<string | null>(null);\n\n React.useEffect(() => {\n if (!lazy) return;\n\n const key = JSON.stringify(activeRules) + '|' + filterMode;\n\n if (lastLazyKeyRef.current === key) return;\n\n lastLazyKeyRef.current = key;\n onLazyLoadRef.current?.({ rules: activeRules, filterMode, filterLocale });\n }, [lazy, activeRules, filterMode, filterLocale]);\n\n const setRules = React.useCallback((next: FilterRule<TMode>[]) => commit(next), [commit]);\n\n const clearAll = React.useCallback(() => {\n const next = currentRules.map((r) =>\n Array.isArray((r as { constraints?: unknown }).constraints) ? { ...r, constraints: (r as { constraints: { value: unknown; matchMode?: TMode }[] }).constraints.map((c) => ({ ...c, value: null })) } : { ...r, value: null }\n ) as FilterRule<TMode>[];\n\n commit(next);\n }, [currentRules, commit]);\n\n return {\n rules: currentRules,\n filteredNodes,\n isFiltered: activeRulesNonEmpty.length > 0,\n setRules,\n value: shorthandValue,\n setValue,\n clearAll,\n match,\n matchers\n };\n}\n"],"mappings":"0bACA,OAAS,sBAAAA,MAA0B,yCACnC,OAAS,qBAAAC,EAAmB,qBAAAC,EAAmB,aAAAC,EAAW,mBAAAC,GAAiB,gBAAAC,GAAc,qBAAAC,OAAqF,+BAC9K,OAAS,oBAAAC,MAAwB,yBACjC,UAAYC,MAAW,QA0DvB,SAASC,GAAuCC,EAAaC,EAAwB,CAKjF,IAAMC,EAAeF,EAAK,OAAS,MAAQ,OAAOA,EAAK,MAAS,SAEhE,GAAIE,GAAgBD,KAAUD,EAAK,KAC/B,OAAQA,EAAK,KAAiCC,CAAK,EAGvD,GAAIC,EAAc,CACd,IAAMC,EAAWC,EAAiBJ,EAAK,KAAiCC,CAAK,EAE7E,GAAIE,IAAa,OAAW,OAAOA,CACvC,CAEA,OAAIF,KAAUD,EAA0CA,EAAiCC,CAAK,EAEvFG,EAAiBJ,EAA4CC,CAAK,CAC7E,CAEA,SAASI,GAAOL,EAA6B,CACzC,MAAO,CAACA,EAAK,UAAYA,EAAK,SAAS,SAAW,CACtD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K,EAAa,IAAKsB,GAC3B,MAAM,QAASA,EAAgC,WAAW,EAAIlD,EAAAC,EAAA,GAAKiD,GAAL,CAAQ,YAAcA,EAA+D,YAAY,IAAKC,GAAOnD,EAAAC,EAAA,GAAKkD,GAAL,CAAQ,MAAO,IAAK,EAAE,CAAE,GAAInD,EAAAC,EAAA,GAAKiD,GAAL,CAAQ,MAAO,IAAK,EAC/N,EAEApB,EAAOP,CAAI,CACf,EAAG,CAACK,EAAcE,CAAM,CAAC,EAEzB,MAAO,CACH,MAAOF,EACP,cAAAgB,EACA,WAAYJ,EAAoB,OAAS,EACzC,SAAAQ,EACA,MAAO7B,EACP,SAAAG,EACA,SAAA2B,EACA,MAAAP,EACA,SAAAhD,CACJ,CACJ","names":["useControlledState","BUILT_IN_MATCHERS","getGlobalMatchers","matchRule","registerMatcher","ruleHasValue","unregisterMatcher","resolveFieldData","React","nodeTarget","node","field","dataIsObject","fromData","resolveFieldData","isLeaf","nodeMatchesDirect","rule","matchers","locale","fields","projected","f","matchRule","__spreadProps","__spreadValues","filterTree","nodes","rules","strict","out","selfMatch","childMatched","kidsFiltered","useTreeFilter","options","_a","_b","_c","_d","_e","isShorthand","shorthandMatchMode","shorthandValue","setShorthandValue","useControlledState","setValue","next","isControlled","internalRules","setInternalRules","shorthandRules","currentRules","onRulesChangeRef","commit","filterLocale","filterDelay","filterMode","BUILT_IN_MATCHERS","getGlobalMatchers","debouncedRules","setDebouncedRules","t","activeRules","activeRulesNonEmpty","ruleHasValue","match","lazy","filteredNodes","onLazyLoadRef","lastLazyKeyRef","key","setRules","clearAll","r","c"]}
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 PrimeTek
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.