@mittwald/flow-react-components 0.2.0-alpha.394 → 0.2.0-alpha.396
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/CHANGELOG.md +10 -0
- package/dist/assets/doc-properties.json +389 -85
- package/dist/js/components/src/components/CodeBlock/CodeBlock.mjs +1 -2
- package/dist/js/components/src/components/CodeBlock/CodeBlock.mjs.map +1 -1
- package/dist/js/components/src/components/List/model/filter/Filter.mjs +1 -1
- package/dist/js/components/src/components/List/model/filter/Filter.mjs.map +1 -1
- package/dist/types/components/CodeBlock/CodeBlock.d.ts +18 -3
- package/dist/types/components/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.2.0-alpha.396](https://github.com/mittwald/flow/compare/0.2.0-alpha.395...0.2.0-alpha.396) (2025-08-12)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @mittwald/flow-react-components
|
|
9
|
+
|
|
10
|
+
# [0.2.0-alpha.395](https://github.com/mittwald/flow/compare/0.2.0-alpha.394...0.2.0-alpha.395) (2025-08-11)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **CodeBlock:** fix missing remote props ([#1860](https://github.com/mittwald/flow/issues/1860)) ([92db99a](https://github.com/mittwald/flow/commit/92db99ab1432db223cc32e0334259c7ec5bca8fd))
|
|
15
|
+
|
|
6
16
|
# [0.2.0-alpha.394](https://github.com/mittwald/flow/compare/0.2.0-alpha.393...0.2.0-alpha.394) (2025-08-11)
|
|
7
17
|
|
|
8
18
|
### Bug Fixes
|
|
@@ -206806,6 +206806,310 @@
|
|
|
206806
206806
|
"name": "string | string[]"
|
|
206807
206807
|
}
|
|
206808
206808
|
},
|
|
206809
|
+
"language": {
|
|
206810
|
+
"defaultValue": null,
|
|
206811
|
+
"description": "",
|
|
206812
|
+
"name": "language",
|
|
206813
|
+
"parent": {
|
|
206814
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206815
|
+
"name": "CodeBlockProps"
|
|
206816
|
+
},
|
|
206817
|
+
"declarations": [
|
|
206818
|
+
{
|
|
206819
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206820
|
+
"name": "CodeBlockProps"
|
|
206821
|
+
}
|
|
206822
|
+
],
|
|
206823
|
+
"required": false,
|
|
206824
|
+
"type": {
|
|
206825
|
+
"name": "string"
|
|
206826
|
+
}
|
|
206827
|
+
},
|
|
206828
|
+
"style": {
|
|
206829
|
+
"defaultValue": null,
|
|
206830
|
+
"description": "",
|
|
206831
|
+
"name": "style",
|
|
206832
|
+
"parent": {
|
|
206833
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206834
|
+
"name": "CodeBlockProps"
|
|
206835
|
+
},
|
|
206836
|
+
"declarations": [
|
|
206837
|
+
{
|
|
206838
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206839
|
+
"name": "CodeBlockProps"
|
|
206840
|
+
}
|
|
206841
|
+
],
|
|
206842
|
+
"required": false,
|
|
206843
|
+
"type": {
|
|
206844
|
+
"name": "Record<string, CSSProperties>"
|
|
206845
|
+
}
|
|
206846
|
+
},
|
|
206847
|
+
"customStyle": {
|
|
206848
|
+
"defaultValue": null,
|
|
206849
|
+
"description": "",
|
|
206850
|
+
"name": "customStyle",
|
|
206851
|
+
"parent": {
|
|
206852
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206853
|
+
"name": "CodeBlockProps"
|
|
206854
|
+
},
|
|
206855
|
+
"declarations": [
|
|
206856
|
+
{
|
|
206857
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206858
|
+
"name": "CodeBlockProps"
|
|
206859
|
+
}
|
|
206860
|
+
],
|
|
206861
|
+
"required": false,
|
|
206862
|
+
"type": {
|
|
206863
|
+
"name": "CSSProperties"
|
|
206864
|
+
}
|
|
206865
|
+
},
|
|
206866
|
+
"codeTagProps": {
|
|
206867
|
+
"defaultValue": null,
|
|
206868
|
+
"description": "",
|
|
206869
|
+
"name": "codeTagProps",
|
|
206870
|
+
"parent": {
|
|
206871
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206872
|
+
"name": "CodeBlockProps"
|
|
206873
|
+
},
|
|
206874
|
+
"declarations": [
|
|
206875
|
+
{
|
|
206876
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206877
|
+
"name": "CodeBlockProps"
|
|
206878
|
+
}
|
|
206879
|
+
],
|
|
206880
|
+
"required": false,
|
|
206881
|
+
"type": {
|
|
206882
|
+
"name": "HTMLProps<HTMLElement>"
|
|
206883
|
+
}
|
|
206884
|
+
},
|
|
206885
|
+
"useInlineStyles": {
|
|
206886
|
+
"defaultValue": null,
|
|
206887
|
+
"description": "",
|
|
206888
|
+
"name": "useInlineStyles",
|
|
206889
|
+
"parent": {
|
|
206890
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206891
|
+
"name": "CodeBlockProps"
|
|
206892
|
+
},
|
|
206893
|
+
"declarations": [
|
|
206894
|
+
{
|
|
206895
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206896
|
+
"name": "CodeBlockProps"
|
|
206897
|
+
}
|
|
206898
|
+
],
|
|
206899
|
+
"required": false,
|
|
206900
|
+
"type": {
|
|
206901
|
+
"name": "boolean"
|
|
206902
|
+
}
|
|
206903
|
+
},
|
|
206904
|
+
"showLineNumbers": {
|
|
206905
|
+
"defaultValue": null,
|
|
206906
|
+
"description": "",
|
|
206907
|
+
"name": "showLineNumbers",
|
|
206908
|
+
"parent": {
|
|
206909
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206910
|
+
"name": "CodeBlockProps"
|
|
206911
|
+
},
|
|
206912
|
+
"declarations": [
|
|
206913
|
+
{
|
|
206914
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206915
|
+
"name": "CodeBlockProps"
|
|
206916
|
+
}
|
|
206917
|
+
],
|
|
206918
|
+
"required": false,
|
|
206919
|
+
"type": {
|
|
206920
|
+
"name": "boolean"
|
|
206921
|
+
}
|
|
206922
|
+
},
|
|
206923
|
+
"showInlineLineNumbers": {
|
|
206924
|
+
"defaultValue": null,
|
|
206925
|
+
"description": "",
|
|
206926
|
+
"name": "showInlineLineNumbers",
|
|
206927
|
+
"parent": {
|
|
206928
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206929
|
+
"name": "CodeBlockProps"
|
|
206930
|
+
},
|
|
206931
|
+
"declarations": [
|
|
206932
|
+
{
|
|
206933
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206934
|
+
"name": "CodeBlockProps"
|
|
206935
|
+
}
|
|
206936
|
+
],
|
|
206937
|
+
"required": false,
|
|
206938
|
+
"type": {
|
|
206939
|
+
"name": "boolean"
|
|
206940
|
+
}
|
|
206941
|
+
},
|
|
206942
|
+
"startingLineNumber": {
|
|
206943
|
+
"defaultValue": null,
|
|
206944
|
+
"description": "",
|
|
206945
|
+
"name": "startingLineNumber",
|
|
206946
|
+
"parent": {
|
|
206947
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206948
|
+
"name": "CodeBlockProps"
|
|
206949
|
+
},
|
|
206950
|
+
"declarations": [
|
|
206951
|
+
{
|
|
206952
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206953
|
+
"name": "CodeBlockProps"
|
|
206954
|
+
}
|
|
206955
|
+
],
|
|
206956
|
+
"required": false,
|
|
206957
|
+
"type": {
|
|
206958
|
+
"name": "number"
|
|
206959
|
+
}
|
|
206960
|
+
},
|
|
206961
|
+
"lineNumberContainerStyle": {
|
|
206962
|
+
"defaultValue": null,
|
|
206963
|
+
"description": "",
|
|
206964
|
+
"name": "lineNumberContainerStyle",
|
|
206965
|
+
"parent": {
|
|
206966
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206967
|
+
"name": "CodeBlockProps"
|
|
206968
|
+
},
|
|
206969
|
+
"declarations": [
|
|
206970
|
+
{
|
|
206971
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206972
|
+
"name": "CodeBlockProps"
|
|
206973
|
+
}
|
|
206974
|
+
],
|
|
206975
|
+
"required": false,
|
|
206976
|
+
"type": {
|
|
206977
|
+
"name": "CSSProperties"
|
|
206978
|
+
}
|
|
206979
|
+
},
|
|
206980
|
+
"lineNumberStyle": {
|
|
206981
|
+
"defaultValue": null,
|
|
206982
|
+
"description": "",
|
|
206983
|
+
"name": "lineNumberStyle",
|
|
206984
|
+
"parent": {
|
|
206985
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206986
|
+
"name": "CodeBlockProps"
|
|
206987
|
+
},
|
|
206988
|
+
"declarations": [
|
|
206989
|
+
{
|
|
206990
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
206991
|
+
"name": "CodeBlockProps"
|
|
206992
|
+
}
|
|
206993
|
+
],
|
|
206994
|
+
"required": false,
|
|
206995
|
+
"type": {
|
|
206996
|
+
"name": "CSSProperties | lineNumberStyleFunction"
|
|
206997
|
+
}
|
|
206998
|
+
},
|
|
206999
|
+
"wrapLines": {
|
|
207000
|
+
"defaultValue": null,
|
|
207001
|
+
"description": "",
|
|
207002
|
+
"name": "wrapLines",
|
|
207003
|
+
"parent": {
|
|
207004
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
207005
|
+
"name": "CodeBlockProps"
|
|
207006
|
+
},
|
|
207007
|
+
"declarations": [
|
|
207008
|
+
{
|
|
207009
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
207010
|
+
"name": "CodeBlockProps"
|
|
207011
|
+
}
|
|
207012
|
+
],
|
|
207013
|
+
"required": false,
|
|
207014
|
+
"type": {
|
|
207015
|
+
"name": "boolean"
|
|
207016
|
+
}
|
|
207017
|
+
},
|
|
207018
|
+
"wrapLongLines": {
|
|
207019
|
+
"defaultValue": null,
|
|
207020
|
+
"description": "",
|
|
207021
|
+
"name": "wrapLongLines",
|
|
207022
|
+
"parent": {
|
|
207023
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
207024
|
+
"name": "CodeBlockProps"
|
|
207025
|
+
},
|
|
207026
|
+
"declarations": [
|
|
207027
|
+
{
|
|
207028
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
207029
|
+
"name": "CodeBlockProps"
|
|
207030
|
+
}
|
|
207031
|
+
],
|
|
207032
|
+
"required": false,
|
|
207033
|
+
"type": {
|
|
207034
|
+
"name": "boolean"
|
|
207035
|
+
}
|
|
207036
|
+
},
|
|
207037
|
+
"lineProps": {
|
|
207038
|
+
"defaultValue": null,
|
|
207039
|
+
"description": "",
|
|
207040
|
+
"name": "lineProps",
|
|
207041
|
+
"parent": {
|
|
207042
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
207043
|
+
"name": "CodeBlockProps"
|
|
207044
|
+
},
|
|
207045
|
+
"declarations": [
|
|
207046
|
+
{
|
|
207047
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
207048
|
+
"name": "CodeBlockProps"
|
|
207049
|
+
}
|
|
207050
|
+
],
|
|
207051
|
+
"required": false,
|
|
207052
|
+
"type": {
|
|
207053
|
+
"name": "HTMLProps<HTMLElement> | lineTagPropsFunction"
|
|
207054
|
+
}
|
|
207055
|
+
},
|
|
207056
|
+
"renderer": {
|
|
207057
|
+
"defaultValue": null,
|
|
207058
|
+
"description": "",
|
|
207059
|
+
"name": "renderer",
|
|
207060
|
+
"parent": {
|
|
207061
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
207062
|
+
"name": "CodeBlockProps"
|
|
207063
|
+
},
|
|
207064
|
+
"declarations": [
|
|
207065
|
+
{
|
|
207066
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
207067
|
+
"name": "CodeBlockProps"
|
|
207068
|
+
}
|
|
207069
|
+
],
|
|
207070
|
+
"required": false,
|
|
207071
|
+
"type": {
|
|
207072
|
+
"name": "((props: rendererProps) => ReactNode)"
|
|
207073
|
+
}
|
|
207074
|
+
},
|
|
207075
|
+
"PreTag": {
|
|
207076
|
+
"defaultValue": null,
|
|
207077
|
+
"description": "",
|
|
207078
|
+
"name": "PreTag",
|
|
207079
|
+
"parent": {
|
|
207080
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
207081
|
+
"name": "CodeBlockProps"
|
|
207082
|
+
},
|
|
207083
|
+
"declarations": [
|
|
207084
|
+
{
|
|
207085
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
207086
|
+
"name": "CodeBlockProps"
|
|
207087
|
+
}
|
|
207088
|
+
],
|
|
207089
|
+
"required": false,
|
|
207090
|
+
"type": {
|
|
207091
|
+
"name": "keyof IntrinsicElements | ComponentType<any>"
|
|
207092
|
+
}
|
|
207093
|
+
},
|
|
207094
|
+
"CodeTag": {
|
|
207095
|
+
"defaultValue": null,
|
|
207096
|
+
"description": "",
|
|
207097
|
+
"name": "CodeTag",
|
|
207098
|
+
"parent": {
|
|
207099
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
207100
|
+
"name": "CodeBlockProps"
|
|
207101
|
+
},
|
|
207102
|
+
"declarations": [
|
|
207103
|
+
{
|
|
207104
|
+
"fileName": "components/src/components/CodeBlock/CodeBlock.tsx",
|
|
207105
|
+
"name": "CodeBlockProps"
|
|
207106
|
+
}
|
|
207107
|
+
],
|
|
207108
|
+
"required": false,
|
|
207109
|
+
"type": {
|
|
207110
|
+
"name": "keyof IntrinsicElements | ComponentType<any>"
|
|
207111
|
+
}
|
|
207112
|
+
},
|
|
206809
207113
|
"className": {
|
|
206810
207114
|
"defaultValue": null,
|
|
206811
207115
|
"description": "The elements class name.",
|
|
@@ -217795,11 +218099,12 @@
|
|
|
217795
218099
|
},
|
|
217796
218100
|
{
|
|
217797
218101
|
"tags": {
|
|
217798
|
-
"flr-generate": "all"
|
|
218102
|
+
"flr-generate": "all",
|
|
218103
|
+
"flr-clear-props-context": ""
|
|
217799
218104
|
},
|
|
217800
|
-
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/
|
|
218105
|
+
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/Align/Align.tsx",
|
|
217801
218106
|
"description": "",
|
|
217802
|
-
"displayName": "
|
|
218107
|
+
"displayName": "Align",
|
|
217803
218108
|
"methods": [],
|
|
217804
218109
|
"props": {
|
|
217805
218110
|
"children": {
|
|
@@ -217911,95 +218216,16 @@
|
|
|
217911
218216
|
"type": {
|
|
217912
218217
|
"name": "Key | null"
|
|
217913
218218
|
}
|
|
217914
|
-
},
|
|
217915
|
-
"slot": {
|
|
217916
|
-
"defaultValue": null,
|
|
217917
|
-
"description": "A slot name for the component. Slots allow the component to receive props from a parent component.\nAn explicit `null` value indicates that the local props completely override all props received from a parent.",
|
|
217918
|
-
"name": "slot",
|
|
217919
|
-
"parent": {
|
|
217920
|
-
"fileName": "flow/node_modules/.pnpm/react-aria-components@1.11.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-aria-components/dist/types.d.ts",
|
|
217921
|
-
"name": "SlotProps"
|
|
217922
|
-
},
|
|
217923
|
-
"declarations": [
|
|
217924
|
-
{
|
|
217925
|
-
"fileName": "flow/node_modules/.pnpm/react-aria-components@1.11.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-aria-components/dist/types.d.ts",
|
|
217926
|
-
"name": "SlotProps"
|
|
217927
|
-
}
|
|
217928
|
-
],
|
|
217929
|
-
"required": false,
|
|
217930
|
-
"type": {
|
|
217931
|
-
"name": "string | null"
|
|
217932
|
-
}
|
|
217933
|
-
},
|
|
217934
|
-
"filter": {
|
|
217935
|
-
"defaultValue": null,
|
|
217936
|
-
"description": "An optional filter function used to determine if a option should be included in the autocomplete list.\nInclude this if the items you are providing to your wrapped collection aren't filtered by default.",
|
|
217937
|
-
"name": "filter",
|
|
217938
|
-
"parent": {
|
|
217939
|
-
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-beta.6_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
217940
|
-
"name": "AriaAutocompleteProps"
|
|
217941
|
-
},
|
|
217942
|
-
"declarations": [
|
|
217943
|
-
{
|
|
217944
|
-
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-beta.6_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
217945
|
-
"name": "AriaAutocompleteProps"
|
|
217946
|
-
}
|
|
217947
|
-
],
|
|
217948
|
-
"required": false,
|
|
217949
|
-
"type": {
|
|
217950
|
-
"name": "((textValue: string, inputValue: string) => boolean)"
|
|
217951
|
-
}
|
|
217952
|
-
},
|
|
217953
|
-
"defaultInputValue": {
|
|
217954
|
-
"defaultValue": null,
|
|
217955
|
-
"description": "The default value of the autocomplete input (uncontrolled).",
|
|
217956
|
-
"name": "defaultInputValue",
|
|
217957
|
-
"parent": {
|
|
217958
|
-
"fileName": "flow/node_modules/.pnpm/@react-stately+autocomplete@3.0.0-beta.3_react@19.1.0/node_modules/@react-stately/autocomplete/dist/types.d.ts",
|
|
217959
|
-
"name": "AutocompleteProps"
|
|
217960
|
-
},
|
|
217961
|
-
"declarations": [
|
|
217962
|
-
{
|
|
217963
|
-
"fileName": "flow/node_modules/.pnpm/@react-stately+autocomplete@3.0.0-beta.3_react@19.1.0/node_modules/@react-stately/autocomplete/dist/types.d.ts",
|
|
217964
|
-
"name": "AutocompleteProps"
|
|
217965
|
-
}
|
|
217966
|
-
],
|
|
217967
|
-
"required": false,
|
|
217968
|
-
"type": {
|
|
217969
|
-
"name": "string"
|
|
217970
|
-
}
|
|
217971
|
-
},
|
|
217972
|
-
"disableAutoFocusFirst": {
|
|
217973
|
-
"defaultValue": {
|
|
217974
|
-
"value": "false"
|
|
217975
|
-
},
|
|
217976
|
-
"description": "Whether or not to focus the first item in the collection after a filter is performed.",
|
|
217977
|
-
"name": "disableAutoFocusFirst",
|
|
217978
|
-
"parent": {
|
|
217979
|
-
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-beta.6_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
217980
|
-
"name": "AriaAutocompleteProps"
|
|
217981
|
-
},
|
|
217982
|
-
"declarations": [
|
|
217983
|
-
{
|
|
217984
|
-
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-beta.6_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
217985
|
-
"name": "AriaAutocompleteProps"
|
|
217986
|
-
}
|
|
217987
|
-
],
|
|
217988
|
-
"required": false,
|
|
217989
|
-
"type": {
|
|
217990
|
-
"name": "boolean"
|
|
217991
|
-
}
|
|
217992
218219
|
}
|
|
217993
218220
|
}
|
|
217994
218221
|
},
|
|
217995
218222
|
{
|
|
217996
218223
|
"tags": {
|
|
217997
|
-
"flr-generate": "all"
|
|
217998
|
-
"flr-clear-props-context": ""
|
|
218224
|
+
"flr-generate": "all"
|
|
217999
218225
|
},
|
|
218000
|
-
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/
|
|
218226
|
+
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/Autocomplete/Autocomplete.tsx",
|
|
218001
218227
|
"description": "",
|
|
218002
|
-
"displayName": "
|
|
218228
|
+
"displayName": "Autocomplete",
|
|
218003
218229
|
"methods": [],
|
|
218004
218230
|
"props": {
|
|
218005
218231
|
"children": {
|
|
@@ -218111,6 +218337,84 @@
|
|
|
218111
218337
|
"type": {
|
|
218112
218338
|
"name": "Key | null"
|
|
218113
218339
|
}
|
|
218340
|
+
},
|
|
218341
|
+
"slot": {
|
|
218342
|
+
"defaultValue": null,
|
|
218343
|
+
"description": "A slot name for the component. Slots allow the component to receive props from a parent component.\nAn explicit `null` value indicates that the local props completely override all props received from a parent.",
|
|
218344
|
+
"name": "slot",
|
|
218345
|
+
"parent": {
|
|
218346
|
+
"fileName": "flow/node_modules/.pnpm/react-aria-components@1.11.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-aria-components/dist/types.d.ts",
|
|
218347
|
+
"name": "SlotProps"
|
|
218348
|
+
},
|
|
218349
|
+
"declarations": [
|
|
218350
|
+
{
|
|
218351
|
+
"fileName": "flow/node_modules/.pnpm/react-aria-components@1.11.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-aria-components/dist/types.d.ts",
|
|
218352
|
+
"name": "SlotProps"
|
|
218353
|
+
}
|
|
218354
|
+
],
|
|
218355
|
+
"required": false,
|
|
218356
|
+
"type": {
|
|
218357
|
+
"name": "string | null"
|
|
218358
|
+
}
|
|
218359
|
+
},
|
|
218360
|
+
"filter": {
|
|
218361
|
+
"defaultValue": null,
|
|
218362
|
+
"description": "An optional filter function used to determine if a option should be included in the autocomplete list.\nInclude this if the items you are providing to your wrapped collection aren't filtered by default.",
|
|
218363
|
+
"name": "filter",
|
|
218364
|
+
"parent": {
|
|
218365
|
+
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-beta.6_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
218366
|
+
"name": "AriaAutocompleteProps"
|
|
218367
|
+
},
|
|
218368
|
+
"declarations": [
|
|
218369
|
+
{
|
|
218370
|
+
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-beta.6_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
218371
|
+
"name": "AriaAutocompleteProps"
|
|
218372
|
+
}
|
|
218373
|
+
],
|
|
218374
|
+
"required": false,
|
|
218375
|
+
"type": {
|
|
218376
|
+
"name": "((textValue: string, inputValue: string) => boolean)"
|
|
218377
|
+
}
|
|
218378
|
+
},
|
|
218379
|
+
"defaultInputValue": {
|
|
218380
|
+
"defaultValue": null,
|
|
218381
|
+
"description": "The default value of the autocomplete input (uncontrolled).",
|
|
218382
|
+
"name": "defaultInputValue",
|
|
218383
|
+
"parent": {
|
|
218384
|
+
"fileName": "flow/node_modules/.pnpm/@react-stately+autocomplete@3.0.0-beta.3_react@19.1.0/node_modules/@react-stately/autocomplete/dist/types.d.ts",
|
|
218385
|
+
"name": "AutocompleteProps"
|
|
218386
|
+
},
|
|
218387
|
+
"declarations": [
|
|
218388
|
+
{
|
|
218389
|
+
"fileName": "flow/node_modules/.pnpm/@react-stately+autocomplete@3.0.0-beta.3_react@19.1.0/node_modules/@react-stately/autocomplete/dist/types.d.ts",
|
|
218390
|
+
"name": "AutocompleteProps"
|
|
218391
|
+
}
|
|
218392
|
+
],
|
|
218393
|
+
"required": false,
|
|
218394
|
+
"type": {
|
|
218395
|
+
"name": "string"
|
|
218396
|
+
}
|
|
218397
|
+
},
|
|
218398
|
+
"disableAutoFocusFirst": {
|
|
218399
|
+
"defaultValue": {
|
|
218400
|
+
"value": "false"
|
|
218401
|
+
},
|
|
218402
|
+
"description": "Whether or not to focus the first item in the collection after a filter is performed.",
|
|
218403
|
+
"name": "disableAutoFocusFirst",
|
|
218404
|
+
"parent": {
|
|
218405
|
+
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-beta.6_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
218406
|
+
"name": "AriaAutocompleteProps"
|
|
218407
|
+
},
|
|
218408
|
+
"declarations": [
|
|
218409
|
+
{
|
|
218410
|
+
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-beta.6_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
218411
|
+
"name": "AriaAutocompleteProps"
|
|
218412
|
+
}
|
|
218413
|
+
],
|
|
218414
|
+
"required": false,
|
|
218415
|
+
"type": {
|
|
218416
|
+
"name": "boolean"
|
|
218417
|
+
}
|
|
218114
218418
|
}
|
|
218115
218419
|
}
|
|
218116
218420
|
},
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
|
-
import
|
|
5
|
+
import SyntaxHighlighter from 'react-syntax-highlighter';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { CopyButton } from '../CopyButton/CopyButton.mjs';
|
|
8
8
|
import styles from './CodeBlock.module.scss.mjs';
|
|
9
9
|
|
|
10
|
-
const SyntaxHighlighter = SyntaxHighlighterNative;
|
|
11
10
|
const CodeBlock = (props) => {
|
|
12
11
|
const { code, className, copyable, color = "default", ...rest } = props;
|
|
13
12
|
const rootClassName = clsx(styles.codeBlock, styles[color], className);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.mjs","sources":["../../../../../../src/components/CodeBlock/CodeBlock.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React from \"react\";\nimport
|
|
1
|
+
{"version":3,"file":"CodeBlock.mjs","sources":["../../../../../../src/components/CodeBlock/CodeBlock.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React from \"react\";\nimport SyntaxHighlighter from \"react-syntax-highlighter\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport { CopyButton } from \"@/components/CopyButton\";\nimport styles from \"./CodeBlock.module.scss\";\n\nexport interface CodeBlockProps extends PropsWithClassName {\n /** Adds a copy icon to the code block to copy its content. */\n copyable?: boolean;\n /** The color of the code block. @default \"default\" */\n color?: \"default\" | \"light\" | \"dark\";\n /** The code to display inside the code block. */\n code: string | string[];\n\n // ATTENTION\n // we reexport by copy the props here - react-typescript-docgen\n // will not correctly export the props from react-syntax-highlighter\n // when using OMIT duo some wired circumstances how react-syntax-highlighter\n // exports his types - the following types are excluded\n //\n // children: string | string[];\n //\n language?: string | undefined;\n style?: Record<string, React.CSSProperties> | undefined;\n customStyle?: React.CSSProperties | undefined;\n codeTagProps?: React.HTMLProps<HTMLElement> | undefined;\n useInlineStyles?: boolean | undefined;\n showLineNumbers?: boolean | undefined;\n showInlineLineNumbers?: boolean | undefined;\n startingLineNumber?: number | undefined;\n lineNumberContainerStyle?: React.CSSProperties | undefined;\n lineNumberStyle?: React.CSSProperties | lineNumberStyleFunction | undefined;\n wrapLines?: boolean | undefined;\n wrapLongLines?: boolean | undefined;\n lineProps?: lineTagPropsFunction | React.HTMLProps<HTMLElement> | undefined;\n renderer?: (props: rendererProps) => React.ReactNode;\n PreTag?:\n | keyof React.JSX.IntrinsicElements\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | React.ComponentType<any>\n | undefined;\n CodeTag?:\n | keyof React.JSX.IntrinsicElements\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | React.ComponentType<any>\n | undefined;\n}\n\n/** @flr-generate all */\nexport const CodeBlock: FC<CodeBlockProps> = (props) => {\n const { code, className, copyable, color = \"default\", ...rest } = props;\n\n const rootClassName = clsx(styles.codeBlock, styles[color], className);\n\n return (\n <div className={rootClassName}>\n <SyntaxHighlighter\n customStyle={{\n background: \"none\",\n padding: \"none\",\n margin: \"none\",\n }}\n useInlineStyles={false}\n {...rest}\n >\n {code}\n </SyntaxHighlighter>\n {copyable && (\n <CopyButton\n className={styles.copyButton}\n size=\"s\"\n color={color === \"default\" ? \"dark\" : color}\n text={Array.isArray(code) ? code.join(\"\\r\\n\") : code}\n />\n )}\n </div>\n );\n};\n\nexport default CodeBlock;\n"],"names":[],"mappings":";;;;;;;AAmDa,MAAA,SAAA,GAAgC,CAAC,KAAU,KAAA;AACtD,EAAM,MAAA,EAAE,MAAM,SAAW,EAAA,QAAA,EAAU,QAAQ,SAAW,EAAA,GAAG,MAAS,GAAA,KAAA;AAElE,EAAA,MAAM,gBAAgB,IAAK,CAAA,MAAA,CAAO,WAAW,MAAO,CAAA,KAAK,GAAG,SAAS,CAAA;AAErE,EACE,uBAAA,IAAA,CAAC,KAAI,EAAA,EAAA,SAAA,EAAW,aACd,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,iBAAA;AAAA,MAAA;AAAA,QACC,WAAa,EAAA;AAAA,UACX,UAAY,EAAA,MAAA;AAAA,UACZ,OAAS,EAAA,MAAA;AAAA,UACT,MAAQ,EAAA;AAAA,SACV;AAAA,QACA,eAAiB,EAAA,KAAA;AAAA,QAChB,GAAG,IAAA;AAAA,QAEH,QAAA,EAAA;AAAA;AAAA,KACH;AAAA,IACC,QACC,oBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,WAAW,MAAO,CAAA,UAAA;AAAA,QAClB,IAAK,EAAA,GAAA;AAAA,QACL,KAAA,EAAO,KAAU,KAAA,SAAA,GAAY,MAAS,GAAA,KAAA;AAAA,QACtC,IAAA,EAAM,MAAM,OAAQ,CAAA,IAAI,IAAI,IAAK,CAAA,IAAA,CAAK,MAAM,CAAI,GAAA;AAAA;AAAA;AAClD,GAEJ,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -24,7 +24,7 @@ class Filter {
|
|
|
24
24
|
constructor(list, shape) {
|
|
25
25
|
this.list = list;
|
|
26
26
|
this.property = shape.property;
|
|
27
|
-
this.mode = shape.mode ?? "
|
|
27
|
+
this.mode = shape.mode ?? "some";
|
|
28
28
|
this._values = shape.values?.map((v) => FilterValue.create(this, v));
|
|
29
29
|
this.matcher = shape.matcher ?? equalsPropertyMatcher;
|
|
30
30
|
this.renderItem = shape.renderItem ?? stringCastRenderMethod;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Filter.mjs","sources":["../../../../../../../../src/components/List/model/filter/Filter.ts"],"sourcesContent":["import type {\n Column,\n ColumnDef,\n ColumnFilter,\n InitialTableState,\n} from \"@tanstack/react-table\";\nimport type List from \"@/components/List/model/List\";\nimport { getProperty } from \"dot-prop\";\nimport type {\n FilterMatcher,\n FilterMode,\n FilterShape,\n} from \"@/components/List/model/filter/types\";\nimport type {\n PropertyName,\n PropertyValueRenderMethod,\n} from \"@/components/List/model/types\";\nimport { customPropertyPrefix } from \"@/components/List/model/types\";\nimport { difference, unique } from \"remeda\";\nimport { FilterValue } from \"@/components/List/model/filter/FilterValue\";\nimport z from \"zod\";\nimport { toArray } from \"@/lib/array/toArray\";\n\nconst equalsPropertyMatcher: FilterMatcher<unknown, never, never> = (\n filterValue,\n propertyValue,\n) => filterValue === propertyValue;\n\nconst stringCastRenderMethod: PropertyValueRenderMethod<unknown> = (value) =>\n String(value);\n\nexport class Filter<T, TProp extends PropertyName<T>, TMatchValue> {\n public static readonly settingsStorageSchema = z\n .record(z.array(z.string()))\n .optional();\n\n private _values?: FilterValue[] | undefined;\n private _valuesFromTableState?: FilterValue[];\n public readonly list: List<T>;\n public readonly property: PropertyName<T>;\n public readonly mode: FilterMode;\n public readonly matcher: FilterMatcher<T, never, never>;\n public readonly renderItem: PropertyValueRenderMethod<TMatchValue>;\n public readonly name?: string;\n private onFilterUpdateCallbacks = new Set<() => unknown>();\n private readonly defaultSelectedValues?: readonly NonNullable<TMatchValue>[];\n\n public constructor(list: List<T>, shape: FilterShape<T, TProp, TMatchValue>) {\n this.list = list;\n this.property = shape.property;\n this.mode = shape.mode ?? \"one\";\n this._values = shape.values?.map((v) => FilterValue.create(this, v));\n this.matcher = shape.matcher ?? equalsPropertyMatcher;\n this.renderItem = shape.renderItem ?? stringCastRenderMethod;\n this.name = shape.name;\n\n this.defaultSelectedValues = shape.defaultSelected;\n }\n\n private getStoredSelectedIds() {\n return this.list.getStoredFilterDefaultSettings()?.[String(this.property)];\n }\n\n public updateInitialState(initialState: InitialTableState) {\n const initialValues = this.getInitialValues();\n\n if (initialValues?.length) {\n initialState.columnFilters = [\n ...(initialState.columnFilters ?? []),\n {\n id: this.property as string,\n value: initialValues,\n },\n ];\n }\n }\n\n public updateTableColumnDef(def: ColumnDef<T>): void {\n def.enableColumnFilter = true;\n def.filterFn = this.getReactTableFilterFn();\n }\n\n private getReactTableFilterFn(): ColumnDef<T>[\"filterFn\"] {\n return (row, _, filterValue) => {\n const propertyAsString = this.property as string;\n\n const filterBy = propertyAsString.startsWith(customPropertyPrefix)\n ? row.original\n : getProperty(row.original, propertyAsString);\n\n return this.checkFilterMatches(filterBy, filterValue);\n };\n }\n\n private checkFilterMatches(\n property: unknown,\n filterValueInput: unknown,\n ): boolean {\n if (filterValueInput === null) {\n return true;\n }\n\n const predicate = (filterValue: FilterValue) =>\n this.matcher(filterValue.value as never, property as never);\n\n const toFilterValue = (something: unknown) =>\n FilterValue.create(this, something);\n\n if (this.mode === \"all\") {\n return toArray(filterValueInput).map(toFilterValue).every(predicate);\n } else if (this.mode === \"some\") {\n const filterArr = toArray(filterValueInput);\n return (\n filterArr.length === 0 || filterArr.map(toFilterValue).some(predicate)\n );\n } else if (this.mode === \"one\") {\n return predicate(toFilterValue(filterValueInput));\n }\n\n throw new Error(`Unknown filter mode '${this.mode}'`);\n }\n\n protected getTableColumnFilter(): ColumnFilter | undefined {\n return this.list.reactTable.table\n .getState()\n .columnFilters.find((f) => f.id === this.property);\n }\n\n private getTableColumn(): Column<T> {\n return this.list.reactTable.getTableColumn(this.property);\n }\n\n public getValue(): unknown {\n return this.getTableColumnFilter()?.value ?? null;\n }\n\n private getValuesFromTableState() {\n return unique(\n Array.from(this.getTableColumn().getFacetedUniqueValues().keys())\n .flatMap((v) => v)\n .filter((v) => v !== undefined && v !== null),\n ).map((v) => FilterValue.create(this, v));\n }\n\n private checkIfValueIsUnknown(value: FilterValue) {\n const isKnown = this.values.some((v) => v.id === value.id);\n return !isKnown;\n }\n\n public deleteUnknownFilterValues() {\n if (this.values === this.valuesFromTableState) {\n return;\n }\n\n for (const currentValues of this.getArrayValue()) {\n if (this.checkIfValueIsUnknown(currentValues)) {\n this.deactivateValue(currentValues);\n }\n }\n }\n\n public get values(): FilterValue[] {\n return this._values ?? this.valuesFromTableState;\n }\n\n private get valuesFromTableState(): FilterValue[] {\n if (!this._valuesFromTableState) {\n this._valuesFromTableState = this.getValuesFromTableState();\n }\n return this._valuesFromTableState;\n }\n\n public getArrayValue(): FilterValue[] {\n const value = this.getValue();\n return value === null\n ? []\n : toArray(value).map((v) => FilterValue.create(this, v));\n }\n\n public isValueActive(value: FilterValue): boolean {\n return this.getArrayValue().some((v) => v.equals(value));\n }\n\n public isActive(): boolean {\n return this.getArrayValue().length > 0;\n }\n\n public deactivateValue(value: FilterValue): void {\n const currentValueAsArray = this.getArrayValue();\n\n let updatedValue: unknown;\n\n if (this.mode === \"all\" || this.mode === \"some\") {\n updatedValue = currentValueAsArray.filter((v) => !v.equals(value));\n } else {\n updatedValue = null;\n }\n\n this.list.reactTable\n .getTableColumn(this.property)\n .setFilterValue(updatedValue);\n this.onFilterUpdateCallbacks.forEach((cb) => cb());\n }\n\n public hasChanged(): boolean {\n const currentValues = this.getArrayValue().map((v) => v.value);\n const initialValues =\n this.getInitialFilterValues()?.map((v) => v.value) ?? [];\n\n return (\n currentValues.length !== initialValues.length ||\n difference(currentValues, initialValues).length > 0\n );\n }\n\n private getInitialValues() {\n return this.getStoredSelectedIds() ?? this.defaultSelectedValues;\n }\n\n private getInitialFilterValues() {\n return this.getInitialValues()?.map((v) => FilterValue.create(this, v));\n }\n\n public resetValues(): void {\n let resetTo: unknown;\n const initialValues = this.getInitialValues();\n\n if (initialValues) {\n resetTo = initialValues;\n } else {\n if (this.mode === \"all\" || this.mode === \"some\") {\n resetTo = [];\n } else {\n resetTo = null;\n }\n }\n\n this.list.reactTable.getTableColumn(this.property).setFilterValue(resetTo);\n this.onFilterUpdateCallbacks.forEach((cb) => cb());\n }\n\n public clear(): void {\n this.list.reactTable.getTableColumn(this.property).setFilterValue(null);\n this.onFilterUpdateCallbacks.forEach((cb) => cb());\n }\n\n public toggleValue(newValue: FilterValue): void {\n const currentValueAsArray = this.getArrayValue();\n\n let updatedValue: unknown;\n\n if (this.mode === \"all\" || this.mode === \"some\") {\n if (newValue.isActive) {\n updatedValue = currentValueAsArray.filter((v) => !v.equals(newValue));\n } else {\n updatedValue = [...currentValueAsArray, newValue];\n }\n } else {\n updatedValue = newValue.isActive ? null : newValue;\n }\n\n this.list.reactTable\n .getTableColumn(this.property)\n .setFilterValue(updatedValue);\n this.onFilterUpdateCallbacks.forEach((cb) => cb());\n }\n\n public onFilterUpdated(cb: () => unknown): void {\n this.onFilterUpdateCallbacks.add(cb);\n }\n}\n"],"names":[],"mappings":";;;;;;;AAuBA,MAAM,qBAA8D,GAAA,CAClE,WACA,EAAA,aAAA,KACG,WAAgB,KAAA,aAAA;AAErB,MAAM,sBAA6D,GAAA,CAAC,KAClE,KAAA,MAAA,CAAO,KAAK,CAAA;AAEP,MAAM,MAAsD,CAAA;AAAA,EACjE,OAAuB,qBAAwB,GAAA,CAAA,CAC5C,MAAO,CAAA,CAAA,CAAE,KAAM,CAAA,CAAA,CAAE,MAAO,EAAC,CAAC,CAAA,CAC1B,QAAS,EAAA;AAAA,EAEJ,OAAA;AAAA,EACA,qBAAA;AAAA,EACQ,IAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,IAAA;AAAA,EACR,uBAAA,uBAA8B,GAAmB,EAAA;AAAA,EACxC,qBAAA;AAAA,EAEV,WAAA,CAAY,MAAe,KAA2C,EAAA;AAC3E,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA;AACZ,IAAA,IAAA,CAAK,WA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AA,CAAE,eAAe,IAAI,CAAA;AACtE,IAAA,IAAA,CAAK,uBAAwB,CAAA,OAAA,CAAQ,CAAC,EAAA,KAAO,IAAI,CAAA;AAAA;AACnD,EAEO,YAAY,QAA6B,EAAA;AAC9C,IAAM,MAAA,mBAAA,GAAsB,KAAK,aAAc,EAAA;AAE/C,IAAI,IAAA,YAAA;AAEJ,IAAA,IAAI,IAAK,CAAA,IAAA,KAAS,KAAS,IAAA,IAAA,CAAK,SAAS,MAAQ,EAAA;AAC/C,MAAA,IAAI,SAAS,QAAU,EAAA;AACrB,QAAe,YAAA,GAAA,mBAAA,CAAoB,OAAO,CAAC,CAAA,KAAM,CAAC,CAAE,CAAA,MAAA,CAAO,QAAQ,CAAC,CAAA;AAAA,OAC/D,MAAA;AACL,QAAe,YAAA,GAAA,CAAC,GAAG,mBAAA,EAAqB,QAAQ,CAAA;AAAA;AAClD,KACK,MAAA;AACL,MAAe,YAAA,GAAA,QAAA,CAAS,WAAW,IAAO,GAAA,QAAA;AAAA;AAG5C,IAAA,IAAA,CAAK,KAAK,UACP,CAAA,cAAA,CAAe,KAAK,QAAQ,CAAA,CAC5B,eAAe,YAAY,CAAA;AAC9B,IAAA,IAAA,CAAK,uBAAwB,CAAA,OAAA,CAAQ,CAAC,EAAA,KAAO,IAAI,CAAA;AAAA;AACnD,EAEO,gBAAgB,EAAyB,EAAA;AAC9C,IAAK,IAAA,CAAA,uBAAA,CAAwB,IAAI,EAAE,CAAA;AAAA;AAEvC;;;;"}
|
|
1
|
+
{"version":3,"file":"Filter.mjs","sources":["../../../../../../../../src/components/List/model/filter/Filter.ts"],"sourcesContent":["import type {\n Column,\n ColumnDef,\n ColumnFilter,\n InitialTableState,\n} from \"@tanstack/react-table\";\nimport type List from \"@/components/List/model/List\";\nimport { getProperty } from \"dot-prop\";\nimport type {\n FilterMatcher,\n FilterMode,\n FilterShape,\n} from \"@/components/List/model/filter/types\";\nimport type {\n PropertyName,\n PropertyValueRenderMethod,\n} from \"@/components/List/model/types\";\nimport { customPropertyPrefix } from \"@/components/List/model/types\";\nimport { difference, unique } from \"remeda\";\nimport { FilterValue } from \"@/components/List/model/filter/FilterValue\";\nimport z from \"zod\";\nimport { toArray } from \"@/lib/array/toArray\";\n\nconst equalsPropertyMatcher: FilterMatcher<unknown, never, never> = (\n filterValue,\n propertyValue,\n) => filterValue === propertyValue;\n\nconst stringCastRenderMethod: PropertyValueRenderMethod<unknown> = (value) =>\n String(value);\n\nexport class Filter<T, TProp extends PropertyName<T>, TMatchValue> {\n public static readonly settingsStorageSchema = z\n .record(z.array(z.string()))\n .optional();\n\n private _values?: FilterValue[] | undefined;\n private _valuesFromTableState?: FilterValue[];\n public readonly list: List<T>;\n public readonly property: PropertyName<T>;\n public readonly mode: FilterMode;\n public readonly matcher: FilterMatcher<T, never, never>;\n public readonly renderItem: PropertyValueRenderMethod<TMatchValue>;\n public readonly name?: string;\n private onFilterUpdateCallbacks = new Set<() => unknown>();\n private readonly defaultSelectedValues?: readonly NonNullable<TMatchValue>[];\n\n public constructor(list: List<T>, shape: FilterShape<T, TProp, TMatchValue>) {\n this.list = list;\n this.property = shape.property;\n this.mode = shape.mode ?? \"some\";\n this._values = shape.values?.map((v) => FilterValue.create(this, v));\n this.matcher = shape.matcher ?? equalsPropertyMatcher;\n this.renderItem = shape.renderItem ?? stringCastRenderMethod;\n this.name = shape.name;\n\n this.defaultSelectedValues = shape.defaultSelected;\n }\n\n private getStoredSelectedIds() {\n return this.list.getStoredFilterDefaultSettings()?.[String(this.property)];\n }\n\n public updateInitialState(initialState: InitialTableState) {\n const initialValues = this.getInitialValues();\n\n if (initialValues?.length) {\n initialState.columnFilters = [\n ...(initialState.columnFilters ?? []),\n {\n id: this.property as string,\n value: initialValues,\n },\n ];\n }\n }\n\n public updateTableColumnDef(def: ColumnDef<T>): void {\n def.enableColumnFilter = true;\n def.filterFn = this.getReactTableFilterFn();\n }\n\n private getReactTableFilterFn(): ColumnDef<T>[\"filterFn\"] {\n return (row, _, filterValue) => {\n const propertyAsString = this.property as string;\n\n const filterBy = propertyAsString.startsWith(customPropertyPrefix)\n ? row.original\n : getProperty(row.original, propertyAsString);\n\n return this.checkFilterMatches(filterBy, filterValue);\n };\n }\n\n private checkFilterMatches(\n property: unknown,\n filterValueInput: unknown,\n ): boolean {\n if (filterValueInput === null) {\n return true;\n }\n\n const predicate = (filterValue: FilterValue) =>\n this.matcher(filterValue.value as never, property as never);\n\n const toFilterValue = (something: unknown) =>\n FilterValue.create(this, something);\n\n if (this.mode === \"all\") {\n return toArray(filterValueInput).map(toFilterValue).every(predicate);\n } else if (this.mode === \"some\") {\n const filterArr = toArray(filterValueInput);\n return (\n filterArr.length === 0 || filterArr.map(toFilterValue).some(predicate)\n );\n } else if (this.mode === \"one\") {\n return predicate(toFilterValue(filterValueInput));\n }\n\n throw new Error(`Unknown filter mode '${this.mode}'`);\n }\n\n protected getTableColumnFilter(): ColumnFilter | undefined {\n return this.list.reactTable.table\n .getState()\n .columnFilters.find((f) => f.id === this.property);\n }\n\n private getTableColumn(): Column<T> {\n return this.list.reactTable.getTableColumn(this.property);\n }\n\n public getValue(): unknown {\n return this.getTableColumnFilter()?.value ?? null;\n }\n\n private getValuesFromTableState() {\n return unique(\n Array.from(this.getTableColumn().getFacetedUniqueValues().keys())\n .flatMap((v) => v)\n .filter((v) => v !== undefined && v !== null),\n ).map((v) => FilterValue.create(this, v));\n }\n\n private checkIfValueIsUnknown(value: FilterValue) {\n const isKnown = this.values.some((v) => v.id === value.id);\n return !isKnown;\n }\n\n public deleteUnknownFilterValues() {\n if (this.values === this.valuesFromTableState) {\n return;\n }\n\n for (const currentValues of this.getArrayValue()) {\n if (this.checkIfValueIsUnknown(currentValues)) {\n this.deactivateValue(currentValues);\n }\n }\n }\n\n public get values(): FilterValue[] {\n return this._values ?? this.valuesFromTableState;\n }\n\n private get valuesFromTableState(): FilterValue[] {\n if (!this._valuesFromTableState) {\n this._valuesFromTableState = this.getValuesFromTableState();\n }\n return this._valuesFromTableState;\n }\n\n public getArrayValue(): FilterValue[] {\n const value = this.getValue();\n return value === null\n ? []\n : toArray(value).map((v) => FilterValue.create(this, v));\n }\n\n public isValueActive(value: FilterValue): boolean {\n return this.getArrayValue().some((v) => v.equals(value));\n }\n\n public isActive(): boolean {\n return this.getArrayValue().length > 0;\n }\n\n public deactivateValue(value: FilterValue): void {\n const currentValueAsArray = this.getArrayValue();\n\n let updatedValue: unknown;\n\n if (this.mode === \"all\" || this.mode === \"some\") {\n updatedValue = currentValueAsArray.filter((v) => !v.equals(value));\n } else {\n updatedValue = null;\n }\n\n this.list.reactTable\n .getTableColumn(this.property)\n .setFilterValue(updatedValue);\n this.onFilterUpdateCallbacks.forEach((cb) => cb());\n }\n\n public hasChanged(): boolean {\n const currentValues = this.getArrayValue().map((v) => v.value);\n const initialValues =\n this.getInitialFilterValues()?.map((v) => v.value) ?? [];\n\n return (\n currentValues.length !== initialValues.length ||\n difference(currentValues, initialValues).length > 0\n );\n }\n\n private getInitialValues() {\n return this.getStoredSelectedIds() ?? this.defaultSelectedValues;\n }\n\n private getInitialFilterValues() {\n return this.getInitialValues()?.map((v) => FilterValue.create(this, v));\n }\n\n public resetValues(): void {\n let resetTo: unknown;\n const initialValues = this.getInitialValues();\n\n if (initialValues) {\n resetTo = initialValues;\n } else {\n if (this.mode === \"all\" || this.mode === \"some\") {\n resetTo = [];\n } else {\n resetTo = null;\n }\n }\n\n this.list.reactTable.getTableColumn(this.property).setFilterValue(resetTo);\n this.onFilterUpdateCallbacks.forEach((cb) => cb());\n }\n\n public clear(): void {\n this.list.reactTable.getTableColumn(this.property).setFilterValue(null);\n this.onFilterUpdateCallbacks.forEach((cb) => cb());\n }\n\n public toggleValue(newValue: FilterValue): void {\n const currentValueAsArray = this.getArrayValue();\n\n let updatedValue: unknown;\n\n if (this.mode === \"all\" || this.mode === \"some\") {\n if (newValue.isActive) {\n updatedValue = currentValueAsArray.filter((v) => !v.equals(newValue));\n } else {\n updatedValue = [...currentValueAsArray, newValue];\n }\n } else {\n updatedValue = newValue.isActive ? null : newValue;\n }\n\n this.list.reactTable\n .getTableColumn(this.property)\n .setFilterValue(updatedValue);\n this.onFilterUpdateCallbacks.forEach((cb) => cb());\n }\n\n public onFilterUpdated(cb: () => unknown): void {\n this.onFilterUpdateCallbacks.add(cb);\n }\n}\n"],"names":[],"mappings":";;;;;;;AAuBA,MAAM,qBAA8D,GAAA,CAClE,WACA,EAAA,aAAA,KACG,WAAgB,KAAA,aAAA;AAErB,MAAM,sBAA6D,GAAA,CAAC,KAClE,KAAA,MAAA,CAAO,KAAK,CAAA;AAEP,MAAM,MAAsD,CAAA;AAAA,EACjE,OAAuB,qBAAwB,GAAA,CAAA,CAC5C,MAAO,CAAA,CAAA,CAAE,KAAM,CAAA,CAAA,CAAE,MAAO,EAAC,CAAC,CAAA,CAC1B,QAAS,EAAA;AAAA,EAEJ,OAAA;AAAA,EACA,qBAAA;AAAA,EACQ,IAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,IAAA;AAAA,EACR,uBAAA,uBAA8B,GAAmB,EAAA;AAAA,EACxC,qBAAA;AAAA,EAEV,WAAA,CAAY,MAAe,KAA2C,EAAA;AAC3E,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA;AACZ,IAAA,IAAA,CAAK,WAAW,KAAM,CAAA,QAAA;AACtB,IAAK,IAAA,CAAA,IAAA,GAAO,MAAM,IAAQ,IAAA,MAAA;AAC1B,IAAK,IAAA,CAAA,OAAA,GAAU,KAAM,CAAA,MAAA,EAAQ,GAAI,CAAA,CAAC,MAAM,WAAY,CAAA,MAAA,CAAO,IAAM,EAAA,CAAC,CAAC,CAAA;AACnE,IAAK,IAAA,CAAA,OAAA,GAAU,MAAM,OAAW,IAAA,qBAAA;AAChC,IAAK,IAAA,CAAA,UAAA,GAAa,MAAM,UAAc,IAAA,sBAAA;AACtC,IAAA,IAAA,CAAK,OAAO,KAAM,CAAA,IAA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CAAC,CAAA,KAAM,CAAC,CAAE,CAAA,MAAA,CAAO,QAAQ,CAAC,CAAA;AAAA,OAC/D,MAAA;AACL,QAAe,YAAA,GAAA,CAAC,GAAG,mBAAA,EAAqB,QAAQ,CAAA;AAAA;AAClD,KACK,MAAA;AACL,MAAe,YAAA,GAAA,QAAA,CAAS,WAAW,IAAO,GAAA,QAAA;AAAA;AAG5C,IAAA,IAAA,CAAK,KAAK,UACP,CAAA,cAAA,CAAe,KAAK,QAAQ,CAAA,CAC5B,eAAe,YAAY,CAAA;AAC9B,IAAA,IAAA,CAAK,uBAAwB,CAAA,OAAA,CAAQ,CAAC,EAAA,KAAO,IAAI,CAAA;AAAA;AACnD,EAEO,gBAAgB,EAAyB,EAAA;AAC9C,IAAK,IAAA,CAAA,uBAAA,CAAwB,IAAI,EAAE,CAAA;AAAA;AAEvC;;;;"}
|
|
@@ -1,13 +1,28 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { SyntaxHighlighterProps } from 'react-syntax-highlighter';
|
|
1
|
+
import { FC, default as React } from 'react';
|
|
3
2
|
import { PropsWithClassName } from '../../lib/types/props';
|
|
4
|
-
export interface CodeBlockProps extends
|
|
3
|
+
export interface CodeBlockProps extends PropsWithClassName {
|
|
5
4
|
/** Adds a copy icon to the code block to copy its content. */
|
|
6
5
|
copyable?: boolean;
|
|
7
6
|
/** The color of the code block. @default "default" */
|
|
8
7
|
color?: "default" | "light" | "dark";
|
|
9
8
|
/** The code to display inside the code block. */
|
|
10
9
|
code: string | string[];
|
|
10
|
+
language?: string | undefined;
|
|
11
|
+
style?: Record<string, React.CSSProperties> | undefined;
|
|
12
|
+
customStyle?: React.CSSProperties | undefined;
|
|
13
|
+
codeTagProps?: React.HTMLProps<HTMLElement> | undefined;
|
|
14
|
+
useInlineStyles?: boolean | undefined;
|
|
15
|
+
showLineNumbers?: boolean | undefined;
|
|
16
|
+
showInlineLineNumbers?: boolean | undefined;
|
|
17
|
+
startingLineNumber?: number | undefined;
|
|
18
|
+
lineNumberContainerStyle?: React.CSSProperties | undefined;
|
|
19
|
+
lineNumberStyle?: React.CSSProperties | lineNumberStyleFunction | undefined;
|
|
20
|
+
wrapLines?: boolean | undefined;
|
|
21
|
+
wrapLongLines?: boolean | undefined;
|
|
22
|
+
lineProps?: lineTagPropsFunction | React.HTMLProps<HTMLElement> | undefined;
|
|
23
|
+
renderer?: (props: rendererProps) => React.ReactNode;
|
|
24
|
+
PreTag?: keyof React.JSX.IntrinsicElements | React.ComponentType<any> | undefined;
|
|
25
|
+
CodeTag?: keyof React.JSX.IntrinsicElements | React.ComponentType<any> | undefined;
|
|
11
26
|
}
|
|
12
27
|
/** @flr-generate all */
|
|
13
28
|
export declare const CodeBlock: FC<CodeBlockProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAK5D,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sDAAsD;IACtD,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;IACrC,iDAAiD;IACjD,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAUxB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAA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3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.396",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@chakra-ui/live-region": "^2.1.0",
|
|
59
59
|
"@internationalized/string-compiler": "^3.2.6",
|
|
60
60
|
"@mittwald/password-tools-js": "3.0.0-alpha.15",
|
|
61
|
-
"@mittwald/react-tunnel": "0.2.0-alpha.
|
|
61
|
+
"@mittwald/react-tunnel": "0.2.0-alpha.396",
|
|
62
62
|
"@mittwald/react-use-promise": "^3.0.4",
|
|
63
63
|
"@react-aria/form": "^3.1.0",
|
|
64
64
|
"@react-aria/utils": "^3.30.0",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"@faker-js/faker": "^9.9.0",
|
|
100
100
|
"@internationalized/date": "^3.8.2",
|
|
101
101
|
"@mittwald/flow-core": "",
|
|
102
|
-
"@mittwald/flow-design-tokens": "0.2.0-alpha.
|
|
102
|
+
"@mittwald/flow-design-tokens": "0.2.0-alpha.396",
|
|
103
103
|
"@mittwald/react-use-promise": "^3.0.4",
|
|
104
104
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.3",
|
|
105
105
|
"@mittwald/typescript-config": "",
|
|
@@ -175,5 +175,5 @@
|
|
|
175
175
|
"optional": true
|
|
176
176
|
}
|
|
177
177
|
},
|
|
178
|
-
"gitHead": "
|
|
178
|
+
"gitHead": "527f3cb34b342ed94935b0875cad29799a230b4f"
|
|
179
179
|
}
|