Skip to content

Commit

Permalink
🚧 [#5016] Referentielijsten dataSrc for options
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Jan 14, 2025
1 parent d679665 commit 385ce3e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/formio/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,12 @@ export interface VariableValues {
dataSrc: 'variable';
itemsExpression: string | JSONObject;
}

/**
* @category Utilities
*/
export interface ReferentielijstenValues {
dataSrc: 'referentielijsten';
service: string;
code: string;
}
17 changes: 15 additions & 2 deletions src/formio/components/select.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {InputComponentSchema} from '..';
import {MultipleCapable} from '../base';
import {ManualValues, Option, VariableValues} from '../common';
import {ManualValues, Option, ReferentielijstenValues, VariableValues} from '../common';
import {Require} from '../util';

type Validator = 'required';
Expand Down Expand Up @@ -50,10 +50,23 @@ type SelectManualValuesSchema = Omit<SelectInputSchema<ManualValues>, SelectUnsu
type SelectVariableValuesSchema = Omit<SelectInputSchema<VariableValues>, SelectUnsupported> &
BaseSelectSchema;

/**
* @group Form.io components
* @category Base types
*/
type SelectReferentielijstenValuesSchema = Omit<
SelectInputSchema<ReferentielijstenValues>,
SelectUnsupported
> &
BaseSelectSchema;

/**
* @group Form.io components
* @category Concrete types
*/
export type SelectComponentSchema = MultipleCapable<
Require<SelectManualValuesSchema | SelectVariableValuesSchema, 'openForms'>
Require<
SelectManualValuesSchema | SelectVariableValuesSchema | SelectReferentielijstenValuesSchema,
'openForms'
>
>;

0 comments on commit 385ce3e

Please sign in to comment.