From 03544ebdea4b3de86e600983ea934f69e952e7b1 Mon Sep 17 00:00:00 2001 From: hextraza Date: Mon, 6 May 2024 17:57:34 -0700 Subject: [PATCH] Story cases for valueInput --- stories/Field-type-info.stories.js | 97 +++++++++++++++++++++++++++++- 1 file changed, 94 insertions(+), 3 deletions(-) diff --git a/stories/Field-type-info.stories.js b/stories/Field-type-info.stories.js index df486c8..b856ff6 100644 --- a/stories/Field-type-info.stories.js +++ b/stories/Field-type-info.stories.js @@ -14,8 +14,99 @@ export default { args: { handleFilterChange: fn() }, }; -export const Primary = { + +export const SingleInputNoAllowableValues = { args: { + filter: { + field: 'exampleField', + operator: '=', + value: 'singleValue' + }, + index: 1, + highlightedInputs: [{field: "", operator: "", value: ""}], + allowedGroupNames: null, + fieldTypeInfo: [ + { + name: 'exampleField', + label: 'Example Field', + description: 'A field that allows a single value with no specific allowable values.', + type: 'string', + isInDefaultColumns: true, + isMultiValued: false, + isHidden: false, + colWidth: 100, + formatString: '', + orderKey: 1, + allowableValues: [], + category: '', + url: '', + flex: 1, + supportsFilter: true + } + ] + } +}; - }, - }; \ No newline at end of file +export const MultiInputWithAllowableValues = { + args: { + filter: { + field: 'multiExampleField', + operator: 'IN', + value: 'value1,value2' + }, + index: 2, + highlightedInputs: [{field: "", operator: "", value: ""}], + allowedGroupNames: null, + fieldTypeInfo: [ + { + name: 'multiExampleField', + label: 'Multi-Example Field', + description: 'A field that allows multiple values with specific allowable values.', + type: 'string', + isInDefaultColumns: true, + isMultiValued: true, + isHidden: false, + colWidth: 150, + formatString: '', + orderKey: 2, + allowableValues: ['value1', 'value2', 'value3', 'value4', 'value5', 'value6', 'value7', 'value8', 'value9', 'value10', 'value11'], + category: '', + url: '', + flex: 1, + supportsFilter: true + } + ] + } +} + +export const InSetWithGroupNames = { + args: { + filter: { + field: 'groupExampleField', + operator: 'in set', + value: 'group1' + }, + index: 3, + highlightedInputs: [{field: false, operator: true, value: true}], + allowedGroupNames: ['group1', 'group2', 'group3', 'group4'], + fieldTypeInfo: [ + { + name: 'groupExampleField', + label: 'Group Example Field', + description: 'A field with the operator "in set" and selectable group names.', + type: 'string', + isInDefaultColumns: true, + isMultiValued: false, + isHidden: false, + colWidth: 150, + formatString: '', + orderKey: 3, + allowableValues: [], + category: '', + url: '', + flex: 1, + supportsFilter: true + } + ] + } +} \ No newline at end of file