tide-design-system 2.4.5 → 2.4.6
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/dist/css/reset.css +1 -1
- package/dist/css/utilities-responsive.css +0 -546
- package/dist/style.css +1 -1
- package/dist/tide-design-system.cjs +2 -2
- package/dist/tide-design-system.esm.d.ts +19 -6
- package/dist/tide-design-system.esm.js +1201 -1170
- package/dist/utilities/storybook.ts +6 -2
- package/dist/utilities/validation.ts +1 -1
- package/index.ts +4 -4
- package/package.json +1 -1
- package/src/assets/css/reset.css +1 -1
- package/src/assets/css/utilities-responsive.css +0 -546
- package/src/components/TideButton.vue +14 -4
- package/src/components/TideButtonIcon.vue +12 -2
- package/src/components/TideButtonPagination.vue +11 -16
- package/src/components/TideButtonSegmented.vue +1 -0
- package/src/components/TideCard.vue +11 -2
- package/src/components/TideCarousel.vue +9 -4
- package/src/components/TideChipAction.vue +1 -0
- package/src/components/TideChipFilter.vue +1 -0
- package/src/components/TideChipInput.vue +1 -0
- package/src/components/TideIcon.vue +1 -1
- package/src/components/TideImage.vue +9 -9
- package/src/components/TideInputText.vue +2 -0
- package/src/components/TideInputTextDeprecated.vue +2 -0
- package/src/components/TideInputTextarea.vue +2 -2
- package/src/components/TideLink.vue +2 -1
- package/src/components/TideModal.vue +91 -85
- package/src/components/TideSwitch.vue +1 -0
- package/src/stories/TideButtonPagination.stories.ts +6 -6
- package/src/stories/TideCarousel.stories.ts +0 -1
- package/src/stories/TideInputCheckbox.stories.ts +58 -23
- package/src/stories/TideInputRadio.stories.ts +39 -30
- package/src/stories/TideInputSelect.stories.ts +51 -27
- package/src/stories/TideInputText.stories.ts +83 -23
- package/src/stories/TideInputTextarea.stories.ts +66 -17
- package/src/stories/TideLink.stories.ts +1 -14
- package/src/stories/TidePagination.stories.ts +2 -2
- package/src/stories/TidePopover.stories.ts +1 -1
- package/src/types/Badge.ts +4 -0
- package/src/types/Element.ts +2 -2
- package/src/types/Storybook.ts +4 -6
- package/src/types/Type.ts +6 -0
- package/src/utilities/storybook.ts +6 -2
- package/src/utilities/validation.ts +1 -1
|
@@ -16,7 +16,7 @@ type Args = InstanceType<typeof TideButtonPagination>['$props'] & {
|
|
|
16
16
|
click: string;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const ELEMENT_BROAD = prependNoneAsUndefined(STANDARD_ELEMENT.ELEMENT_BROAD);
|
|
20
20
|
|
|
21
21
|
const render = (args: Args) => ({
|
|
22
22
|
components: { TideButtonPagination },
|
|
@@ -44,7 +44,7 @@ export default {
|
|
|
44
44
|
argTypes: {
|
|
45
45
|
click: {
|
|
46
46
|
...click,
|
|
47
|
-
if: { arg: 'element', neq:
|
|
47
|
+
if: { arg: 'element', neq: ELEMENT_BROAD.LINK },
|
|
48
48
|
},
|
|
49
49
|
dataTrack,
|
|
50
50
|
disabled: {
|
|
@@ -52,11 +52,11 @@ export default {
|
|
|
52
52
|
description: 'Indicates whether Pagination Button is associated with the displayed page',
|
|
53
53
|
if: {
|
|
54
54
|
arg: 'element',
|
|
55
|
-
eq:
|
|
55
|
+
eq: ELEMENT_BROAD.BUTTON,
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
58
|
element: {
|
|
59
|
-
...formatArgType({
|
|
59
|
+
...formatArgType({ ELEMENT_BROAD }),
|
|
60
60
|
description: 'HTML tag type',
|
|
61
61
|
table: {
|
|
62
62
|
defaultValue: { summary: 'BUTTON' },
|
|
@@ -64,7 +64,7 @@ export default {
|
|
|
64
64
|
},
|
|
65
65
|
href: {
|
|
66
66
|
description: 'URL to open<br />(Link only)',
|
|
67
|
-
if: { arg: 'element', eq:
|
|
67
|
+
if: { arg: 'element', eq: ELEMENT_BROAD.LINK },
|
|
68
68
|
table: {
|
|
69
69
|
defaultValue: { summary: 'None' },
|
|
70
70
|
type: { summary: 'string' },
|
|
@@ -73,7 +73,7 @@ export default {
|
|
|
73
73
|
isNewTab: {
|
|
74
74
|
...argTypeBooleanUnrequired,
|
|
75
75
|
description: 'Determines whether to target a new browser tab<br />(Link only)',
|
|
76
|
-
if: { arg: 'element', eq:
|
|
76
|
+
if: { arg: 'element', eq: ELEMENT_BROAD.LINK },
|
|
77
77
|
},
|
|
78
78
|
label: {
|
|
79
79
|
control: 'text',
|
|
@@ -1,53 +1,72 @@
|
|
|
1
1
|
import { action } from '@storybook/addon-actions';
|
|
2
|
+
import { ref } from 'vue';
|
|
2
3
|
|
|
3
4
|
import TideInputCheckbox from '@/components/TideInputCheckbox.vue';
|
|
4
|
-
import { argTypeBooleanUnrequired,
|
|
5
|
-
|
|
6
|
-
import type { StoryContext } from '@storybook/vue3';
|
|
5
|
+
import { argTypeBooleanUnrequired, dataTrack, disabledArgType, doSomething, parameters } from '@/utilities/storybook';
|
|
7
6
|
|
|
8
7
|
type Args = InstanceType<typeof TideInputCheckbox>['$props'] & {
|
|
9
|
-
|
|
8
|
+
handleValid: string;
|
|
9
|
+
vModel: string;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
const render = (args: Args
|
|
12
|
+
const render = (args: Args) => ({
|
|
13
13
|
components: { TideInputCheckbox },
|
|
14
14
|
methods: {
|
|
15
15
|
doSomething,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
action('TideInputCheckbox clicked')({});
|
|
20
|
-
context.updateArgs({ ...args, checked: !input?.checked === true, indeterminate: undefined });
|
|
16
|
+
handleValid: () => {
|
|
17
|
+
action('TideInputText valid was emitted')({});
|
|
21
18
|
|
|
22
19
|
try {
|
|
23
|
-
const callback = eval(args.
|
|
20
|
+
const callback = eval(args.handleValid);
|
|
24
21
|
|
|
25
22
|
if (callback) {
|
|
26
23
|
callback();
|
|
27
24
|
}
|
|
28
25
|
} catch {
|
|
29
|
-
alert('Please specify a valid handler in the "
|
|
26
|
+
alert('Please specify a valid handler in the "valid" control.');
|
|
30
27
|
}
|
|
31
28
|
},
|
|
32
29
|
},
|
|
33
|
-
setup
|
|
34
|
-
|
|
30
|
+
setup() {
|
|
31
|
+
const model = ref<boolean>(false);
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
args: {
|
|
35
|
+
...args,
|
|
36
|
+
inputId: undefined, // Do not allow empty ID attribute to break the demo.
|
|
37
|
+
},
|
|
38
|
+
model,
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
template: `<TideInputCheckbox @valid="handleValid" v-bind="args" v-model="model" />`,
|
|
35
42
|
});
|
|
36
43
|
|
|
37
44
|
export default {
|
|
38
45
|
argTypes: {
|
|
39
|
-
checked: {
|
|
40
|
-
...argTypeBooleanUnrequired,
|
|
41
|
-
description: 'Determines whether Checkbox is checked or unchecked',
|
|
42
|
-
},
|
|
43
|
-
click: {
|
|
44
|
-
...click,
|
|
45
|
-
},
|
|
46
46
|
dataTrack,
|
|
47
47
|
disabled: {
|
|
48
48
|
...argTypeBooleanUnrequired,
|
|
49
49
|
description: 'Determines whether Checkbox state is interactable',
|
|
50
50
|
},
|
|
51
|
+
error: {
|
|
52
|
+
control: 'text',
|
|
53
|
+
description: 'Overrides the default error message and valid state',
|
|
54
|
+
table: {
|
|
55
|
+
defaultValue: { summary: 'None' },
|
|
56
|
+
type: { summary: 'string' },
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
handleValid: {
|
|
60
|
+
control: 'text',
|
|
61
|
+
description: 'JS code or function to execute on valid event',
|
|
62
|
+
isEmit: true,
|
|
63
|
+
name: 'valid',
|
|
64
|
+
table: {
|
|
65
|
+
category: 'Events',
|
|
66
|
+
defaultValue: { summary: 'None' },
|
|
67
|
+
type: { summary: '(isValid: boolean) => void' },
|
|
68
|
+
},
|
|
69
|
+
},
|
|
51
70
|
indeterminate: {
|
|
52
71
|
...argTypeBooleanUnrequired,
|
|
53
72
|
description: 'Determines whether Checkbox is indeterminate',
|
|
@@ -85,17 +104,33 @@ export default {
|
|
|
85
104
|
type: { summary: 'number' },
|
|
86
105
|
},
|
|
87
106
|
},
|
|
107
|
+
required: {
|
|
108
|
+
...argTypeBooleanUnrequired,
|
|
109
|
+
description: 'Determines whether input is required',
|
|
110
|
+
},
|
|
111
|
+
vModel: {
|
|
112
|
+
control: 'text',
|
|
113
|
+
description: 'Data binding to Vue ref',
|
|
114
|
+
table: {
|
|
115
|
+
category: 'Native',
|
|
116
|
+
defaultValue: { summary: 'None' },
|
|
117
|
+
type: { summary: 'Ref' },
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
valid: disabledArgType,
|
|
88
121
|
},
|
|
89
122
|
args: {
|
|
90
|
-
checked: undefined,
|
|
91
|
-
click: 'doSomething',
|
|
92
123
|
dataTrack: '',
|
|
93
124
|
disabled: undefined,
|
|
125
|
+
error: '',
|
|
126
|
+
handleValid: 'doSomething',
|
|
94
127
|
indeterminate: undefined,
|
|
95
128
|
inputId: '',
|
|
96
129
|
label: 'Input label',
|
|
97
130
|
name: '',
|
|
98
131
|
number: '',
|
|
132
|
+
required: undefined,
|
|
133
|
+
vModel: '',
|
|
99
134
|
},
|
|
100
135
|
component: TideInputCheckbox,
|
|
101
136
|
parameters,
|
|
@@ -1,46 +1,38 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ref, watch } from 'vue';
|
|
2
2
|
|
|
3
3
|
import TideInputRadio from '@/components/TideInputRadio.vue';
|
|
4
|
-
import { argTypeBooleanUnrequired,
|
|
4
|
+
import { argTypeBooleanUnrequired, dataTrack, parameters } from '@/utilities/storybook';
|
|
5
5
|
|
|
6
6
|
import type { StoryContext } from '@storybook/vue3';
|
|
7
7
|
|
|
8
|
-
type Args = InstanceType<typeof TideInputRadio>['$props']
|
|
9
|
-
click: string;
|
|
10
|
-
};
|
|
8
|
+
type Args = InstanceType<typeof TideInputRadio>['$props'];
|
|
11
9
|
|
|
12
10
|
const render = (args: Args, context: StoryContext) => ({
|
|
13
11
|
components: { TideInputRadio },
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
handleClick: () => {
|
|
17
|
-
const input = context.canvasElement.querySelector('input');
|
|
18
|
-
|
|
19
|
-
action('TideInputRadio changed')({});
|
|
20
|
-
context.updateArgs({ ...args, checked: !input?.checked });
|
|
21
|
-
|
|
22
|
-
try {
|
|
23
|
-
const callback = eval(args.click);
|
|
12
|
+
setup() {
|
|
13
|
+
const model = ref<string | undefined>(undefined);
|
|
24
14
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
watch(
|
|
16
|
+
() => ({ ...args }),
|
|
17
|
+
(newArgs) => {
|
|
18
|
+
// Reset v-model when arg table is reset.
|
|
19
|
+
if (JSON.stringify(newArgs) === JSON.stringify(context.allArgs)) model.value = undefined;
|
|
30
20
|
}
|
|
31
|
-
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
args: {
|
|
25
|
+
...args,
|
|
26
|
+
inputId: undefined,
|
|
27
|
+
},
|
|
28
|
+
model,
|
|
29
|
+
};
|
|
32
30
|
},
|
|
33
|
-
|
|
34
|
-
template: `<TideInputRadio @click="handleClick" v-bind="args" />`,
|
|
31
|
+
template: `<TideInputRadio v-bind="args" v-model="model" />`,
|
|
35
32
|
});
|
|
36
33
|
|
|
37
34
|
export default {
|
|
38
35
|
argTypes: {
|
|
39
|
-
checked: {
|
|
40
|
-
...argTypeBooleanUnrequired,
|
|
41
|
-
description: 'Determines whether input is selected',
|
|
42
|
-
},
|
|
43
|
-
click,
|
|
44
36
|
dataTrack,
|
|
45
37
|
disabled: {
|
|
46
38
|
...argTypeBooleanUnrequired,
|
|
@@ -78,16 +70,33 @@ export default {
|
|
|
78
70
|
type: { summary: 'number' },
|
|
79
71
|
},
|
|
80
72
|
},
|
|
73
|
+
vModel: {
|
|
74
|
+
control: 'text',
|
|
75
|
+
description: 'Data binding to Vue ref',
|
|
76
|
+
table: {
|
|
77
|
+
category: 'Native',
|
|
78
|
+
defaultValue: { summary: 'None' },
|
|
79
|
+
type: { summary: 'Ref' },
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
value: {
|
|
83
|
+
control: 'text',
|
|
84
|
+
description: 'Value attribute',
|
|
85
|
+
table: {
|
|
86
|
+
defaultValue: { summary: 'None' },
|
|
87
|
+
type: { summary: 'string' },
|
|
88
|
+
},
|
|
89
|
+
},
|
|
81
90
|
},
|
|
82
91
|
args: {
|
|
83
|
-
checked: undefined,
|
|
84
|
-
click: 'doSomething',
|
|
85
92
|
dataTrack: '',
|
|
86
93
|
disabled: undefined,
|
|
87
94
|
inputId: '',
|
|
88
95
|
label: 'Input label',
|
|
89
96
|
name: '',
|
|
90
97
|
number: '',
|
|
98
|
+
vModel: '',
|
|
99
|
+
value: '',
|
|
91
100
|
},
|
|
92
101
|
component: TideInputRadio,
|
|
93
102
|
parameters,
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { action } from '@storybook/addon-actions';
|
|
2
2
|
|
|
3
3
|
import TideInputSelect from '@/components/TideInputSelect.vue';
|
|
4
|
+
import * as STANDARD_ERROR_DISPLAY from '@/types/Validation';
|
|
4
5
|
import {
|
|
5
6
|
argTypeBooleanUnrequired,
|
|
6
7
|
change,
|
|
7
8
|
dataTrack,
|
|
9
|
+
disabledArgType,
|
|
8
10
|
doSomething,
|
|
9
11
|
formatArgType,
|
|
10
|
-
getLabelsFromOptions,
|
|
11
12
|
parameters,
|
|
13
|
+
prependNoneAsUndefined,
|
|
12
14
|
} from '@/utilities/storybook';
|
|
13
15
|
|
|
14
16
|
import type { SelectOption, SelectOptionGroup } from '@/types/Select';
|
|
@@ -16,20 +18,10 @@ import type { StoryContext } from '@storybook/vue3';
|
|
|
16
18
|
|
|
17
19
|
type Args = InstanceType<typeof TideInputSelect>['$props'] & {
|
|
18
20
|
change: string;
|
|
21
|
+
handleValid: string;
|
|
22
|
+
vModel: string;
|
|
19
23
|
};
|
|
20
|
-
|
|
21
|
-
const options = {
|
|
22
|
-
'Any': '',
|
|
23
|
-
'Option 1': 1,
|
|
24
|
-
'Option 2': 2,
|
|
25
|
-
'Option 3': 3,
|
|
26
|
-
'Option A1': 'A1',
|
|
27
|
-
'Option A2': 'A2',
|
|
28
|
-
'Option A3': 'A3',
|
|
29
|
-
'Option B1': 'B1',
|
|
30
|
-
'Option B2': 'B2',
|
|
31
|
-
'Option B3': 'B3',
|
|
32
|
-
};
|
|
24
|
+
const ERROR_DISPLAY = prependNoneAsUndefined(STANDARD_ERROR_DISPLAY.ERROR_DISPLAY);
|
|
33
25
|
|
|
34
26
|
const selectOptionGroups: (SelectOption | SelectOptionGroup)[] = [
|
|
35
27
|
{
|
|
@@ -107,9 +99,22 @@ const render = (args: Args, context: StoryContext) => ({
|
|
|
107
99
|
alert('Please specify a valid handler in the "change" control.');
|
|
108
100
|
}
|
|
109
101
|
},
|
|
102
|
+
handleValid: () => {
|
|
103
|
+
action('TideInputSelect valid was emitted')({});
|
|
104
|
+
|
|
105
|
+
try {
|
|
106
|
+
const callback = eval(args.handleValid);
|
|
107
|
+
|
|
108
|
+
if (callback) {
|
|
109
|
+
callback();
|
|
110
|
+
}
|
|
111
|
+
} catch {
|
|
112
|
+
alert('Please specify a valid handler in the "valid" control.');
|
|
113
|
+
}
|
|
114
|
+
},
|
|
110
115
|
},
|
|
111
116
|
setup: () => ({ args }),
|
|
112
|
-
template: `<TideInputSelect @change="handleChange" v-bind="args" />`,
|
|
117
|
+
template: `<TideInputSelect @change="handleChange" @valid="handleValid" v-bind="args" />`,
|
|
113
118
|
});
|
|
114
119
|
|
|
115
120
|
export default {
|
|
@@ -121,8 +126,27 @@ export default {
|
|
|
121
126
|
description: 'Determines whether Select is interactable',
|
|
122
127
|
},
|
|
123
128
|
error: {
|
|
124
|
-
|
|
125
|
-
description: '
|
|
129
|
+
control: 'text',
|
|
130
|
+
description: 'Overrides the default error message and valid state',
|
|
131
|
+
table: {
|
|
132
|
+
defaultValue: { summary: 'None' },
|
|
133
|
+
type: { summary: 'string' },
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
errorDisplay: {
|
|
137
|
+
...formatArgType({ ERROR_DISPLAY }),
|
|
138
|
+
description: 'Determines whether errors display prior to blur',
|
|
139
|
+
},
|
|
140
|
+
handleValid: {
|
|
141
|
+
control: 'text',
|
|
142
|
+
description: 'JS code or function to execute on valid event',
|
|
143
|
+
isEmit: true,
|
|
144
|
+
name: 'valid',
|
|
145
|
+
table: {
|
|
146
|
+
category: 'Events',
|
|
147
|
+
defaultValue: { summary: 'None' },
|
|
148
|
+
type: { summary: '(isValid: boolean) => void' },
|
|
149
|
+
},
|
|
126
150
|
},
|
|
127
151
|
inputId: {
|
|
128
152
|
control: 'text',
|
|
@@ -180,24 +204,24 @@ export default {
|
|
|
180
204
|
type: { summary: 'string' },
|
|
181
205
|
},
|
|
182
206
|
},
|
|
183
|
-
|
|
184
|
-
control:
|
|
185
|
-
|
|
186
|
-
type: 'select',
|
|
187
|
-
},
|
|
188
|
-
description: 'Determines which tab should be active by default<br />(Subsequently managed within component)',
|
|
189
|
-
options: Object.values(options),
|
|
207
|
+
vModel: {
|
|
208
|
+
control: 'text',
|
|
209
|
+
description: 'Data binding to Vue ref',
|
|
190
210
|
table: {
|
|
211
|
+
category: 'Native',
|
|
191
212
|
defaultValue: { summary: 'None' },
|
|
192
|
-
type: { summary: '
|
|
213
|
+
type: { summary: 'Ref' },
|
|
193
214
|
},
|
|
194
215
|
},
|
|
216
|
+
valid: disabledArgType,
|
|
195
217
|
},
|
|
196
218
|
args: {
|
|
197
219
|
change: 'doSomething',
|
|
198
220
|
dataTrack: '',
|
|
199
221
|
disabled: undefined,
|
|
200
|
-
error:
|
|
222
|
+
error: '',
|
|
223
|
+
errorDisplay: undefined,
|
|
224
|
+
handleValid: 'doSomething',
|
|
201
225
|
inputId: '',
|
|
202
226
|
label: 'Input label',
|
|
203
227
|
name: '',
|
|
@@ -205,7 +229,7 @@ export default {
|
|
|
205
229
|
options: selectOptions,
|
|
206
230
|
required: undefined,
|
|
207
231
|
supportingText: '',
|
|
208
|
-
|
|
232
|
+
vModel: '',
|
|
209
233
|
},
|
|
210
234
|
component: TideInputSelect,
|
|
211
235
|
parameters,
|
|
@@ -3,38 +3,51 @@ import { action } from '@storybook/addon-actions';
|
|
|
3
3
|
import TideInputText from '@/components/TideInputText.vue';
|
|
4
4
|
import * as STANDARD_FORMAT from '@/types/Formatted';
|
|
5
5
|
import * as STANDARD_ICON from '@/types/Icon';
|
|
6
|
-
import * as
|
|
6
|
+
import * as STANDARD_TEXT_INPUT from '@/types/TextInput';
|
|
7
|
+
import * as STANDARD_ERROR_DISPLAY from '@/types/Validation';
|
|
7
8
|
import { VALIDATOR } from '@/types/Validation';
|
|
8
9
|
import {
|
|
9
10
|
argTypeBooleanUnrequired,
|
|
10
11
|
dataTrack,
|
|
11
12
|
disabledArgType,
|
|
13
|
+
doSomething,
|
|
12
14
|
formatArgType,
|
|
13
15
|
formatArgTypeCheck,
|
|
14
16
|
parameters,
|
|
15
17
|
prependNoneAsUndefined,
|
|
16
18
|
} from '@/utilities/storybook';
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
type Args = InstanceType<typeof TideInputText>['$props'] & {
|
|
21
|
+
handleValid: string;
|
|
22
|
+
vModel: string;
|
|
23
|
+
};
|
|
21
24
|
|
|
25
|
+
const ERROR_DISPLAY = prependNoneAsUndefined(STANDARD_ERROR_DISPLAY.ERROR_DISPLAY);
|
|
22
26
|
const FORMAT = prependNoneAsUndefined(STANDARD_FORMAT.FORMAT);
|
|
23
27
|
const ICON = prependNoneAsUndefined(STANDARD_ICON.ICON);
|
|
24
|
-
const TEXT_INPUT_TYPE = prependNoneAsUndefined(
|
|
28
|
+
const TEXT_INPUT_TYPE = prependNoneAsUndefined(STANDARD_TEXT_INPUT.TEXT_INPUT_TYPE);
|
|
29
|
+
const INPUT_MODE = prependNoneAsUndefined(STANDARD_TEXT_INPUT.INPUT_MODE);
|
|
25
30
|
|
|
26
|
-
const render = (args: Args
|
|
31
|
+
const render = (args: Args) => ({
|
|
27
32
|
components: { TideInputText },
|
|
28
33
|
methods: {
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
doSomething,
|
|
35
|
+
handleValid: () => {
|
|
36
|
+
action('TideInputText valid was emitted')({});
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
const callback = eval(args.handleValid);
|
|
31
40
|
|
|
32
|
-
|
|
33
|
-
|
|
41
|
+
if (callback) {
|
|
42
|
+
callback();
|
|
43
|
+
}
|
|
44
|
+
} catch {
|
|
45
|
+
alert('Please specify a valid handler in the "valid" control.');
|
|
46
|
+
}
|
|
34
47
|
},
|
|
35
48
|
},
|
|
36
49
|
setup: () => ({ args }),
|
|
37
|
-
template: `<TideInputText @
|
|
50
|
+
template: `<TideInputText @valid="handleValid" v-bind="args" />`,
|
|
38
51
|
});
|
|
39
52
|
|
|
40
53
|
export default {
|
|
@@ -47,10 +60,33 @@ export default {
|
|
|
47
60
|
disabled: {
|
|
48
61
|
...argTypeBooleanUnrequired,
|
|
49
62
|
description: 'Determines whether input is interactable',
|
|
63
|
+
table: {
|
|
64
|
+
...argTypeBooleanUnrequired.table,
|
|
65
|
+
category: 'Native',
|
|
66
|
+
},
|
|
50
67
|
},
|
|
51
68
|
error: {
|
|
52
|
-
|
|
53
|
-
description: '
|
|
69
|
+
control: 'text',
|
|
70
|
+
description: 'Overrides the default error message and valid state',
|
|
71
|
+
table: {
|
|
72
|
+
defaultValue: { summary: 'None' },
|
|
73
|
+
type: { summary: 'string' },
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
errorDisplay: {
|
|
77
|
+
...formatArgType({ ERROR_DISPLAY }),
|
|
78
|
+
description: 'Determines whether errors display prior to blur',
|
|
79
|
+
},
|
|
80
|
+
handleValid: {
|
|
81
|
+
control: 'text',
|
|
82
|
+
description: 'JS code or function to execute on valid event',
|
|
83
|
+
isEmit: true,
|
|
84
|
+
name: 'valid',
|
|
85
|
+
table: {
|
|
86
|
+
category: 'Events',
|
|
87
|
+
defaultValue: { summary: 'None' },
|
|
88
|
+
type: { summary: '(isValid: boolean) => void' },
|
|
89
|
+
},
|
|
54
90
|
},
|
|
55
91
|
hasClear: {
|
|
56
92
|
...argTypeBooleanUnrequired,
|
|
@@ -69,6 +105,15 @@ export default {
|
|
|
69
105
|
type: { summary: 'string' },
|
|
70
106
|
},
|
|
71
107
|
},
|
|
108
|
+
inputmode: {
|
|
109
|
+
...formatArgType({ INPUT_MODE }),
|
|
110
|
+
description: 'Determines the input editing features offered by the browser',
|
|
111
|
+
table: {
|
|
112
|
+
category: 'Native',
|
|
113
|
+
defaultValue: { summary: 'None' },
|
|
114
|
+
type: { summary: 'string' },
|
|
115
|
+
},
|
|
116
|
+
},
|
|
72
117
|
label: {
|
|
73
118
|
control: 'text',
|
|
74
119
|
description: 'Label content',
|
|
@@ -81,6 +126,7 @@ export default {
|
|
|
81
126
|
control: 'text',
|
|
82
127
|
description: 'Applies a maximum character count to the input',
|
|
83
128
|
table: {
|
|
129
|
+
category: 'Native',
|
|
84
130
|
defaultValue: { summary: 'None' },
|
|
85
131
|
type: { summary: 'number' },
|
|
86
132
|
},
|
|
@@ -89,6 +135,7 @@ export default {
|
|
|
89
135
|
control: 'text',
|
|
90
136
|
description: 'Applies a minimum character count to the input',
|
|
91
137
|
table: {
|
|
138
|
+
category: 'Native',
|
|
92
139
|
defaultValue: { summary: 'None' },
|
|
93
140
|
type: { summary: 'number' },
|
|
94
141
|
},
|
|
@@ -97,6 +144,7 @@ export default {
|
|
|
97
144
|
control: 'text',
|
|
98
145
|
description: 'Name attribute',
|
|
99
146
|
table: {
|
|
147
|
+
category: 'Native',
|
|
100
148
|
defaultValue: { summary: 'None' },
|
|
101
149
|
type: { summary: 'string' },
|
|
102
150
|
},
|
|
@@ -112,6 +160,10 @@ export default {
|
|
|
112
160
|
required: {
|
|
113
161
|
...argTypeBooleanUnrequired,
|
|
114
162
|
description: 'Determines whether input is required',
|
|
163
|
+
table: {
|
|
164
|
+
...argTypeBooleanUnrequired.table,
|
|
165
|
+
category: 'Native',
|
|
166
|
+
},
|
|
115
167
|
},
|
|
116
168
|
suffix: {
|
|
117
169
|
control: 'text',
|
|
@@ -136,29 +188,37 @@ export default {
|
|
|
136
188
|
type: {
|
|
137
189
|
...formatArgType({ TEXT_INPUT_TYPE }),
|
|
138
190
|
description: 'Determines the type(s) of values expected by the input',
|
|
191
|
+
table: {
|
|
192
|
+
...formatArgType({ TEXT_INPUT_TYPE }).table,
|
|
193
|
+
category: 'Native',
|
|
194
|
+
},
|
|
139
195
|
},
|
|
140
|
-
|
|
141
|
-
validators: {
|
|
142
|
-
...formatArgTypeCheck({ VALIDATOR }),
|
|
143
|
-
description: 'Determines method(s) used to check for valid input value upon invoking relevant listener event(s)',
|
|
144
|
-
},
|
|
145
|
-
value: {
|
|
196
|
+
vModel: {
|
|
146
197
|
control: 'text',
|
|
147
|
-
description: '
|
|
198
|
+
description: 'Data binding to Vue ref',
|
|
148
199
|
table: {
|
|
200
|
+
category: 'Native',
|
|
149
201
|
defaultValue: { summary: 'None' },
|
|
150
|
-
type: { summary: '
|
|
202
|
+
type: { summary: 'Ref' },
|
|
151
203
|
},
|
|
152
204
|
},
|
|
205
|
+
valid: disabledArgType,
|
|
206
|
+
validators: {
|
|
207
|
+
...formatArgTypeCheck({ VALIDATOR }),
|
|
208
|
+
description: 'Determines method(s) used to check for valid input value upon invoking relevant listener event(s)',
|
|
209
|
+
},
|
|
153
210
|
},
|
|
154
211
|
args: {
|
|
155
212
|
autocomplete: undefined,
|
|
156
213
|
dataTrack: '',
|
|
157
214
|
disabled: undefined,
|
|
158
|
-
error:
|
|
215
|
+
error: '',
|
|
216
|
+
errorDisplay: undefined,
|
|
217
|
+
handleValid: 'doSomething',
|
|
159
218
|
hasClear: undefined,
|
|
160
219
|
iconLeading: undefined,
|
|
161
220
|
inputId: '',
|
|
221
|
+
inputmode: undefined,
|
|
162
222
|
label: 'Input label',
|
|
163
223
|
maxlength: '',
|
|
164
224
|
minlength: '',
|
|
@@ -169,8 +229,8 @@ export default {
|
|
|
169
229
|
supportingText: '',
|
|
170
230
|
transformValue: undefined,
|
|
171
231
|
type: undefined,
|
|
232
|
+
vModel: '',
|
|
172
233
|
validators: [],
|
|
173
|
-
value: '',
|
|
174
234
|
},
|
|
175
235
|
component: TideInputText,
|
|
176
236
|
parameters,
|