tide-design-system 2.0.53 → 2.1.0
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/.storybook/main.ts +3 -3
- package/.storybook/preview.ts +0 -4
- package/dist/css/dynamic-utilities.css +0 -1
- package/dist/css/realm/aero.css +31 -37
- package/dist/css/realm/atv.css +21 -41
- package/dist/css/realm/boatmart.css +20 -40
- package/dist/css/realm/cycle.css +19 -39
- package/dist/css/realm/equipment.css +31 -37
- package/dist/css/realm/pwc.css +31 -37
- package/dist/css/realm/rv.css +20 -39
- package/dist/css/realm/snow.css +31 -37
- package/dist/css/realm/truck.css +31 -37
- package/dist/css/variables.css +18 -0
- package/dist/style.css +1 -1
- package/dist/tide-design-system.cjs +2 -2
- package/dist/tide-design-system.esm.d.ts +224 -213
- package/dist/tide-design-system.esm.js +567 -614
- package/dist/utilities/storybook.ts +4 -3
- package/index.ts +4 -4
- package/package.json +1 -1
- package/src/assets/css/dynamic-utilities.css +0 -1
- package/src/assets/css/realm/aero.css +31 -37
- package/src/assets/css/realm/atv.css +21 -41
- package/src/assets/css/realm/boatmart.css +20 -40
- package/src/assets/css/realm/cycle.css +19 -39
- package/src/assets/css/realm/equipment.css +31 -37
- package/src/assets/css/realm/pwc.css +31 -37
- package/src/assets/css/realm/rv.css +20 -39
- package/src/assets/css/realm/snow.css +31 -37
- package/src/assets/css/realm/truck.css +31 -37
- package/src/assets/css/variables.css +18 -0
- package/src/components/TideAccordionItem.vue +27 -56
- package/src/components/TideAlert.vue +15 -15
- package/src/components/TideBreadCrumbs.vue +6 -7
- package/src/components/{TideTabs.vue → TideButtonSegmented.vue} +9 -15
- package/src/components/TideCarousel.vue +1 -1
- package/src/components/TideModal.vue +3 -3
- package/src/components/TidePagination.vue +4 -4
- package/src/components/{TideToggle.vue → TideSwitch.vue} +18 -26
- package/src/stories/TideAccordionItem.stories.ts +37 -12
- package/src/stories/TideBackgroundImage.stories.ts +2 -6
- package/src/stories/TideButton.stories.ts +5 -5
- package/src/stories/TideButtonIcon.stories.ts +5 -5
- package/src/stories/TideButtonPagination.stories.ts +5 -5
- package/src/stories/{TideTabs.stories.ts → TideButtonSegmented.stories.ts} +18 -21
- package/src/stories/TideCard.stories.ts +5 -5
- package/src/stories/TideCarousel.stories.ts +11 -24
- package/src/stories/TideChipFilter.stories.ts +14 -4
- package/src/stories/TideChipInput.stories.ts +14 -3
- package/src/stories/TideInputCheckbox.stories.ts +5 -5
- package/src/stories/TideInputRadio.stories.ts +18 -5
- package/src/stories/TideInputSelect.stories.ts +5 -5
- package/src/stories/TideInputText.stories.ts +4 -7
- package/src/stories/TideInputTextarea.stories.ts +2 -2
- package/src/stories/TideLink.stories.ts +4 -2
- package/src/stories/TideModal.stories.ts +6 -4
- package/src/stories/TidePagination.stories.ts +9 -10
- package/src/stories/{TideToggle.stories.ts → TideSwitch.stories.ts} +15 -15
- package/src/types/Styles.ts +0 -1
- package/src/utilities/storybook.ts +4 -3
|
@@ -1,10 +1,29 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
|
|
1
3
|
import TideAccordionItem from '@/components/TideAccordionItem.vue';
|
|
2
|
-
import { argTypeBooleanUnrequired, dataTrack, parameters } from '@/utilities/storybook';
|
|
4
|
+
import { argTypeBooleanUnrequired, dataTrack, disabledArgType, doSomething, parameters } from '@/utilities/storybook';
|
|
3
5
|
|
|
4
|
-
const render = (args: any) => ({
|
|
6
|
+
const render = (args: any, context: any) => ({
|
|
5
7
|
components: { TideAccordionItem },
|
|
8
|
+
methods: {
|
|
9
|
+
doSomething,
|
|
10
|
+
handleToggle: () => {
|
|
11
|
+
action('TideAccordionItem toggled')({});
|
|
12
|
+
context.updateArgs({ ...args, isExpanded: context.args.isExpanded !== true });
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
const callback = eval(args.handleToggle);
|
|
16
|
+
|
|
17
|
+
if (callback) {
|
|
18
|
+
callback();
|
|
19
|
+
}
|
|
20
|
+
} catch {
|
|
21
|
+
alert('Please specify a valid handler in the "toggle" control.');
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
},
|
|
6
25
|
setup: () => ({ args }),
|
|
7
|
-
template: `<TideAccordionItem
|
|
26
|
+
template: `<TideAccordionItem @toggle="handleToggle" v-bind="args">{{ args.default }}</TideAccordionItem>`,
|
|
8
27
|
});
|
|
9
28
|
|
|
10
29
|
export default {
|
|
@@ -18,6 +37,16 @@ export default {
|
|
|
18
37
|
type: { summary: 'HTML' },
|
|
19
38
|
},
|
|
20
39
|
},
|
|
40
|
+
handleToggle: {
|
|
41
|
+
control: 'text',
|
|
42
|
+
description: 'JS code or function to execute on toggle event',
|
|
43
|
+
isEmit: true,
|
|
44
|
+
name: 'toggle',
|
|
45
|
+
table: {
|
|
46
|
+
defaultValue: { summary: 'None' },
|
|
47
|
+
type: { summary: '(isExpanded: boolean) => void' },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
21
50
|
hasBottomDivider: {
|
|
22
51
|
...argTypeBooleanUnrequired,
|
|
23
52
|
description: 'Determines whether to include bottom divider',
|
|
@@ -26,14 +55,9 @@ export default {
|
|
|
26
55
|
...argTypeBooleanUnrequired,
|
|
27
56
|
description: 'Determines whether to include bottom divider',
|
|
28
57
|
},
|
|
29
|
-
|
|
30
|
-
...argTypeBooleanUnrequired,
|
|
31
|
-
description: 'Determines whether to show "active" indicator (primarily for filters)',
|
|
32
|
-
},
|
|
33
|
-
isExpandedInitial: {
|
|
58
|
+
isExpanded: {
|
|
34
59
|
...argTypeBooleanUnrequired,
|
|
35
|
-
description:
|
|
36
|
-
'Determines whether content should be expanded by default<br />(Subsequently managed within component)',
|
|
60
|
+
description: 'Determines whether body content should be displayed',
|
|
37
61
|
},
|
|
38
62
|
isOptional: {
|
|
39
63
|
...argTypeBooleanUnrequired,
|
|
@@ -47,14 +71,15 @@ export default {
|
|
|
47
71
|
type: { summary: 'string' },
|
|
48
72
|
},
|
|
49
73
|
},
|
|
74
|
+
toggle: disabledArgType,
|
|
50
75
|
},
|
|
51
76
|
args: {
|
|
52
77
|
dataTrack: '',
|
|
53
78
|
default: 'Lorem Ipsum',
|
|
79
|
+
handleToggle: 'doSomething',
|
|
54
80
|
hasBottomDivider: undefined,
|
|
55
81
|
hasTopDivider: undefined,
|
|
56
|
-
|
|
57
|
-
isExpandedInitial: undefined,
|
|
82
|
+
isExpanded: undefined,
|
|
58
83
|
isOptional: undefined,
|
|
59
84
|
label: 'Demo',
|
|
60
85
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import TideBackgroundImage from '@/components/TideBackgroundImage.vue';
|
|
2
2
|
import { MEDIA } from '@/types/Breakpoint';
|
|
3
|
-
import { argTypeBooleanUnrequired } from '@/utilities/storybook';
|
|
3
|
+
import { argTypeBooleanUnrequired, disabledArgType } from '@/utilities/storybook';
|
|
4
4
|
|
|
5
5
|
import type { Source } from '@/types/Source';
|
|
6
6
|
import type { StoryContext } from '@storybook/vue3';
|
|
@@ -71,11 +71,7 @@ export default {
|
|
|
71
71
|
type: { summary: 'string' },
|
|
72
72
|
},
|
|
73
73
|
},
|
|
74
|
-
default:
|
|
75
|
-
table: {
|
|
76
|
-
disable: true,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
74
|
+
default: disabledArgType,
|
|
79
75
|
isLazy: {
|
|
80
76
|
...argTypeBooleanUnrequired,
|
|
81
77
|
description: `Determines whether to delay loading until image is in viewport.`,
|
|
@@ -24,14 +24,14 @@ const render = (args: any) => ({
|
|
|
24
24
|
components: { TideButton },
|
|
25
25
|
methods: {
|
|
26
26
|
doSomething,
|
|
27
|
-
handleClick: (
|
|
28
|
-
action('TideButton clicked')(
|
|
27
|
+
handleClick: () => {
|
|
28
|
+
action('TideButton clicked')({});
|
|
29
29
|
|
|
30
30
|
try {
|
|
31
|
-
const
|
|
31
|
+
const callback = eval(args.click);
|
|
32
32
|
|
|
33
|
-
if (
|
|
34
|
-
|
|
33
|
+
if (callback) {
|
|
34
|
+
callback();
|
|
35
35
|
}
|
|
36
36
|
} catch {
|
|
37
37
|
alert('Please specify a valid handler in the "click" control.');
|
|
@@ -21,14 +21,14 @@ const render = (args: any) => ({
|
|
|
21
21
|
components: { TideButtonIcon },
|
|
22
22
|
methods: {
|
|
23
23
|
doSomething,
|
|
24
|
-
handleClick: (
|
|
25
|
-
action('TideButtonIcon clicked')(
|
|
24
|
+
handleClick: () => {
|
|
25
|
+
action('TideButtonIcon clicked')({});
|
|
26
26
|
|
|
27
27
|
try {
|
|
28
|
-
const
|
|
28
|
+
const callback = eval(args.click);
|
|
29
29
|
|
|
30
|
-
if (
|
|
31
|
-
|
|
30
|
+
if (callback) {
|
|
31
|
+
callback();
|
|
32
32
|
}
|
|
33
33
|
} catch {
|
|
34
34
|
alert('Please specify a valid handler in the "click" control.');
|
|
@@ -18,14 +18,14 @@ const render = (args: any) => ({
|
|
|
18
18
|
components: { TideButtonPagination },
|
|
19
19
|
methods: {
|
|
20
20
|
doSomething,
|
|
21
|
-
handleClick: (
|
|
22
|
-
action('TideButtonPagination clicked')(
|
|
21
|
+
handleClick: () => {
|
|
22
|
+
action('TideButtonPagination clicked')({});
|
|
23
23
|
|
|
24
24
|
try {
|
|
25
|
-
const
|
|
25
|
+
const callback = eval(args.click);
|
|
26
26
|
|
|
27
|
-
if (
|
|
28
|
-
|
|
27
|
+
if (callback) {
|
|
28
|
+
callback();
|
|
29
29
|
}
|
|
30
30
|
} catch {
|
|
31
31
|
alert('Please specify a valid handler in the "click" control.');
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { action } from '@storybook/addon-actions';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import TideButtonSegmented from '@/components/TideButtonSegmented.vue';
|
|
4
4
|
import { change, disabledArgType, doSomething, getLabelsFromOptions, parameters } from '@/utilities/storybook';
|
|
5
5
|
|
|
6
6
|
import type { Tab } from '@/types/Tab';
|
|
7
7
|
|
|
8
|
-
/* eslint-disable */
|
|
9
|
-
// ^ Storybook controls are based on iterating over object properties instead of array slots (bad form), so these can't be ordered alphabetically.
|
|
10
8
|
const options = {
|
|
11
9
|
'None': undefined,
|
|
12
10
|
'Tab 1': 0,
|
|
13
11
|
'Tab 2': 1,
|
|
14
12
|
'Tab 3': 2,
|
|
15
13
|
};
|
|
16
|
-
/* eslint-enable */
|
|
17
14
|
|
|
18
15
|
const tabs: Tab[] = [
|
|
19
16
|
{
|
|
@@ -30,18 +27,19 @@ const tabs: Tab[] = [
|
|
|
30
27
|
},
|
|
31
28
|
];
|
|
32
29
|
|
|
33
|
-
const render = (args: any) => ({
|
|
34
|
-
components: {
|
|
30
|
+
const render = (args: any, { updateArgs }: any) => ({
|
|
31
|
+
components: { TideButtonSegmented },
|
|
35
32
|
methods: {
|
|
36
33
|
doSomething,
|
|
37
|
-
|
|
38
|
-
action(`Current tab ${index}`)(
|
|
34
|
+
handleChange: (index: number) => {
|
|
35
|
+
action(`Current tab ${index}`)(index);
|
|
36
|
+
updateArgs({ ...args, activeTab: index });
|
|
39
37
|
|
|
40
38
|
try {
|
|
41
|
-
const
|
|
39
|
+
const callback = eval(args.handleChange);
|
|
42
40
|
|
|
43
|
-
if (
|
|
44
|
-
|
|
41
|
+
if (callback) {
|
|
42
|
+
callback();
|
|
45
43
|
}
|
|
46
44
|
} catch {
|
|
47
45
|
alert('Please specify a valid handler in the "change" control.');
|
|
@@ -49,18 +47,17 @@ const render = (args: any) => ({
|
|
|
49
47
|
},
|
|
50
48
|
},
|
|
51
49
|
setup: () => ({ args }),
|
|
52
|
-
template:
|
|
53
|
-
'<TideTabs @change="handleEmit" :key="args.activeTabInitial" class="tide-display-inline-flex" v-bind="args" />',
|
|
50
|
+
template: '<TideButtonSegmented @change="handleChange" class="tide-display-inline-flex" v-bind="args" />',
|
|
54
51
|
});
|
|
55
52
|
|
|
56
53
|
export default {
|
|
57
54
|
argTypes: {
|
|
58
|
-
|
|
55
|
+
activeTab: {
|
|
59
56
|
control: {
|
|
60
57
|
labels: getLabelsFromOptions(options),
|
|
61
58
|
type: 'select',
|
|
62
59
|
},
|
|
63
|
-
description: 'Determines which tab should be active
|
|
60
|
+
description: 'Determines which tab should be active',
|
|
64
61
|
isDynamic: true,
|
|
65
62
|
options: Object.values(options),
|
|
66
63
|
table: {
|
|
@@ -68,11 +65,11 @@ export default {
|
|
|
68
65
|
},
|
|
69
66
|
},
|
|
70
67
|
change: disabledArgType,
|
|
71
|
-
|
|
68
|
+
handleChange: {
|
|
72
69
|
...change,
|
|
73
70
|
table: {
|
|
74
71
|
defaultValue: { summary: 'None' },
|
|
75
|
-
type: { summary: '(
|
|
72
|
+
type: { summary: '(tabIndex: number) => void' },
|
|
76
73
|
},
|
|
77
74
|
},
|
|
78
75
|
tabs: {
|
|
@@ -86,15 +83,15 @@ export default {
|
|
|
86
83
|
},
|
|
87
84
|
},
|
|
88
85
|
args: {
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
activeTab: undefined,
|
|
87
|
+
handleChange: 'doSomething',
|
|
91
88
|
tabs,
|
|
92
89
|
},
|
|
93
|
-
component:
|
|
90
|
+
component: TideButtonSegmented,
|
|
94
91
|
parameters,
|
|
95
92
|
render,
|
|
96
93
|
tags: ['autodocs'],
|
|
97
|
-
title: 'Basic Components/
|
|
94
|
+
title: 'Basic Components/TideButtonSegmented',
|
|
98
95
|
};
|
|
99
96
|
|
|
100
97
|
export const Demo = {};
|
|
@@ -20,14 +20,14 @@ const render = (args: any) => ({
|
|
|
20
20
|
components: { TideCard },
|
|
21
21
|
methods: {
|
|
22
22
|
doSomething,
|
|
23
|
-
handleClick: (
|
|
24
|
-
action('TideCard clicked')(
|
|
23
|
+
handleClick: () => {
|
|
24
|
+
action('TideCard clicked')({});
|
|
25
25
|
|
|
26
26
|
try {
|
|
27
|
-
const
|
|
27
|
+
const callback = eval(args.click);
|
|
28
28
|
|
|
29
|
-
if (
|
|
30
|
-
|
|
29
|
+
if (callback) {
|
|
30
|
+
callback();
|
|
31
31
|
}
|
|
32
32
|
} catch {
|
|
33
33
|
alert('Please specify a valid handler in the "click" control.');
|
|
@@ -13,7 +13,7 @@ const formatSnippet = (code: string, context: StoryContext) => {
|
|
|
13
13
|
|
|
14
14
|
if (args.isTouchscreen !== undefined) argsWithValues.push(`:is-touchscreen="${args.isTouchscreen}"`);
|
|
15
15
|
if (args.offsetX) argsWithValues.push(`:offset-x="${args.offsetX}"`);
|
|
16
|
-
if (args.
|
|
16
|
+
if (args.handleChange) argsWithValues.push(`@change"${args.handleChange}"`);
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
19
|
`<TideCarousel ${argsWithValues.join(' ')}>${lineBreak}` +
|
|
@@ -41,14 +41,14 @@ const render = (args: any) => ({
|
|
|
41
41
|
components: { TideCard, TideCarousel },
|
|
42
42
|
methods: {
|
|
43
43
|
doSomething,
|
|
44
|
-
|
|
45
|
-
action(`Current slide ${index}`)(
|
|
44
|
+
handleChange: (_event: Event, index: number) => {
|
|
45
|
+
action(`Current slide ${index}`)(index);
|
|
46
46
|
|
|
47
47
|
try {
|
|
48
|
-
const
|
|
48
|
+
const callback = eval(args.handleChange);
|
|
49
49
|
|
|
50
|
-
if (
|
|
51
|
-
|
|
50
|
+
if (callback) {
|
|
51
|
+
callback();
|
|
52
52
|
}
|
|
53
53
|
} catch {
|
|
54
54
|
alert('Please specify a valid handler in the "change" control.');
|
|
@@ -56,22 +56,18 @@ const render = (args: any) => ({
|
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
58
|
setup: () => ({ args }),
|
|
59
|
-
template: `<TideCarousel @change="
|
|
59
|
+
template: `<TideCarousel @change="handleChange" v-bind="args"><li v-for="(_child, index) in new Array(12)" :class="['tide-shrink-none', args.hasPadding ? ' tide-padding-y-1' : '']"><TideCard class="tide-padding-1">Card {{ index + 1 }}</TideCard></li></TideCarousel>`,
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
export default {
|
|
63
63
|
argTypes: {
|
|
64
64
|
change: disabledArgType,
|
|
65
|
-
default:
|
|
66
|
-
|
|
67
|
-
disable: true,
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
handleEmit: {
|
|
65
|
+
default: disabledArgType,
|
|
66
|
+
handleChange: {
|
|
71
67
|
...change,
|
|
72
68
|
table: {
|
|
73
69
|
defaultValue: { summary: 'None' },
|
|
74
|
-
type: { summary: '(
|
|
70
|
+
type: { summary: '(currentSlide: number) => void' },
|
|
75
71
|
},
|
|
76
72
|
},
|
|
77
73
|
// TODO: adapt via formatSnippet
|
|
@@ -104,21 +100,12 @@ export default {
|
|
|
104
100
|
type: { summary: 'number (px)' },
|
|
105
101
|
},
|
|
106
102
|
},
|
|
107
|
-
slideChange: {
|
|
108
|
-
control: 'text',
|
|
109
|
-
description: 'JS function to execute when current slide is updated',
|
|
110
|
-
table: {
|
|
111
|
-
defaultValue: { summary: 'None' },
|
|
112
|
-
type: { summary: '(event: Event, slideIndex: number) => void' },
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
103
|
},
|
|
116
104
|
args: {
|
|
117
|
-
|
|
105
|
+
handleChange: 'doSomething',
|
|
118
106
|
hasPadding: false,
|
|
119
107
|
isTouchscreen: undefined,
|
|
120
108
|
offsetX: 0,
|
|
121
|
-
slideChange: 'doSomething',
|
|
122
109
|
},
|
|
123
110
|
component: TideCarousel,
|
|
124
111
|
parameters,
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import { action } from '@storybook/addon-actions';
|
|
2
2
|
|
|
3
3
|
import TideChipFilter from '@/components/TideChipFilter.vue';
|
|
4
|
-
import { argTypeBooleanUnrequired, click, dataTrack, parameters } from '@/utilities/storybook';
|
|
4
|
+
import { argTypeBooleanUnrequired, click, dataTrack, doSomething, parameters } from '@/utilities/storybook';
|
|
5
5
|
|
|
6
6
|
const render = (args: any, { updateArgs }: any) => ({
|
|
7
7
|
components: { TideChipFilter },
|
|
8
8
|
methods: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
doSomething,
|
|
10
|
+
handleClick: () => {
|
|
11
|
+
action('TideChipFilter clicked')({});
|
|
12
12
|
updateArgs({ ...args, isActive: !args.isActive });
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
const callback = eval(args.handleClose);
|
|
16
|
+
|
|
17
|
+
if (callback) {
|
|
18
|
+
callback();
|
|
19
|
+
}
|
|
20
|
+
} catch {
|
|
21
|
+
alert('Please specify a valid handler in the "click" control.');
|
|
22
|
+
}
|
|
13
23
|
},
|
|
14
24
|
},
|
|
15
25
|
setup: () => ({ args }),
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import { action } from '@storybook/addon-actions';
|
|
2
2
|
|
|
3
3
|
import TideChipInput from '@/components/TideChipInput.vue';
|
|
4
|
-
import { click, dataTrack, parameters } from '@/utilities/storybook';
|
|
4
|
+
import { click, dataTrack, doSomething, parameters } from '@/utilities/storybook';
|
|
5
5
|
|
|
6
6
|
const render = (args: any) => ({
|
|
7
7
|
components: { TideChipInput },
|
|
8
8
|
methods: {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
doSomething,
|
|
10
|
+
handleClick: () => {
|
|
11
|
+
action('TideChipInput clicked')({});
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
const callback = eval(args.click);
|
|
15
|
+
|
|
16
|
+
if (callback) {
|
|
17
|
+
callback();
|
|
18
|
+
}
|
|
19
|
+
} catch {
|
|
20
|
+
alert('Please specify a valid handler in the "change" control.');
|
|
21
|
+
}
|
|
11
22
|
},
|
|
12
23
|
},
|
|
13
24
|
setup: () => ({ args }),
|
|
@@ -7,17 +7,17 @@ const render = (args: any, context: any) => ({
|
|
|
7
7
|
components: { TideInputCheckbox },
|
|
8
8
|
methods: {
|
|
9
9
|
doSomething,
|
|
10
|
-
handleClick: (
|
|
10
|
+
handleClick: () => {
|
|
11
11
|
const input = context.canvasElement.querySelector('input');
|
|
12
12
|
|
|
13
|
-
action('TideInputCheckbox clicked')(
|
|
13
|
+
action('TideInputCheckbox clicked')({});
|
|
14
14
|
context.updateArgs({ ...args, checked: !input.checked === true, indeterminate: undefined });
|
|
15
15
|
|
|
16
16
|
try {
|
|
17
|
-
const
|
|
17
|
+
const callback = eval(args.click);
|
|
18
18
|
|
|
19
|
-
if (
|
|
20
|
-
|
|
19
|
+
if (callback) {
|
|
20
|
+
callback();
|
|
21
21
|
}
|
|
22
22
|
} catch {
|
|
23
23
|
alert('Please specify a valid handler in the "click" control.');
|
|
@@ -1,20 +1,31 @@
|
|
|
1
1
|
import { action } from '@storybook/addon-actions';
|
|
2
2
|
|
|
3
3
|
import TideInputRadio from '@/components/TideInputRadio.vue';
|
|
4
|
-
import { argTypeBooleanUnrequired, dataTrack, parameters } from '@/utilities/storybook';
|
|
4
|
+
import { argTypeBooleanUnrequired, click, dataTrack, doSomething, parameters } from '@/utilities/storybook';
|
|
5
5
|
|
|
6
6
|
const render = (args: any, context: any) => ({
|
|
7
7
|
components: { TideInputRadio },
|
|
8
8
|
methods: {
|
|
9
|
-
|
|
9
|
+
doSomething,
|
|
10
|
+
handleClick: () => {
|
|
10
11
|
const input = context.canvasElement.querySelector('input');
|
|
11
12
|
|
|
12
|
-
action('TideInputRadio changed')(
|
|
13
|
-
context.updateArgs({ ...args, checked: input.checked });
|
|
13
|
+
action('TideInputRadio changed')({});
|
|
14
|
+
context.updateArgs({ ...args, checked: !input.checked });
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const callback = eval(args.click);
|
|
18
|
+
|
|
19
|
+
if (callback) {
|
|
20
|
+
callback();
|
|
21
|
+
}
|
|
22
|
+
} catch {
|
|
23
|
+
alert('Please specify a valid handler in the "click" control.');
|
|
24
|
+
}
|
|
14
25
|
},
|
|
15
26
|
},
|
|
16
27
|
setup: () => ({ args }),
|
|
17
|
-
template: `<TideInputRadio @
|
|
28
|
+
template: `<TideInputRadio @click="handleClick" v-bind="args" />`,
|
|
18
29
|
});
|
|
19
30
|
|
|
20
31
|
export default {
|
|
@@ -23,6 +34,7 @@ export default {
|
|
|
23
34
|
...argTypeBooleanUnrequired,
|
|
24
35
|
description: 'Determines whether input is selected',
|
|
25
36
|
},
|
|
37
|
+
click,
|
|
26
38
|
dataTrack,
|
|
27
39
|
disabled: {
|
|
28
40
|
...argTypeBooleanUnrequired,
|
|
@@ -55,6 +67,7 @@ export default {
|
|
|
55
67
|
},
|
|
56
68
|
args: {
|
|
57
69
|
checked: undefined,
|
|
70
|
+
click: 'doSomething',
|
|
58
71
|
dataTrack: '',
|
|
59
72
|
disabled: undefined,
|
|
60
73
|
inputId: '',
|
|
@@ -86,17 +86,17 @@ const render = (args: any, { updateArgs }: any) => ({
|
|
|
86
86
|
components: { TideInputSelect },
|
|
87
87
|
methods: {
|
|
88
88
|
doSomething,
|
|
89
|
-
handleChange: (
|
|
89
|
+
handleChange: () => {
|
|
90
90
|
const value = (event?.target as HTMLSelectElement).value;
|
|
91
91
|
|
|
92
|
+
action('TideInputSelect changed')({});
|
|
92
93
|
updateArgs({ ...args, value });
|
|
93
|
-
action('TideInputSelect changed')(event);
|
|
94
94
|
|
|
95
95
|
try {
|
|
96
|
-
const
|
|
96
|
+
const callback = eval(args.change);
|
|
97
97
|
|
|
98
|
-
if (
|
|
99
|
-
|
|
98
|
+
if (callback) {
|
|
99
|
+
callback();
|
|
100
100
|
}
|
|
101
101
|
} catch {
|
|
102
102
|
alert('Please specify a valid handler in the "change" control.');
|
|
@@ -8,6 +8,7 @@ import { VALIDATOR } from '@/types/Validation';
|
|
|
8
8
|
import {
|
|
9
9
|
argTypeBooleanUnrequired,
|
|
10
10
|
dataTrack,
|
|
11
|
+
disabledArgType,
|
|
11
12
|
formatArgType,
|
|
12
13
|
formatArgTypeCheck,
|
|
13
14
|
parameters,
|
|
@@ -21,10 +22,10 @@ const TEXT_INPUT_TYPE = prependNoneAsUndefined(STANDARD_TEXT_INPUT_TYPE.TEXT_INP
|
|
|
21
22
|
const render = (args: any, context: any) => ({
|
|
22
23
|
components: { TideInputText },
|
|
23
24
|
methods: {
|
|
24
|
-
handleChange: (
|
|
25
|
+
handleChange: () => {
|
|
25
26
|
const input = context.canvasElement.querySelector('input');
|
|
26
27
|
|
|
27
|
-
action('TideInputText changed')(
|
|
28
|
+
action('TideInputText changed')({});
|
|
28
29
|
context.updateArgs({ ...args, value: input.value });
|
|
29
30
|
},
|
|
30
31
|
},
|
|
@@ -132,11 +133,7 @@ export default {
|
|
|
132
133
|
...formatArgType({ TEXT_INPUT_TYPE }),
|
|
133
134
|
description: 'Determines the type(s) of values expected by the input',
|
|
134
135
|
},
|
|
135
|
-
updateValue:
|
|
136
|
-
table: {
|
|
137
|
-
disable: true,
|
|
138
|
-
},
|
|
139
|
-
},
|
|
136
|
+
updateValue: disabledArgType,
|
|
140
137
|
validators: {
|
|
141
138
|
...formatArgTypeCheck({ VALIDATOR }),
|
|
142
139
|
description: 'Determines method(s) used to check for valid input value upon invoking relevant listener event(s)',
|
|
@@ -6,10 +6,10 @@ import { argTypeBooleanUnrequired, dataTrack, parameters } from '@/utilities/sto
|
|
|
6
6
|
const render = (args: any, context: any) => ({
|
|
7
7
|
components: { TideInputTextarea },
|
|
8
8
|
methods: {
|
|
9
|
-
handleChange: (
|
|
9
|
+
handleChange: () => {
|
|
10
10
|
const input = context.canvasElement.querySelector('textarea');
|
|
11
11
|
|
|
12
|
-
action('TideInputTextarea changed')(
|
|
12
|
+
action('TideInputTextarea changed')({});
|
|
13
13
|
context.updateArgs({ ...args, value: input.value });
|
|
14
14
|
},
|
|
15
15
|
},
|
|
@@ -54,8 +54,10 @@ const parameters = {
|
|
|
54
54
|
const render = (args: any) => ({
|
|
55
55
|
components: { TideLink },
|
|
56
56
|
methods: {
|
|
57
|
-
handleClick: (
|
|
58
|
-
if (args.element !== ELEMENT.LINK && args.click)
|
|
57
|
+
handleClick: () => {
|
|
58
|
+
if (args.element !== ELEMENT.LINK && args.click) {
|
|
59
|
+
action('TideLink clicked')({});
|
|
60
|
+
}
|
|
59
61
|
},
|
|
60
62
|
},
|
|
61
63
|
setup: () => ({ args }),
|
|
@@ -35,17 +35,18 @@ const render = (args: any, { updateArgs }: any) => ({
|
|
|
35
35
|
components: { TideButton, TideModal },
|
|
36
36
|
methods: {
|
|
37
37
|
doSomething,
|
|
38
|
-
handleClose: (
|
|
38
|
+
handleClose: () => {
|
|
39
|
+
action('Modal closed')({});
|
|
39
40
|
updateArgs({ ...args, isOpen: false });
|
|
40
|
-
action('Modal closed')(event);
|
|
41
41
|
|
|
42
42
|
try {
|
|
43
43
|
const callback = eval(args.handleClose);
|
|
44
|
+
|
|
44
45
|
if (callback) {
|
|
45
46
|
callback();
|
|
46
47
|
}
|
|
47
48
|
} catch {
|
|
48
|
-
alert('Please specify a valid
|
|
49
|
+
alert('Please specify a valid handler in the "close" control.');
|
|
49
50
|
}
|
|
50
51
|
},
|
|
51
52
|
},
|
|
@@ -80,9 +81,10 @@ export default {
|
|
|
80
81
|
handleClose: {
|
|
81
82
|
control: 'text',
|
|
82
83
|
description: 'JS function to execute when modal is closed',
|
|
84
|
+
name: 'close',
|
|
83
85
|
table: {
|
|
84
86
|
defaultValue: { summary: 'None' },
|
|
85
|
-
type: { summary: '(
|
|
87
|
+
type: { summary: '() => void' },
|
|
86
88
|
},
|
|
87
89
|
},
|
|
88
90
|
isOpen: {
|