@mittwald/flow-react-components 0.2.0-alpha.272 → 0.2.0-alpha.274

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 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.274](https://github.com/mittwald/flow/compare/0.2.0-alpha.273...0.2.0-alpha.274) (2025-06-17)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **List:** fix default sorting ([#1623](https://github.com/mittwald/flow/issues/1623)) ([d447a88](https://github.com/mittwald/flow/commit/d447a88b41d9ced070b94256676d78d07a90b9de))
11
+
12
+ # [0.2.0-alpha.273](https://github.com/mittwald/flow/compare/0.2.0-alpha.272...0.2.0-alpha.273) (2025-06-17)
13
+
14
+ **Note:** Version bump only for package @mittwald/flow-react-components
15
+
6
16
  # [0.2.0-alpha.272](https://github.com/mittwald/flow/compare/0.2.0-alpha.271...0.2.0-alpha.272) (2025-06-17)
7
17
 
8
18
  ### Features
@@ -171294,204 +171294,200 @@
171294
171294
  },
171295
171295
  {
171296
171296
  "tags": {
171297
- "flr-generate": "all",
171298
- "flr-clear-props-context": ""
171297
+ "flr-generate": "all"
171299
171298
  },
171300
- "filePath": "/home/runner/work/flow/flow/packages/components/src/components/Align/Align.tsx",
171299
+ "filePath": "src/components/AreaChart/AreaChart.tsx",
171301
171300
  "description": "",
171302
- "displayName": "Align",
171301
+ "displayName": "AreaChart",
171303
171302
  "methods": [],
171304
171303
  "props": {
171305
- "children": {
171304
+ "height": {
171306
171305
  "defaultValue": null,
171307
171306
  "description": "",
171308
- "name": "children",
171307
+ "name": "height",
171308
+ "parent": {
171309
+ "fileName": "src/components/AreaChart/AreaChart.tsx",
171310
+ "name": "AreaChartProps"
171311
+ },
171309
171312
  "declarations": [
171310
171313
  {
171311
- "fileName": "flow/node_modules/.pnpm/@types+react@19.1.6/node_modules/@types/react/index.d.ts",
171312
- "name": "TypeLiteral"
171314
+ "fileName": "src/components/AreaChart/AreaChart.tsx",
171315
+ "name": "AreaChartProps"
171313
171316
  }
171314
171317
  ],
171315
171318
  "required": false,
171316
171319
  "type": {
171317
- "name": "ReactNode"
171320
+ "name": "string"
171318
171321
  }
171319
171322
  },
171320
- "className": {
171323
+ "emptyView": {
171321
171324
  "defaultValue": null,
171322
- "description": "The elements class name.",
171323
- "name": "className",
171325
+ "description": "View that is provided when data is empty/undefined",
171326
+ "name": "emptyView",
171324
171327
  "parent": {
171325
- "fileName": "components/src/lib/types/props.ts",
171326
- "name": "PropsWithClassName"
171328
+ "fileName": "src/components/AreaChart/AreaChart.tsx",
171329
+ "name": "AreaChartProps"
171327
171330
  },
171328
171331
  "declarations": [
171329
171332
  {
171330
- "fileName": "components/src/lib/types/props.ts",
171331
- "name": "PropsWithClassName"
171333
+ "fileName": "src/components/AreaChart/AreaChart.tsx",
171334
+ "name": "AreaChartProps"
171332
171335
  }
171333
171336
  ],
171334
171337
  "required": false,
171335
171338
  "type": {
171336
- "name": "string"
171339
+ "name": "ComponentType<AreaChartEmptyViewProps>"
171337
171340
  }
171338
171341
  },
171339
- "wrapWith": {
171342
+ "flexGrow": {
171340
171343
  "defaultValue": null,
171341
- "description": "",
171342
- "name": "wrapWith",
171344
+ "description": "Allow the height controlling container to set flex-grow: 1. Can only be\nused in combination with `height`",
171345
+ "name": "flexGrow",
171343
171346
  "parent": {
171344
- "fileName": "components/src/lib/componentFactory/flowComponent.tsx",
171345
- "name": "FlowComponentProps"
171347
+ "fileName": "src/components/AreaChart/AreaChart.tsx",
171348
+ "name": "AreaChartProps"
171346
171349
  },
171347
171350
  "declarations": [
171348
171351
  {
171349
- "fileName": "components/src/lib/componentFactory/flowComponent.tsx",
171350
- "name": "FlowComponentProps"
171352
+ "fileName": "src/components/AreaChart/AreaChart.tsx",
171353
+ "name": "AreaChartProps"
171351
171354
  }
171352
171355
  ],
171353
171356
  "required": false,
171354
171357
  "type": {
171355
- "name": "ReactElement<unknown, string | JSXElementConstructor<any>>"
171358
+ "name": "boolean"
171356
171359
  }
171357
171360
  },
171358
- "tunnelId": {
171361
+ "className": {
171359
171362
  "defaultValue": null,
171360
- "description": "@internal",
171361
- "name": "tunnelId",
171363
+ "description": "",
171364
+ "name": "className",
171362
171365
  "parent": {
171363
- "fileName": "components/src/lib/types/props.ts",
171364
- "name": "PropsWithTunnel"
171366
+ "fileName": "flow/node_modules/.pnpm/recharts@3.0.0-beta.1_@types+react@19.1.6_redux@5.0.1/node_modules/recharts/types/chart/generateCategoricalChart.d.ts",
171367
+ "name": "CategoricalChartProps"
171365
171368
  },
171366
171369
  "declarations": [
171367
171370
  {
171368
- "fileName": "components/src/lib/types/props.ts",
171369
- "name": "PropsWithTunnel"
171371
+ "fileName": "flow/node_modules/.pnpm/recharts@3.0.0-beta.1_@types+react@19.1.6_redux@5.0.1/node_modules/recharts/types/chart/generateCategoricalChart.d.ts",
171372
+ "name": "CategoricalChartProps"
171370
171373
  }
171371
171374
  ],
171372
171375
  "required": false,
171373
171376
  "type": {
171374
- "name": "string | null"
171377
+ "name": "string"
171375
171378
  }
171376
171379
  },
171377
- "ref": {
171380
+ "data": {
171378
171381
  "defaultValue": null,
171379
- "description": "Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}",
171380
- "name": "ref",
171382
+ "description": "",
171383
+ "name": "data",
171381
171384
  "parent": {
171382
- "fileName": "flow/node_modules/.pnpm/@types+react@19.1.6/node_modules/@types/react/index.d.ts",
171383
- "name": "RefAttributes"
171385
+ "fileName": "flow/node_modules/.pnpm/recharts@3.0.0-beta.1_@types+react@19.1.6_redux@5.0.1/node_modules/recharts/types/chart/generateCategoricalChart.d.ts",
171386
+ "name": "CategoricalChartProps"
171384
171387
  },
171385
171388
  "declarations": [
171386
171389
  {
171387
- "fileName": "flow/node_modules/.pnpm/@types+react@19.1.6/node_modules/@types/react/index.d.ts",
171388
- "name": "RefAttributes"
171390
+ "fileName": "flow/node_modules/.pnpm/recharts@3.0.0-beta.1_@types+react@19.1.6_redux@5.0.1/node_modules/recharts/types/chart/generateCategoricalChart.d.ts",
171391
+ "name": "CategoricalChartProps"
171389
171392
  }
171390
171393
  ],
171391
171394
  "required": false,
171392
171395
  "type": {
171393
- "name": "Ref<HTMLDivElement>"
171396
+ "name": "any[]"
171394
171397
  }
171395
171398
  },
171396
- "key": {
171399
+ "syncId": {
171397
171400
  "defaultValue": null,
171398
171401
  "description": "",
171399
- "name": "key",
171402
+ "name": "syncId",
171400
171403
  "parent": {
171401
- "fileName": "flow/node_modules/.pnpm/@types+react@19.1.6/node_modules/@types/react/index.d.ts",
171402
- "name": "Attributes"
171404
+ "fileName": "flow/node_modules/.pnpm/recharts@3.0.0-beta.1_@types+react@19.1.6_redux@5.0.1/node_modules/recharts/types/chart/generateCategoricalChart.d.ts",
171405
+ "name": "CategoricalChartProps"
171403
171406
  },
171404
171407
  "declarations": [
171405
171408
  {
171406
- "fileName": "flow/node_modules/.pnpm/@types+react@19.1.6/node_modules/@types/react/index.d.ts",
171407
- "name": "Attributes"
171409
+ "fileName": "flow/node_modules/.pnpm/recharts@3.0.0-beta.1_@types+react@19.1.6_redux@5.0.1/node_modules/recharts/types/chart/generateCategoricalChart.d.ts",
171410
+ "name": "CategoricalChartProps"
171408
171411
  }
171409
171412
  ],
171410
171413
  "required": false,
171411
171414
  "type": {
171412
- "name": "Key | null"
171415
+ "name": "string | number"
171413
171416
  }
171414
- }
171415
- }
171416
- },
171417
- {
171418
- "tags": {
171419
- "flr-generate": "all"
171420
- },
171421
- "filePath": "src/components/AreaChart/AreaChart.tsx",
171422
- "description": "",
171423
- "displayName": "AreaChart",
171424
- "methods": [],
171425
- "props": {
171426
- "height": {
171417
+ },
171418
+ "syncMethod": {
171427
171419
  "defaultValue": null,
171428
171420
  "description": "",
171429
- "name": "height",
171421
+ "name": "syncMethod",
171430
171422
  "parent": {
171431
- "fileName": "src/components/AreaChart/AreaChart.tsx",
171432
- "name": "AreaChartProps"
171423
+ "fileName": "flow/node_modules/.pnpm/recharts@3.0.0-beta.1_@types+react@19.1.6_redux@5.0.1/node_modules/recharts/types/chart/generateCategoricalChart.d.ts",
171424
+ "name": "CategoricalChartProps"
171433
171425
  },
171434
171426
  "declarations": [
171435
171427
  {
171436
- "fileName": "src/components/AreaChart/AreaChart.tsx",
171437
- "name": "AreaChartProps"
171428
+ "fileName": "flow/node_modules/.pnpm/recharts@3.0.0-beta.1_@types+react@19.1.6_redux@5.0.1/node_modules/recharts/types/chart/generateCategoricalChart.d.ts",
171429
+ "name": "CategoricalChartProps"
171438
171430
  }
171439
171431
  ],
171440
171432
  "required": false,
171441
171433
  "type": {
171442
- "name": "string"
171434
+ "name": "SyncMethod"
171443
171435
  }
171444
171436
  },
171445
- "emptyView": {
171437
+ "children": {
171446
171438
  "defaultValue": null,
171447
- "description": "View that is provided when data is empty/undefined",
171448
- "name": "emptyView",
171449
- "parent": {
171450
- "fileName": "src/components/AreaChart/AreaChart.tsx",
171451
- "name": "AreaChartProps"
171452
- },
171439
+ "description": "",
171440
+ "name": "children",
171453
171441
  "declarations": [
171454
171442
  {
171455
- "fileName": "src/components/AreaChart/AreaChart.tsx",
171456
- "name": "AreaChartProps"
171443
+ "fileName": "flow/node_modules/.pnpm/@types+react@19.1.6/node_modules/@types/react/index.d.ts",
171444
+ "name": "TypeLiteral"
171457
171445
  }
171458
171446
  ],
171459
171447
  "required": false,
171460
171448
  "type": {
171461
- "name": "ComponentType<AreaChartEmptyViewProps>"
171449
+ "name": "ReactNode"
171462
171450
  }
171463
- },
171464
- "flexGrow": {
171451
+ }
171452
+ }
171453
+ },
171454
+ {
171455
+ "tags": {
171456
+ "flr-generate": "all",
171457
+ "flr-clear-props-context": ""
171458
+ },
171459
+ "filePath": "/home/runner/work/flow/flow/packages/components/src/components/Align/Align.tsx",
171460
+ "description": "",
171461
+ "displayName": "Align",
171462
+ "methods": [],
171463
+ "props": {
171464
+ "children": {
171465
171465
  "defaultValue": null,
171466
- "description": "Allow the height controlling container to set flex-grow: 1. Can only be\nused in combination with `height`",
171467
- "name": "flexGrow",
171468
- "parent": {
171469
- "fileName": "src/components/AreaChart/AreaChart.tsx",
171470
- "name": "AreaChartProps"
171471
- },
171466
+ "description": "",
171467
+ "name": "children",
171472
171468
  "declarations": [
171473
171469
  {
171474
- "fileName": "src/components/AreaChart/AreaChart.tsx",
171475
- "name": "AreaChartProps"
171470
+ "fileName": "flow/node_modules/.pnpm/@types+react@19.1.6/node_modules/@types/react/index.d.ts",
171471
+ "name": "TypeLiteral"
171476
171472
  }
171477
171473
  ],
171478
171474
  "required": false,
171479
171475
  "type": {
171480
- "name": "boolean"
171476
+ "name": "ReactNode"
171481
171477
  }
171482
171478
  },
171483
171479
  "className": {
171484
171480
  "defaultValue": null,
171485
- "description": "",
171481
+ "description": "The elements class name.",
171486
171482
  "name": "className",
171487
171483
  "parent": {
171488
- "fileName": "flow/node_modules/.pnpm/recharts@3.0.0-beta.1_@types+react@19.1.6_redux@5.0.1/node_modules/recharts/types/chart/generateCategoricalChart.d.ts",
171489
- "name": "CategoricalChartProps"
171484
+ "fileName": "components/src/lib/types/props.ts",
171485
+ "name": "PropsWithClassName"
171490
171486
  },
171491
171487
  "declarations": [
171492
171488
  {
171493
- "fileName": "flow/node_modules/.pnpm/recharts@3.0.0-beta.1_@types+react@19.1.6_redux@5.0.1/node_modules/recharts/types/chart/generateCategoricalChart.d.ts",
171494
- "name": "CategoricalChartProps"
171489
+ "fileName": "components/src/lib/types/props.ts",
171490
+ "name": "PropsWithClassName"
171495
171491
  }
171496
171492
  ],
171497
171493
  "required": false,
@@ -171499,76 +171495,80 @@
171499
171495
  "name": "string"
171500
171496
  }
171501
171497
  },
171502
- "data": {
171498
+ "wrapWith": {
171503
171499
  "defaultValue": null,
171504
171500
  "description": "",
171505
- "name": "data",
171501
+ "name": "wrapWith",
171506
171502
  "parent": {
171507
- "fileName": "flow/node_modules/.pnpm/recharts@3.0.0-beta.1_@types+react@19.1.6_redux@5.0.1/node_modules/recharts/types/chart/generateCategoricalChart.d.ts",
171508
- "name": "CategoricalChartProps"
171503
+ "fileName": "components/src/lib/componentFactory/flowComponent.tsx",
171504
+ "name": "FlowComponentProps"
171509
171505
  },
171510
171506
  "declarations": [
171511
171507
  {
171512
- "fileName": "flow/node_modules/.pnpm/recharts@3.0.0-beta.1_@types+react@19.1.6_redux@5.0.1/node_modules/recharts/types/chart/generateCategoricalChart.d.ts",
171513
- "name": "CategoricalChartProps"
171508
+ "fileName": "components/src/lib/componentFactory/flowComponent.tsx",
171509
+ "name": "FlowComponentProps"
171514
171510
  }
171515
171511
  ],
171516
171512
  "required": false,
171517
171513
  "type": {
171518
- "name": "any[]"
171514
+ "name": "ReactElement<unknown, string | JSXElementConstructor<any>>"
171519
171515
  }
171520
171516
  },
171521
- "syncId": {
171517
+ "tunnelId": {
171522
171518
  "defaultValue": null,
171523
- "description": "",
171524
- "name": "syncId",
171519
+ "description": "@internal",
171520
+ "name": "tunnelId",
171525
171521
  "parent": {
171526
- "fileName": "flow/node_modules/.pnpm/recharts@3.0.0-beta.1_@types+react@19.1.6_redux@5.0.1/node_modules/recharts/types/chart/generateCategoricalChart.d.ts",
171527
- "name": "CategoricalChartProps"
171522
+ "fileName": "components/src/lib/types/props.ts",
171523
+ "name": "PropsWithTunnel"
171528
171524
  },
171529
171525
  "declarations": [
171530
171526
  {
171531
- "fileName": "flow/node_modules/.pnpm/recharts@3.0.0-beta.1_@types+react@19.1.6_redux@5.0.1/node_modules/recharts/types/chart/generateCategoricalChart.d.ts",
171532
- "name": "CategoricalChartProps"
171527
+ "fileName": "components/src/lib/types/props.ts",
171528
+ "name": "PropsWithTunnel"
171533
171529
  }
171534
171530
  ],
171535
171531
  "required": false,
171536
171532
  "type": {
171537
- "name": "string | number"
171533
+ "name": "string | null"
171538
171534
  }
171539
171535
  },
171540
- "syncMethod": {
171536
+ "ref": {
171541
171537
  "defaultValue": null,
171542
- "description": "",
171543
- "name": "syncMethod",
171538
+ "description": "Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}",
171539
+ "name": "ref",
171544
171540
  "parent": {
171545
- "fileName": "flow/node_modules/.pnpm/recharts@3.0.0-beta.1_@types+react@19.1.6_redux@5.0.1/node_modules/recharts/types/chart/generateCategoricalChart.d.ts",
171546
- "name": "CategoricalChartProps"
171541
+ "fileName": "flow/node_modules/.pnpm/@types+react@19.1.6/node_modules/@types/react/index.d.ts",
171542
+ "name": "RefAttributes"
171547
171543
  },
171548
171544
  "declarations": [
171549
171545
  {
171550
- "fileName": "flow/node_modules/.pnpm/recharts@3.0.0-beta.1_@types+react@19.1.6_redux@5.0.1/node_modules/recharts/types/chart/generateCategoricalChart.d.ts",
171551
- "name": "CategoricalChartProps"
171546
+ "fileName": "flow/node_modules/.pnpm/@types+react@19.1.6/node_modules/@types/react/index.d.ts",
171547
+ "name": "RefAttributes"
171552
171548
  }
171553
171549
  ],
171554
171550
  "required": false,
171555
171551
  "type": {
171556
- "name": "SyncMethod"
171552
+ "name": "Ref<HTMLDivElement>"
171557
171553
  }
171558
171554
  },
171559
- "children": {
171555
+ "key": {
171560
171556
  "defaultValue": null,
171561
171557
  "description": "",
171562
- "name": "children",
171558
+ "name": "key",
171559
+ "parent": {
171560
+ "fileName": "flow/node_modules/.pnpm/@types+react@19.1.6/node_modules/@types/react/index.d.ts",
171561
+ "name": "Attributes"
171562
+ },
171563
171563
  "declarations": [
171564
171564
  {
171565
171565
  "fileName": "flow/node_modules/.pnpm/@types+react@19.1.6/node_modules/@types/react/index.d.ts",
171566
- "name": "TypeLiteral"
171566
+ "name": "Attributes"
171567
171567
  }
171568
171568
  ],
171569
171569
  "required": false,
171570
171570
  "type": {
171571
- "name": "ReactNode"
171571
+ "name": "Key | null"
171572
171572
  }
171573
171573
  }
171574
171574
  }
@@ -18,12 +18,16 @@ class Sorting {
18
18
  this.property = shape.property;
19
19
  this.name = shape.name;
20
20
  this.direction = shape.direction ?? "asc";
21
- this.defaultEnabled = this.getStoredDefaultEnabled() ?? shape.defaultEnabled ?? false;
21
+ const storedDefaultEnabled = this.getStoredDefaultEnabled();
22
+ this.defaultEnabled = shape.defaultEnabled === "hidden" ? "hidden" : storedDefaultEnabled ?? shape.defaultEnabled ?? false;
22
23
  this.customSortingFn = shape.customSortingFn;
23
24
  }
24
25
  getStoredDefaultEnabled() {
25
26
  const storedSorting = this.list.getStoredSortingDefaultSetting();
26
- return storedSorting?.property === this.property && storedSorting.direction === this.direction;
27
+ if (!storedSorting) {
28
+ return void 0;
29
+ }
30
+ return storedSorting.property === this.property && storedSorting.direction === this.direction;
27
31
  }
28
32
  updateTableColumnDef(def) {
29
33
  def.enableSorting = true;
@@ -1 +1 @@
1
- {"version":3,"file":"Sorting.mjs","sources":["../../../../../../../../src/components/List/model/sorting/Sorting.ts"],"sourcesContent":["import type List from \"@/components/List/model/List\";\nimport type {\n SortingDefaultMode,\n SortingShape,\n} from \"@/components/List/model/sorting/types\";\nimport type { PropertyName } from \"@/components/List/model/types\";\nimport type {\n Column,\n ColumnDef,\n ColumnSort,\n SortDirection,\n SortingFn,\n} from \"@tanstack/react-table\";\nimport z from \"zod\";\n\nexport class Sorting<T> {\n public static readonly storageSchema = z\n .object({\n direction: z.enum([\"asc\", \"desc\"]),\n property: z.string().or(z.number()),\n })\n .optional();\n public readonly list: List<T>;\n public readonly property: PropertyName<T>;\n public readonly name?: string;\n public readonly direction: SortDirection;\n public readonly defaultEnabled: SortingDefaultMode;\n public readonly customSortingFn?: SortingFn<T>;\n\n public constructor(list: List<T>, shape: SortingShape<T>) {\n this.list = list;\n this.property = shape.property;\n this.name = shape.name;\n this.direction = shape.direction ?? \"asc\";\n this.defaultEnabled =\n this.getStoredDefaultEnabled() ?? shape.defaultEnabled ?? false;\n this.customSortingFn = shape.customSortingFn;\n }\n\n private getStoredDefaultEnabled() {\n const storedSorting = this.list.getStoredSortingDefaultSetting();\n return (\n storedSorting?.property === this.property &&\n storedSorting.direction === this.direction\n );\n }\n\n public updateTableColumnDef(def: ColumnDef<T>): void {\n def.enableSorting = true;\n if (this.customSortingFn) {\n def.sortingFn = this.customSortingFn;\n }\n }\n\n public getReactTableColumnSort(): ColumnSort {\n return {\n id: this.property as string,\n desc: this.direction === \"desc\",\n };\n }\n\n public isSorted(): boolean {\n const col = this.getTableColumn();\n return col.getIsSorted() == this.direction;\n }\n\n public getTableColumn(): Column<T> {\n return this.list.reactTable.getTableColumn(this.property);\n }\n\n public enable(): void {\n this.list.reactTable\n .getTableColumn(this.property)\n .toggleSorting(this.direction === \"desc\", false);\n this.list.storeSortingSettings(this);\n }\n\n public clear(): void {\n this.list.reactTable.getTableColumn(this.property).clearSorting();\n }\n\n public get id(): string {\n return `${this.getTableColumn().id}:${this.direction}`;\n }\n}\n"],"names":[],"mappings":";;AAeO,MAAM,OAAW,CAAA;AAAA,EACtB,OAAuB,aAAgB,GAAA,CAAA,CACpC,MAAO,CAAA;AAAA,IACN,WAAW,CAAE,CAAA,IAAA,CAAK,CAAC,KAAA,EAAO,MAAM,CAAC,CAAA;AAAA,IACjC,UAAU,CAAE,CAAA,MAAA,GAAS,EAAG,CAAA,CAAA,CAAE,QAAQ;AAAA,GACnC,EACA,QAAS,EAAA;AAAA,EACI,IAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EAET,WAAA,CAAY,MAAe,KAAwB,EAAA;AACxD,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA;AACZ,IAAA,IAAA,CAAK,WAAW,KAAM,CAAA,QAAA;AACtB,IAAA,IAAA,CAAK,OAAO,KAAM,CAAA,IAAA;AAClB,IAAK,IA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ACnB,IAAA,IAAA,CAAK,KAAK,UAAW,CAAA,cAAA,CAAe,IAAK,CAAA,QAAQ,EAAE,YAAa,EAAA;AAAA;AAClE,EAEA,IAAW,EAAa,GAAA;AACtB,IAAA,OAAO,GAAG,IAAK,CAAA,cAAA,GAAiB,EAAE,CAAA,CAAA,EAAI,KAAK,SAAS,CAAA,CAAA;AAAA;AAExD;;;;"}
1
+ {"version":3,"file":"Sorting.mjs","sources":["../../../../../../../../src/components/List/model/sorting/Sorting.ts"],"sourcesContent":["import type List from \"@/components/List/model/List\";\nimport type {\n SortingDefaultMode,\n SortingShape,\n} from \"@/components/List/model/sorting/types\";\nimport type { PropertyName } from \"@/components/List/model/types\";\nimport type {\n Column,\n ColumnDef,\n ColumnSort,\n SortDirection,\n SortingFn,\n} from \"@tanstack/react-table\";\nimport z from \"zod\";\n\nexport class Sorting<T> {\n public static readonly storageSchema = z\n .object({\n direction: z.enum([\"asc\", \"desc\"]),\n property: z.string().or(z.number()),\n })\n .optional();\n public readonly list: List<T>;\n public readonly property: PropertyName<T>;\n public readonly name?: string;\n public readonly direction: SortDirection;\n public readonly defaultEnabled: SortingDefaultMode;\n public readonly customSortingFn?: SortingFn<T>;\n\n public constructor(list: List<T>, shape: SortingShape<T>) {\n this.list = list;\n this.property = shape.property;\n this.name = shape.name;\n this.direction = shape.direction ?? \"asc\";\n const storedDefaultEnabled = this.getStoredDefaultEnabled();\n this.defaultEnabled =\n shape.defaultEnabled === \"hidden\"\n ? \"hidden\"\n : (storedDefaultEnabled ?? shape.defaultEnabled ?? false);\n this.customSortingFn = shape.customSortingFn;\n }\n\n private getStoredDefaultEnabled() {\n const storedSorting = this.list.getStoredSortingDefaultSetting();\n if (!storedSorting) {\n return undefined;\n }\n return (\n storedSorting.property === this.property &&\n storedSorting.direction === this.direction\n );\n }\n\n public updateTableColumnDef(def: ColumnDef<T>): void {\n def.enableSorting = true;\n if (this.customSortingFn) {\n def.sortingFn = this.customSortingFn;\n }\n }\n\n public getReactTableColumnSort(): ColumnSort {\n return {\n id: this.property as string,\n desc: this.direction === \"desc\",\n };\n }\n\n public isSorted(): boolean {\n const col = this.getTableColumn();\n return col.getIsSorted() == this.direction;\n }\n\n public getTableColumn(): Column<T> {\n return this.list.reactTable.getTableColumn(this.property);\n }\n\n public enable(): void {\n this.list.reactTable\n .getTableColumn(this.property)\n .toggleSorting(this.direction === \"desc\", false);\n this.list.storeSortingSettings(this);\n }\n\n public clear(): void {\n this.list.reactTable.getTableColumn(this.property).clearSorting();\n }\n\n public get id(): string {\n return `${this.getTableColumn().id}:${this.direction}`;\n }\n}\n"],"names":[],"mappings":";;AAeO,MAAM,OAAW,CAAA;AAAA,EACtB,OAAuB,aAAgB,GAAA,CAAA,CACpC,MAAO,CAAA;AAAA,IACN,WAAW,CAAE,CAAA,IAAA,CAAK,CAAC,KAAA,EAAO,MAAM,CAAC,CAAA;AAAA,IACjC,UAAU,CAAE,CAAA,MAAA,GAAS,EAAG,CAAA,CAAA,CAAE,QAAQ;AAAA,GACnC,EACA,QAAS,EAAA;AAAA,EACI,IAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EAET,WAAA,CAAY,MAAe,KAAwB,EAAA;AACxD,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA;AACZ,IAAA,IAAA,CAAK,WAAW,KAAM,CAAA,QAAA;AACtB,IAAA,IAAA,CAAK,OAAO,KAAM,CAAA,IAAA;AAClB,IAAK,IAAA,CAAA,SAAA,GAAY,MAAM,SAAa,IAAA,KAAA;AACpC,IAAM,MAAA,oBAAA,GAAuB,KAAK,uBAAwB,EAAA;AAC1D,IAAA,IAAA,CAAK,iBACH,KAAM,CAAA,cAAA,KAAmB,WACrB,QACC,GAAA,oBAAA,IAAwB,MAAM,cAAkB,IAAA,KAAA;AACvD,IAAA,IAAA,CAAK,kBAAkB,KAAM,CAAA,eAAA;AAAA;AAC/B,EAEQ,uBAA0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AAK,CAAA,cAAA,GAAiB,EAAE,CAAA,CAAA,EAAI,KAAK,SAAS,CAAA,CAAA;AAAA;AAExD;;;;"}
@@ -4,4 +4,4 @@ declare const meta: Meta<typeof ComboBox>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof ComboBox>;
6
6
  export declare const Default: Story;
7
- //# sourceMappingURL=FilePicker.stories.d.ts.map
7
+ //# sourceMappingURL=FileComboBox.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileComboBox.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ComboBox/stories/FileComboBox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAmCjD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CA2E/B,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEvC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Sorting.d.ts","sourceRoot":"","sources":["../../../../../../src/components/List/model/sorting/Sorting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,8BAA8B,CAAC;AACrD,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACb,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EACV,MAAM,EACN,SAAS,EACT,UAAU,EACV,aAAa,EACb,SAAS,EACV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,qBAAa,OAAO,CAAC,CAAC;IACpB,gBAAuB,aAAa;;;;;;;;;QAKtB;IACd,SAAgB,IAAI,EAAE,IAAI,C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,IAAI,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAgB,SAAS,EAAE,aAAa,CAAC;IACzC,SAAgB,cAAc,EAAE,kBAAkB,CAAC;IACnD,SAAgB,eAAe,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;gBAE5B,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;IAaxD,OAAO,CAAC,uBAAuB;IAWxB,oBAAoB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI;IAO7C,uBAAuB,IAAI,UAAU;IAOrC,QAAQ,IAAI,OAAO;IAKnB,cAAc,IAAI,MAAM,CAAC,CAAC,CAAC;IAI3B,MAAM,IAAI,IAAI;IAOd,KAAK,IAAI,IAAI;IAIpB,IAAW,EAAE,IAAI,MAAM,CAEtB;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.2.0-alpha.272",
3
+ "version": "0.2.0-alpha.274",
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": "^2.1.4",
61
- "@mittwald/react-tunnel": "0.2.0-alpha.272",
61
+ "@mittwald/react-tunnel": "0.2.0-alpha.274",
62
62
  "@mittwald/react-use-promise": "^3.0.4",
63
63
  "@react-aria/form": "^3.0.16",
64
64
  "@react-aria/utils": "^3.29.0",
@@ -99,7 +99,7 @@
99
99
  "@faker-js/faker": "^9.8.0",
100
100
  "@internationalized/date": "^3.8.1",
101
101
  "@mittwald/flow-core": "",
102
- "@mittwald/flow-design-tokens": "0.2.0-alpha.272",
102
+ "@mittwald/flow-design-tokens": "0.2.0-alpha.274",
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": "",
@@ -181,5 +181,5 @@
181
181
  "optional": true
182
182
  }
183
183
  },
184
- "gitHead": "cf659aaa6e463f1fdb50301714c54a5060f05576"
184
+ "gitHead": "4d4c8c798032ddca54eb263eb636d89c887d2d6a"
185
185
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"FilePicker.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ComboBox/stories/FilePicker.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAmCjD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CAsE/B,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEvC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}