@designcrowd/fe-shared-lib 1.5.20-dts-upgrades → 1.5.20

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.
@@ -1,97 +0,0 @@
1
- import { Select, type SelectProps, type SelectEmits, type SelectOption } from '..';
2
-
3
- // Test SelectOption interface
4
- const simpleOption: SelectOption = {
5
- label: 'Option 1',
6
- };
7
-
8
- const disabledOption: SelectOption = {
9
- $isDisabled: true,
10
- label: 'Disabled Option',
11
- };
12
-
13
- const customOption: SelectOption = {
14
- isCustom: true,
15
- label: 'Custom Option',
16
- };
17
-
18
- const optionWithExtra: SelectOption = {
19
- label: 'With Extra',
20
- value: 123,
21
- customField: 'custom value',
22
- };
23
-
24
- // Test SelectProps with object options
25
- const selectWithObjectOptions: SelectProps = {
26
- options: [simpleOption, disabledOption],
27
- modelValue: simpleOption,
28
- trackBy: 'value',
29
- label: 'label',
30
- isSearchable: true,
31
- placeholder: 'Select an option',
32
- };
33
-
34
- // Test SelectProps with string options
35
- const selectWithStringOptions: SelectProps = {
36
- options: ['Option 1', 'Option 2', 'Option 3'],
37
- modelValue: 'Option 1',
38
- };
39
-
40
- // Test full props from selectMixin
41
- const fullMixinProps: SelectProps = {
42
- options: [],
43
- isInternalSearch: true,
44
- modelValue: null,
45
- trackBy: 'id',
46
- label: 'name',
47
- imageUrlField: 'imageUrl',
48
- isSearchable: true,
49
- shouldHideSelected: false,
50
- placeholder: 'Select...',
51
- shouldAllowEmpty: true,
52
- shouldResetAfter: false,
53
- shouldCloseOnSelect: true,
54
- customLabel: (option, label) => {
55
- if (typeof option === 'string') return option;
56
- return label ? String(option[label]) : String(option);
57
- },
58
- shouldAllowCustom: true,
59
- customPlaceholder: 'Press enter to create',
60
- customPosition: 'top',
61
- id: 'my-select',
62
- optionsLimit: 100,
63
- shouldPreserveSearch: false,
64
- shouldPreselectFirst: false,
65
- shouldPreventAutofocus: false,
66
- isDisabled: false,
67
- };
68
-
69
- // Test props from Select.vue
70
- const selectVueProps: SelectProps = {
71
- options: [],
72
- name: 'country-select',
73
- selectLabel: 'Press enter to select',
74
- selectedLabel: 'Selected',
75
- deselectLabel: 'Press enter to remove',
76
- shouldShowLabels: true,
77
- maxHeight: 300,
78
- isLoading: false,
79
- openDirection: 'below',
80
- shouldShowNoResults: true,
81
- tabindex: 0,
82
- shouldSelectExactMatchOnBlur: false,
83
- isInvalid: false,
84
- };
85
-
86
- // Test openDirection options
87
- const aboveDirection: SelectProps = { options: [], openDirection: 'above' };
88
- const belowDirection: SelectProps = { options: [], openDirection: 'below' };
89
- const topDirection: SelectProps = { options: [], openDirection: 'top' };
90
- const bottomDirection: SelectProps = { options: [], openDirection: 'bottom' };
91
-
92
- // Test customPosition options
93
- const topPosition: SelectProps = { options: [], customPosition: 'top' };
94
- const bottomPosition: SelectProps = { options: [], customPosition: 'bottom' };
95
-
96
- // Verify component type includes props and emits
97
- type SelectComponent = typeof Select;
@@ -1,80 +0,0 @@
1
- // types-test/text-input-props.test.ts
2
- // This file tests that TextInputProps and TextInputEmits interfaces are properly exported and typed
3
-
4
- import { TextInput, type TextInputProps, type TextInputEmits } from '..';
5
-
6
- // Test that TextInputProps can be used as a type
7
- const props: TextInputProps = {
8
- modelValue: 'test value',
9
- placeholder: 'Enter text...',
10
- label: 'Username',
11
- };
12
-
13
- // Test form control mixin props
14
- const attrs: TextInputProps['attrs'] = { 'data-testid': 'input' };
15
- const modelValue: TextInputProps['modelValue'] = 'value';
16
- const modelValueNumber: TextInputProps['modelValue'] = 123;
17
- const id: TextInputProps['id'] = 'input-1';
18
- const placeholder: TextInputProps['placeholder'] = 'Enter value';
19
- const size: TextInputProps['size'] = 'sm';
20
- const label: TextInputProps['label'] = 'Label';
21
- const showLabelScreenReaderOnly: TextInputProps['showLabelScreenReaderOnly'] = true;
22
- const icon: TextInputProps['icon'] = 'search';
23
- const required: TextInputProps['required'] = true;
24
- const error: TextInputProps['error'] = false;
25
- const warning: TextInputProps['warning'] = false;
26
- const success: TextInputProps['success'] = false;
27
- const disabled: TextInputProps['disabled'] = false;
28
- const readonly: TextInputProps['readonly'] = false;
29
- const name: TextInputProps['name'] = 'username';
30
- const maxlength: TextInputProps['maxlength'] = 100;
31
- const minlength: TextInputProps['minlength'] = 1;
32
- const isSpaceDisabled: TextInputProps['isSpaceDisabled'] = false;
33
- const requiredMessage: TextInputProps['requiredMessage'] = 'This field is required';
34
-
35
- // Test TextInput-specific props
36
- const type: TextInputProps['type'] = 'text';
37
- const typePassword: TextInputProps['type'] = 'password';
38
- const typeEmail: TextInputProps['type'] = 'email';
39
- const typeNumber: TextInputProps['type'] = 'number';
40
- const typeTel: TextInputProps['type'] = 'tel';
41
- const typeUrl: TextInputProps['type'] = 'url';
42
- const enableClear: TextInputProps['enableClear'] = true;
43
- const enableClearConfirmation: TextInputProps['enableClearConfirmation'] = true;
44
- const borderLeft: TextInputProps['borderLeft'] = true;
45
- const borderRight: TextInputProps['borderRight'] = true;
46
- const prefixText: TextInputProps['prefixText'] = 'https://';
47
- const elementClasses: TextInputProps['elementClasses'] = 'custom-class';
48
-
49
- // Test that TextInput component is typed
50
- const _textInput: typeof TextInput = TextInput;
51
-
52
- // Test complete props object
53
- const fullProps: TextInputProps = {
54
- attrs: { 'data-testid': 'input' },
55
- modelValue: '',
56
- id: 'email-input',
57
- placeholder: 'Enter email',
58
- size: 'sm',
59
- label: 'Email',
60
- showLabelScreenReaderOnly: false,
61
- icon: 'envelope-email',
62
- required: true,
63
- error: false,
64
- warning: false,
65
- success: false,
66
- disabled: false,
67
- readonly: false,
68
- name: 'email',
69
- maxlength: 255,
70
- minlength: 5,
71
- isSpaceDisabled: true,
72
- requiredMessage: 'Email is required',
73
- type: 'email',
74
- enableClear: true,
75
- enableClearConfirmation: false,
76
- borderLeft: true,
77
- borderRight: true,
78
- prefixText: undefined,
79
- elementClasses: '',
80
- };
@@ -1,72 +0,0 @@
1
- // types-test/textarea-props.test.ts
2
- // This file tests that TextareaProps interface is properly exported and typed
3
-
4
- import { Textarea, type TextareaProps, type TextInputEmits } from '..';
5
-
6
- // Test that TextareaProps can be used as a type
7
- const props: TextareaProps = {
8
- modelValue: 'test value',
9
- placeholder: 'Enter text...',
10
- label: 'Description',
11
- };
12
-
13
- // Test form control mixin props (shared with TextInput)
14
- const attrs: TextareaProps['attrs'] = { 'data-testid': 'textarea' };
15
- const modelValue: TextareaProps['modelValue'] = 'value';
16
- const modelValueNumber: TextareaProps['modelValue'] = 123;
17
- const id: TextareaProps['id'] = 'textarea-1';
18
- const placeholder: TextareaProps['placeholder'] = 'Enter value';
19
- const label: TextareaProps['label'] = 'Label';
20
- const showLabelScreenReaderOnly: TextareaProps['showLabelScreenReaderOnly'] = true;
21
- const icon: TextareaProps['icon'] = 'edit';
22
- const required: TextareaProps['required'] = true;
23
- const error: TextareaProps['error'] = false;
24
- const warning: TextareaProps['warning'] = false;
25
- const success: TextareaProps['success'] = false;
26
- const disabled: TextareaProps['disabled'] = false;
27
- const readonly: TextareaProps['readonly'] = false;
28
- const name: TextareaProps['name'] = 'description';
29
- const maxlength: TextareaProps['maxlength'] = 1000;
30
- const minlength: TextareaProps['minlength'] = 10;
31
- const isSpaceDisabled: TextareaProps['isSpaceDisabled'] = false;
32
- const requiredMessage: TextareaProps['requiredMessage'] = 'This field is required';
33
-
34
- // Test size variants (Textarea supports sm, md, lg)
35
- const sizeSm: TextareaProps = { size: 'sm' };
36
- const sizeMd: TextareaProps = { size: 'md' };
37
- const sizeLg: TextareaProps = { size: 'lg' };
38
-
39
- // Test Textarea-specific props
40
- const resize: TextareaProps['resize'] = true;
41
- const resizeFalse: TextareaProps['resize'] = false;
42
- const shouldAutoFitContent: TextareaProps['shouldAutoFitContent'] = true;
43
- const elementClasses: TextareaProps['elementClasses'] = 'custom-class';
44
-
45
- // Test that Textarea component is typed
46
- const _textarea: typeof Textarea = Textarea;
47
-
48
- // Test complete props object
49
- const fullProps: TextareaProps = {
50
- attrs: { 'data-testid': 'textarea' },
51
- modelValue: '',
52
- id: 'bio-textarea',
53
- placeholder: 'Tell us about yourself',
54
- size: 'md',
55
- label: 'Bio',
56
- showLabelScreenReaderOnly: false,
57
- icon: undefined,
58
- required: false,
59
- error: false,
60
- warning: false,
61
- success: false,
62
- disabled: false,
63
- readonly: false,
64
- name: 'bio',
65
- maxlength: 500,
66
- minlength: 0,
67
- isSpaceDisabled: false,
68
- requiredMessage: 'Bio is required',
69
- resize: true,
70
- shouldAutoFitContent: false,
71
- elementClasses: '',
72
- };
@@ -1,12 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "module": "ESNext",
5
- "moduleResolution": "bundler",
6
- "strict": true,
7
- "noEmit": true,
8
- "skipLibCheck": true,
9
- "types": ["node"]
10
- },
11
- "include": ["*.test.ts"]
12
- }