@bethinkpl/design-system 15.2.1 → 16.0.1
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/.eslintrc.js +4 -0
- package/.storybook/main.js +16 -8
- package/dist/demo.html +1 -8
- package/dist/design-system.umd.js +18210 -16610
- package/dist/design-system.umd.js.map +1 -1
- package/dist/lib/js/components/Badges/Badge/Badge.stories.d.ts +4 -39
- package/dist/lib/js/components/Badges/BadgeScore/BadgeScore.stories.d.ts +3 -108
- package/dist/lib/js/components/Badges/BadgeScore/BadgeScore.vue.d.ts +3 -46
- package/dist/lib/js/components/Banner/Banner.stories.d.ts +4 -2785
- package/dist/lib/js/components/Banner/Banner.vue.d.ts +10 -1121
- package/dist/lib/js/components/Buttons/Button/Button.stories.d.ts +4 -701
- package/dist/lib/js/components/Buttons/Button/Button.vue.d.ts +8 -51
- package/dist/lib/js/components/Buttons/IconButton/IconButton.stories.d.ts +9 -4838
- package/dist/lib/js/components/Buttons/IconButton/IconButton.vue.d.ts +7 -399
- package/dist/lib/js/components/Cards/Card/Card.stories.d.ts +4 -89
- package/dist/lib/js/components/Cards/Card/Card.vue.d.ts +2 -29
- package/dist/lib/js/components/Cards/CardExpandable/CardExpandable.stories.d.ts +4 -647
- package/dist/lib/js/components/Cards/CardExpandable/CardExpandable.vue.d.ts +7 -92
- package/dist/lib/js/components/Divider/Divider.stories.d.ts +4 -59
- package/dist/lib/js/components/Drawer/Drawer.stories.d.ts +4 -43
- package/dist/lib/js/components/Dropdown/Dropdown.stories.d.ts +4 -113
- package/dist/lib/js/components/IconText/IconText.stories.d.ts +4 -223
- package/dist/lib/js/components/IconText/IconText.vue.d.ts +2 -44
- package/dist/lib/js/components/Icons/FeatureIcon/FeatureIcon.stories.d.ts +4 -181
- package/dist/lib/js/components/Icons/FeatureIcon/FeatureIcon.vue.d.ts +3 -46
- package/dist/lib/js/components/Icons/Icon/Icon.consts.d.ts +4 -3
- package/dist/lib/js/components/Icons/Icon/Icon.stories.d.ts +5 -133
- package/dist/lib/js/components/Icons/Icon/Icon.vue.d.ts +2 -3
- package/dist/lib/js/components/Modal/Modal.vue.d.ts +5 -47
- package/dist/lib/js/components/Modals/Modal/Modal.stories.d.ts +7 -7231
- package/dist/lib/js/components/Modals/Modal/Modal.vue.d.ts +12 -1140
- package/dist/lib/js/components/Modals/ModalDialog/ModalDialog.stories.d.ts +6 -6029
- package/dist/lib/js/components/Modals/ModalDialog/ModalDialog.vue.d.ts +5 -1450
- package/dist/lib/js/components/NumberInCircle/NumberInCircle.stories.d.ts +3 -3
- package/dist/lib/js/components/OverlayHeader/OverlayHeader.stories.d.ts +4 -2055
- package/dist/lib/js/components/OverlayHeader/OverlayHeader.vue.d.ts +7 -779
- package/dist/lib/js/components/Pagination/Pagination.stories.d.ts +4 -1869
- package/dist/lib/js/components/Pagination/Pagination.vue.d.ts +5 -694
- package/dist/lib/js/components/Pill/Pill.stories.d.ts +4 -1985
- package/dist/lib/js/components/Pill/Pill.vue.d.ts +7 -740
- package/dist/lib/js/components/PopOver/PopOver.stories.d.ts +4 -4
- package/dist/lib/js/components/ProgressBar/ProgressBar.stories.d.ts +8 -1886
- package/dist/lib/js/components/ProgressBar/ProgressBar.vue.d.ts +5 -47
- package/dist/lib/js/components/ProgressDonutChart/ProgressDonutChart.stories.d.ts +4 -534
- package/dist/lib/js/components/ProgressDonutChart/ProgressDonutChart.vue.d.ts +5 -47
- package/dist/lib/js/components/Ripple/Ripple.stories.d.ts +4 -59
- package/dist/lib/js/components/Ripple/Ripple.vue.d.ts +1 -1
- package/dist/lib/js/components/SectionHeader/SectionHeader.stories.d.ts +4 -555
- package/dist/lib/js/components/SectionHeader/SectionHeader.vue.d.ts +5 -48
- package/dist/lib/js/components/SelectList/SelectList.stories.d.ts +2 -4
- package/dist/lib/js/components/SelectList/SelectList.vue.d.ts +3 -4
- package/dist/lib/js/components/SelectList/SelectListItem/SelectListItem.stories.d.ts +4 -563
- package/dist/lib/js/components/SelectList/SelectListItem/SelectListItem.vue.d.ts +3 -282
- package/dist/lib/js/components/SelectList/SelectListItemDivider/SelectListItemDivider.stories.d.ts +4 -69
- package/dist/lib/js/components/SelectList/SelectListItemDivider/SelectListItemDivider.vue.d.ts +3 -35
- package/dist/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.stories.d.ts +4 -669
- package/dist/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue.d.ts +3 -336
- package/dist/lib/js/components/Statuses/AccessStatus/AccessStatus.stories.d.ts +4 -497
- package/dist/lib/js/components/Statuses/AccessStatus/AccessStatus.vue.d.ts +5 -47
- package/dist/lib/js/components/Statuses/BlockadeStatus/BlockadeStatus.vue.d.ts +5 -47
- package/dist/lib/js/components/Statuses/BlockadeStatus/BlockedeStatus.stories.d.ts +4 -497
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.stories.d.ts +4 -3179
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue.d.ts +10 -1358
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.stories.d.ts +6 -6945
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts +11 -1478
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionTextarea.vue.d.ts +1 -0
- package/dist/lib/js/components/SurveyToggle/SurveyToggle.stories.d.ts +4 -237
- package/dist/lib/js/components/SurveyToggle/SurveyToggle.vue.d.ts +3 -48
- package/dist/lib/js/components/TabItem/TabItem.stories.d.ts +4 -153
- package/dist/lib/js/components/TabItem/TabItem.vue.d.ts +3 -46
- package/dist/lib/js/components/Tile/Tile.stories.d.ts +5 -994
- package/dist/lib/js/components/Tile/Tile.vue.d.ts +8 -79
- package/dist/lib/js/components/Toggles/CounterToggle/CounterToggle.stories.d.ts +4 -185
- package/dist/lib/js/components/Toggles/CounterToggle/CounterToggle.vue.d.ts +4 -47
- package/dist/lib/js/components/Toggles/ToggleButton/ToggleButton.stories.d.ts +4 -239
- package/dist/lib/js/components/Toggles/ToggleButton/ToggleButton.vue.d.ts +3 -29
- package/dist/lib/js/components/Well/Well.stories.d.ts +3 -3
- package/dist/lib/js/styles/Colors/Colors.stories.d.ts +3 -3
- package/dist/lib/js/styles/ColorsThemes/ColorsThemes.stories.d.ts +3 -3
- package/dist/lib/js/styles/ColorsTokensLms/ColorsTokensLms.stories.d.ts +3 -3
- package/dist/lib/js/styles/ColorsTokensPrimaryBodywork/ColorsTokensPrimaryBodywork.stories.d.ts +3 -3
- package/dist/lib/js/styles/ColorsTokensPrimaryWnl/ColorsTokensPrimaryWnl.stories.d.ts +3 -3
- package/dist/lib/js/styles/Spacings/Spacings.stories.d.ts +1 -1
- package/dist/lib/js/styles/TypographyTokensLms/TypographyTokensLms.stories.d.ts +3 -3
- package/dist/lib/js/styles/TypographyVariables/TypographyVariables.stories.d.ts +3 -3
- package/docs/117.1156a7c503a067ad8241.manager.bundle.js +2 -0
- package/docs/247.6eaf240e.iframe.bundle.js +1 -0
- package/docs/255.721b3744029f102ac772.manager.bundle.js +2 -0
- package/docs/286.23828fb3.iframe.bundle.js +2 -0
- package/docs/295.4e52f65e605e88f7b915.manager.bundle.js +1 -0
- package/docs/317.bb9fa3422a439c11ef07.manager.bundle.js +1 -0
- package/docs/363.5eecfb3735eae61195ab.manager.bundle.js +586 -0
- package/docs/363.5eecfb3735eae61195ab.manager.bundle.js.LICENSE.txt +23 -0
- package/docs/39.bfc720d8.iframe.bundle.js +2 -0
- package/docs/407.e7bfe1ea814fec553911.manager.bundle.js +2 -0
- package/docs/594.bb1a9f64.iframe.bundle.js +2 -0
- package/docs/600.5586e4df861d64de85f8.manager.bundle.js +1 -0
- package/docs/636.6664115b472db0c0d56f.manager.bundle.js +2 -0
- package/docs/{vendors~main.247e7a9b46e986df3069.manager.bundle.js.LICENSE.txt → 636.6664115b472db0c0d56f.manager.bundle.js.LICENSE.txt} +0 -10
- package/docs/651.3a01b956.iframe.bundle.js +1 -0
- package/docs/690.46a1e07a.iframe.bundle.js +1 -0
- package/docs/701.691b9947.iframe.bundle.js +1 -0
- package/docs/765.a2b66c95.iframe.bundle.js +2 -0
- package/docs/{vendors~main.d572ee99.iframe.bundle.js.LICENSE.txt → 765.a2b66c95.iframe.bundle.js.LICENSE.txt} +0 -16
- package/docs/935.19d3d944.iframe.bundle.js +2 -0
- package/docs/962.ec348c19.iframe.bundle.js +2 -0
- package/docs/977.a265714880f883237672.manager.bundle.js +1 -0
- package/docs/iframe.html +1 -1
- package/docs/index.html +1 -1
- package/docs/main.aca4e1b49e5b812b2501.manager.bundle.js +1 -0
- package/docs/main.e3406522.iframe.bundle.js +1 -0
- package/docs/project.json +1 -1
- package/docs/runtime~main.8a21756dfcf63c109f1d.manager.bundle.js +1 -0
- package/docs/runtime~main.b2826aa6.iframe.bundle.js +1 -0
- package/jest.config.js +3 -6
- package/lib/js/components/Badges/Badge/Badge.spec.ts +3 -8
- package/lib/js/components/Badges/Badge/Badge.stories.ts +5 -3
- package/lib/js/components/Badges/BadgeScore/BadgeScore.spec.ts +3 -7
- package/lib/js/components/Badges/BadgeScore/BadgeScore.stories.ts +9 -5
- package/lib/js/components/Badges/BadgeScore/BadgeScore.vue +4 -3
- package/lib/js/components/Banner/Banner.stories.ts +25 -22
- package/lib/js/components/Banner/Banner.vue +11 -28
- package/lib/js/components/Buttons/Button/Button.spec.ts +10 -6
- package/lib/js/components/Buttons/Button/Button.stories.ts +23 -17
- package/lib/js/components/Buttons/Button/Button.vue +5 -7
- package/lib/js/components/Buttons/IconButton/IconButton.stories.ts +28 -13
- package/lib/js/components/Buttons/IconButton/IconButton.vue +8 -6
- package/lib/js/components/Cards/Card/Card.spec.ts +5 -10
- package/lib/js/components/Cards/Card/Card.stories.ts +17 -5
- package/lib/js/components/Cards/CardExpandable/CardExpandable.spec.ts +7 -12
- package/lib/js/components/Cards/CardExpandable/CardExpandable.stories.ts +20 -10
- package/lib/js/components/Cards/CardExpandable/CardExpandable.vue +5 -3
- package/lib/js/components/Divider/Divider.stories.ts +9 -4
- package/lib/js/components/Drawer/Drawer.stories.ts +5 -3
- package/lib/js/components/Dropdown/Dropdown.stories.ts +5 -3
- package/lib/js/components/IconText/IconText.stories.ts +14 -12
- package/lib/js/components/IconText/IconText.vue +2 -1
- package/lib/js/components/Icons/FeatureIcon/FeatureIcon.stories.ts +6 -4
- package/lib/js/components/Icons/FeatureIcon/FeatureIcon.vue +3 -3
- package/lib/js/components/Icons/Icon/Icon.stories.ts +12 -5
- package/lib/js/components/Icons/Icon/Icon.vue +3 -3
- package/lib/js/components/Modal/Modal.spec.ts +3 -8
- package/lib/js/components/Modal/Modal.vue +1 -1
- package/lib/js/components/Modals/Modal/Modal.stories.ts +15 -29
- package/lib/js/components/Modals/Modal/Modal.vue +10 -10
- package/lib/js/components/Modals/ModalDialog/ModalDialog.stories.ts +6 -4
- package/lib/js/components/Modals/ModalDialog/ModalDialog.vue +7 -7
- package/lib/js/components/NumberInCircle/NumberInCircle.stories.ts +5 -3
- package/lib/js/components/OverlayHeader/OverlayHeader.stories.ts +19 -17
- package/lib/js/components/OverlayHeader/OverlayHeader.vue +1 -4
- package/lib/js/components/Pagination/Pagination.spec.ts +4 -7
- package/lib/js/components/Pagination/Pagination.stories.ts +8 -6
- package/lib/js/components/Pagination/Pagination.vue +3 -3
- package/lib/js/components/Pill/Pill.spec.ts +7 -5
- package/lib/js/components/Pill/Pill.stories.ts +5 -3
- package/lib/js/components/Pill/Pill.vue +4 -4
- package/lib/js/components/PopOver/PopOver.stories.ts +5 -3
- package/lib/js/components/PopOver/PopOver.vue +5 -5
- package/lib/js/components/ProgressBar/ProgressBar.stories.ts +6 -7
- package/lib/js/components/ProgressBar/ProgressBar.vue +6 -4
- package/lib/js/components/ProgressDonutChart/ProgressDonutChart.spec.ts +4 -6
- package/lib/js/components/ProgressDonutChart/ProgressDonutChart.stories.ts +8 -6
- package/lib/js/components/ProgressDonutChart/ProgressDonutChart.vue +1 -1
- package/lib/js/components/Ripple/Ripple.stories.ts +5 -3
- package/lib/js/components/Ripple/Ripple.vue +10 -10
- package/lib/js/components/SectionHeader/SectionHeader.stories.ts +5 -3
- package/lib/js/components/SectionHeader/SectionHeader.vue +2 -1
- package/lib/js/components/SelectList/SelectList.stories.ts +32 -23
- package/lib/js/components/SelectList/SelectListItem/SelectListItem.stories.ts +14 -12
- package/lib/js/components/SelectList/SelectListItem/SelectListItem.vue +3 -2
- package/lib/js/components/SelectList/SelectListItemDivider/SelectListItemDivider.stories.ts +3 -2
- package/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.stories.ts +16 -14
- package/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue +3 -2
- package/lib/js/components/Statuses/AccessStatus/AccessStatus.spec.ts +4 -8
- package/lib/js/components/Statuses/AccessStatus/AccessStatus.stories.ts +5 -3
- package/lib/js/components/Statuses/BlockadeStatus/BlockadeStatus.spec.ts +4 -8
- package/lib/js/components/Statuses/BlockadeStatus/BlockedeStatus.stories.ts +5 -3
- package/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.stories.ts +5 -5
- package/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue +3 -2
- package/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.spec.ts +5 -14
- package/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.stories.ts +29 -21
- package/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue +8 -11
- package/lib/js/components/SurveyQuestions/SurveyQuestionTextarea.vue +1 -0
- package/lib/js/components/SurveyToggle/SurveyToggle.spec.ts +3 -8
- package/lib/js/components/SurveyToggle/SurveyToggle.stories.ts +5 -3
- package/lib/js/components/SurveyToggle/SurveyToggle.vue +6 -9
- package/lib/js/components/TabItem/TabItem.spec.ts +3 -7
- package/lib/js/components/TabItem/TabItem.stories.ts +5 -3
- package/lib/js/components/TabItem/TabItem.vue +4 -10
- package/lib/js/components/Tile/Tile.spec.ts +14 -18
- package/lib/js/components/Tile/Tile.stories.ts +12 -5
- package/lib/js/components/Tile/Tile.vue +5 -5
- package/lib/js/components/Toggles/CounterToggle/CounterToggle.spec.ts +5 -5
- package/lib/js/components/Toggles/CounterToggle/CounterToggle.stories.ts +8 -3
- package/lib/js/components/Toggles/CounterToggle/CounterToggle.vue +5 -7
- package/lib/js/components/Toggles/ToggleButton/ToggleButton.stories.ts +16 -13
- package/lib/js/components/Toggles/ToggleButton/ToggleButton.vue +3 -17
- package/lib/js/components/Well/Well.stories.ts +6 -9
- package/lib/js/styles/Colors/Colors.stories.ts +5 -3
- package/lib/js/styles/ColorsThemes/ColorsThemes.stories.ts +5 -3
- package/lib/js/styles/ColorsTokensLms/ColorsTokensLms.stories.ts +5 -3
- package/lib/js/styles/ColorsTokensPrimaryBodywork/ColorsTokensPrimaryBodywork.stories.ts +5 -3
- package/lib/js/styles/ColorsTokensPrimaryWnl/ColorsTokensPrimaryWnl.stories.ts +5 -3
- package/lib/js/styles/Spacings/Spacings.stories.ts +11 -13
- package/lib/js/styles/TypographyTokensLms/TypographyTokensLms.stories.ts +5 -3
- package/lib/js/styles/TypographyVariables/TypographyVariables.stories.ts +5 -3
- package/lib/js/tests/emptyTransformer.ts +3 -1
- package/lib/js/typings.d.ts +9 -5
- package/package.json +22 -19
- package/stylelint.config.js +6 -2
- package/tsconfig.json +4 -2
- package/vue.config.js +8 -4
- package/docs/0.0bd4fd4436a8d1ef1d30.manager.bundle.js +0 -2
- package/docs/0.330ac560.iframe.bundle.js +0 -3
- package/docs/0.330ac560.iframe.bundle.js.map +0 -1
- package/docs/1.7b1bde44.iframe.bundle.js +0 -3
- package/docs/1.7b1bde44.iframe.bundle.js.map +0 -1
- package/docs/1.b52e4f9c5cc26b3ab941.manager.bundle.js +0 -1
- package/docs/10.65aa234815172050014e.manager.bundle.js +0 -1
- package/docs/10.9f63d710.iframe.bundle.js +0 -1
- package/docs/11.cc4ccf1b.iframe.bundle.js +0 -3
- package/docs/11.cc4ccf1b.iframe.bundle.js.map +0 -1
- package/docs/2.4511ae7e.iframe.bundle.js +0 -3
- package/docs/2.4511ae7e.iframe.bundle.js.map +0 -1
- package/docs/3.be646fdb.iframe.bundle.js +0 -1
- package/docs/4.56a28fc4.iframe.bundle.js +0 -1
- package/docs/5.3df3ab4b52abff899664.manager.bundle.js +0 -2
- package/docs/6.63f5637c3f9a33682852.manager.bundle.js +0 -586
- package/docs/6.63f5637c3f9a33682852.manager.bundle.js.LICENSE.txt +0 -24
- package/docs/7.4282478bb99c2aa1c46e.manager.bundle.js +0 -1
- package/docs/8.000736d9.iframe.bundle.js +0 -3
- package/docs/8.000736d9.iframe.bundle.js.map +0 -1
- package/docs/8.c81223eef5990edfc649.manager.bundle.js +0 -1
- package/docs/9.33f72dc1.iframe.bundle.js +0 -1
- package/docs/9.45659a2e4dd371822c72.manager.bundle.js +0 -2
- package/docs/main.56306661f1672549dbce.manager.bundle.js +0 -1
- package/docs/main.6c57cadf.iframe.bundle.js +0 -1
- package/docs/runtime~main.016fc6b4.iframe.bundle.js +0 -1
- package/docs/runtime~main.a7a714be62d5940f5192.manager.bundle.js +0 -1
- package/docs/vendors~main.247e7a9b46e986df3069.manager.bundle.js +0 -2
- package/docs/vendors~main.d572ee99.iframe.bundle.js +0 -3
- package/docs/vendors~main.d572ee99.iframe.bundle.js.map +0 -1
- /package/docs/{0.0bd4fd4436a8d1ef1d30.manager.bundle.js.LICENSE.txt → 117.1156a7c503a067ad8241.manager.bundle.js.LICENSE.txt} +0 -0
- /package/docs/{11.cc4ccf1b.iframe.bundle.js.LICENSE.txt → 255.721b3744029f102ac772.manager.bundle.js.LICENSE.txt} +0 -0
- /package/docs/{5.3df3ab4b52abff899664.manager.bundle.js.LICENSE.txt → 286.23828fb3.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/docs/{2.4511ae7e.iframe.bundle.js.LICENSE.txt → 39.bfc720d8.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/docs/{8.000736d9.iframe.bundle.js.LICENSE.txt → 407.e7bfe1ea814fec553911.manager.bundle.js.LICENSE.txt} +0 -0
- /package/docs/{9.45659a2e4dd371822c72.manager.bundle.js.LICENSE.txt → 594.bb1a9f64.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/docs/{0.330ac560.iframe.bundle.js.LICENSE.txt → 935.19d3d944.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/docs/{1.7b1bde44.iframe.bundle.js.LICENSE.txt → 962.ec348c19.iframe.bundle.js.LICENSE.txt} +0 -0
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from './SelectListItem/SelectListItem.consts';
|
|
6
6
|
import { ICONS } from '../Icons/Icon';
|
|
7
7
|
|
|
8
|
-
import { Meta, StoryFn } from '@storybook/
|
|
8
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
9
9
|
import SelectListItem from './SelectListItem/SelectListItem.vue';
|
|
10
10
|
import SelectListItemDivider from './SelectListItemDivider/SelectListItemDivider.vue';
|
|
11
11
|
import SelectListItemToggle from './SelectListItemToggle/SelectListItemToggle.vue';
|
|
@@ -15,17 +15,25 @@ export default {
|
|
|
15
15
|
component: SelectList,
|
|
16
16
|
} as Meta<typeof SelectList>;
|
|
17
17
|
|
|
18
|
-
export const Mix: StoryFn<typeof SelectList> = (
|
|
18
|
+
export const Mix: StoryFn<typeof SelectList> = (args) => ({
|
|
19
19
|
components: { SelectList, SelectListItem, SelectListItemDivider, SelectListItemToggle },
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
setup() {
|
|
21
|
+
return { ...args };
|
|
22
|
+
},
|
|
23
|
+
template: `
|
|
24
|
+
<select-list>
|
|
25
|
+
<select-list-item label="Small" :size="SELECT_LIST_ITEM_SIZES.SMALL"
|
|
26
|
+
:selection-mode="SELECT_LIST_ITEM_SELECTION_MODE.TOGGLE" />
|
|
27
|
+
<select-list-item :icon-left="ICONS.FA_BAN" label="Medium" :size="SELECT_LIST_ITEM_SIZES.MEDIUM" is-selected
|
|
28
|
+
:selection-mode="SELECT_LIST_ITEM_SELECTION_MODE.SELECT_ONLY" />
|
|
29
|
+
<select-list-item-divider />
|
|
30
|
+
<select-list-item-toggle :icon-off="ICONS.FA_STAR" :icon-on="ICONS.FA_STAR_SOLID" is-on label-on="Usuń z kolekcji"
|
|
31
|
+
label-off="Dodaj do kolekcji" />
|
|
32
|
+
<select-list-item-toggle :icon-off="ICONS.FA_STAR" :icon-on="ICONS.FA_STAR_SOLID" label-on="Usuń z kolekcji"
|
|
33
|
+
label-off="Dodaj do kolekcji" />
|
|
34
|
+
<select-list-item-toggle :icon-off="ICONS.FA_STAR" :icon-on="ICONS.FA_STAR_SOLID" is-loading
|
|
35
|
+
label-on="Usuń z kolekcji" label-off="Dodaj do kolekcji" />
|
|
36
|
+
</select-list>`,
|
|
29
37
|
data() {
|
|
30
38
|
return {
|
|
31
39
|
ICONS: Object.freeze(ICONS),
|
|
@@ -45,18 +53,19 @@ Mix.parameters = {
|
|
|
45
53
|
export const SelectableList: StoryFn<typeof SelectList> = (argTypes) => ({
|
|
46
54
|
components: { SelectList, SelectListItem },
|
|
47
55
|
props: Object.keys(argTypes),
|
|
48
|
-
template:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
template: `
|
|
57
|
+
<select-list>
|
|
58
|
+
<select-list-item
|
|
59
|
+
:is-selected="selected === 0"
|
|
60
|
+
label="Short text"
|
|
61
|
+
@click.native="selected = 0"
|
|
62
|
+
/>
|
|
63
|
+
<select-list-item
|
|
64
|
+
:is-selected="selected === 1"
|
|
65
|
+
label="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut malesuada commodo diam, a venenatis ipsum. Praesent vitae bibendum dolor."
|
|
66
|
+
@click.native="selected = 1"
|
|
67
|
+
/>
|
|
68
|
+
</select-list>`,
|
|
60
69
|
data() {
|
|
61
70
|
return {
|
|
62
71
|
selected: 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import SelectListItem from './SelectListItem.vue';
|
|
2
2
|
import { ICONS } from '../../Icons/Icon';
|
|
3
3
|
|
|
4
|
-
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/
|
|
4
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
5
5
|
import {
|
|
6
6
|
SELECT_LIST_ITEM_STATES,
|
|
7
7
|
SELECT_LIST_ITEM_SIZES,
|
|
@@ -13,19 +13,21 @@ export default {
|
|
|
13
13
|
component: SelectListItem,
|
|
14
14
|
} as Meta<typeof SelectListItem>;
|
|
15
15
|
|
|
16
|
-
const StoryTemplate: StoryFn<typeof SelectListItem> = (
|
|
16
|
+
const StoryTemplate: StoryFn<typeof SelectListItem> = (args) => ({
|
|
17
17
|
components: { SelectListItem },
|
|
18
|
-
|
|
18
|
+
setup() {
|
|
19
|
+
return { ...args };
|
|
20
|
+
},
|
|
19
21
|
template: `
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
<select-list-item
|
|
23
|
+
:icon-left="ICONS[iconLeft]"
|
|
24
|
+
:label="label"
|
|
25
|
+
:is-selected="isSelected"
|
|
26
|
+
:selection-mode="selectionMode"
|
|
27
|
+
:size="size"
|
|
28
|
+
:state="state"
|
|
29
|
+
/>
|
|
30
|
+
`,
|
|
29
31
|
data() {
|
|
30
32
|
return {
|
|
31
33
|
ICONS: Object.freeze(ICONS),
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
@include label-xl-default-regular;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
&:deep(.ripple) {
|
|
85
85
|
background-color: $color-neutral-ripple !important;
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -119,6 +119,7 @@ import {
|
|
|
119
119
|
SELECT_LIST_ITEM_SELECTION_MODE,
|
|
120
120
|
} from './SelectListItem.consts';
|
|
121
121
|
import DsIcon, { ICON_SIZES, ICONS } from '../../Icons/Icon';
|
|
122
|
+
import { toRaw } from 'vue';
|
|
122
123
|
|
|
123
124
|
export default {
|
|
124
125
|
name: 'SelectListItem',
|
|
@@ -133,7 +134,7 @@ export default {
|
|
|
133
134
|
type: Object,
|
|
134
135
|
default: null,
|
|
135
136
|
validator(icon) {
|
|
136
|
-
return Object.values(ICONS).includes(icon);
|
|
137
|
+
return Object.values(ICONS).includes(toRaw(icon));
|
|
137
138
|
},
|
|
138
139
|
},
|
|
139
140
|
isSelected: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import SelectListItemDivider from './SelectListItemDivider.vue';
|
|
2
2
|
|
|
3
|
-
import { Meta, StoryFn } from '@storybook/
|
|
3
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
title: 'Components/SelectList/SelectListItemDivider',
|
|
@@ -9,7 +9,8 @@ export default {
|
|
|
9
9
|
|
|
10
10
|
const StoryTemplate: StoryFn<typeof SelectListItemDivider> = () => ({
|
|
11
11
|
components: { SelectListItemDivider },
|
|
12
|
-
template:
|
|
12
|
+
template: `
|
|
13
|
+
<select-list-item-divider />`,
|
|
13
14
|
});
|
|
14
15
|
|
|
15
16
|
export const Static = StoryTemplate.bind({});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import SelectListItemToggle from './SelectListItemToggle.vue';
|
|
2
2
|
import { ICONS } from '../../Icons/Icon';
|
|
3
3
|
|
|
4
|
-
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/
|
|
4
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
5
5
|
import {
|
|
6
6
|
SELECT_LIST_ITEM_SIZES,
|
|
7
7
|
SELECT_LIST_ITEM_STATES,
|
|
@@ -12,21 +12,23 @@ export default {
|
|
|
12
12
|
component: SelectListItemToggle,
|
|
13
13
|
} as Meta<typeof SelectListItemToggle>;
|
|
14
14
|
|
|
15
|
-
const StoryTemplate: StoryFn<typeof SelectListItemToggle> = (
|
|
15
|
+
const StoryTemplate: StoryFn<typeof SelectListItemToggle> = (args, { updateArgs }) => ({
|
|
16
16
|
components: { SelectListItemToggle },
|
|
17
|
-
|
|
17
|
+
setup() {
|
|
18
|
+
return { ...args };
|
|
19
|
+
},
|
|
18
20
|
template: `
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
<select-list-item-toggle
|
|
22
|
+
:icon-off="ICONS[iconOff]"
|
|
23
|
+
:icon-on="ICONS[iconOn]"
|
|
24
|
+
:is-on="isOn"
|
|
25
|
+
:label-off="labelOff"
|
|
26
|
+
:label-on="labelOn"
|
|
27
|
+
:size="size"
|
|
28
|
+
:state="state"
|
|
29
|
+
@click.native="onClick"
|
|
30
|
+
/>
|
|
31
|
+
`,
|
|
30
32
|
data() {
|
|
31
33
|
return {
|
|
32
34
|
ICONS: Object.freeze(ICONS),
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
} from '../SelectListItem/SelectListItem.consts';
|
|
18
18
|
import { IconItem, ICONS } from '../../Icons/Icon';
|
|
19
19
|
import SelectListItem from '../SelectListItem/SelectListItem.vue';
|
|
20
|
+
import { toRaw } from 'vue';
|
|
20
21
|
|
|
21
22
|
export default {
|
|
22
23
|
name: 'SelectListItemToggle',
|
|
@@ -28,14 +29,14 @@ export default {
|
|
|
28
29
|
type: Object,
|
|
29
30
|
default: null,
|
|
30
31
|
validator(icon) {
|
|
31
|
-
return Object.values(ICONS).includes(icon);
|
|
32
|
+
return Object.values(ICONS).includes(toRaw(icon));
|
|
32
33
|
},
|
|
33
34
|
},
|
|
34
35
|
iconOn: {
|
|
35
36
|
type: Object,
|
|
36
37
|
default: null,
|
|
37
38
|
validator(icon) {
|
|
38
|
-
return Object.values(ICONS).includes(icon);
|
|
39
|
+
return Object.values(ICONS).includes(toRaw(icon));
|
|
39
40
|
},
|
|
40
41
|
},
|
|
41
42
|
isOn: {
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
2
|
|
|
3
3
|
import AccessStatus from './AccessStatus.vue';
|
|
4
4
|
import { COURSE_ACCESS_STATUS } from '../../../consts/user';
|
|
5
5
|
import { ICONS } from '../../Icons/Icon';
|
|
6
|
+
import Icon from '../../Icons/Icon/Icon.vue';
|
|
6
7
|
|
|
7
8
|
describe('AccessStatus', () => {
|
|
8
9
|
const createComponent = (status) => {
|
|
9
|
-
const localVue = createLocalVue();
|
|
10
|
-
|
|
11
10
|
return shallowMount(AccessStatus, {
|
|
12
|
-
|
|
13
|
-
mocks: {},
|
|
14
|
-
propsData: {
|
|
11
|
+
props: {
|
|
15
12
|
status,
|
|
16
13
|
},
|
|
17
|
-
stubs: {},
|
|
18
14
|
});
|
|
19
15
|
};
|
|
20
16
|
|
|
@@ -43,6 +39,6 @@ describe('AccessStatus', () => {
|
|
|
43
39
|
const component = createComponent(status);
|
|
44
40
|
|
|
45
41
|
expect(component.text()).toBe(expectedText);
|
|
46
|
-
expect(component.
|
|
42
|
+
expect(component.findComponent(Icon).props().icon).toBe(expectedIcon);
|
|
47
43
|
});
|
|
48
44
|
});
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import AccessStatus from './AccessStatus.vue';
|
|
2
2
|
import { COURSE_ACCESS_STATUS } from '../../../consts/user';
|
|
3
3
|
|
|
4
|
-
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/
|
|
4
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: 'Components/Statuses/AccessStatus',
|
|
8
8
|
component: AccessStatus,
|
|
9
9
|
} as Meta<typeof AccessStatus>;
|
|
10
10
|
|
|
11
|
-
const StoryTemplate: StoryFn<typeof AccessStatus> = (
|
|
11
|
+
const StoryTemplate: StoryFn<typeof AccessStatus> = (args) => ({
|
|
12
12
|
components: { AccessStatus },
|
|
13
|
-
|
|
13
|
+
setup() {
|
|
14
|
+
return { ...args };
|
|
15
|
+
},
|
|
14
16
|
template: `<access-status :status="status" />`,
|
|
15
17
|
});
|
|
16
18
|
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
2
|
|
|
3
3
|
import BlockadeStatus from './BlockadeStatus.vue';
|
|
4
4
|
import { COURSE_ACCESS_STATUS } from '../../../consts/user';
|
|
5
5
|
import { ICONS } from '../../Icons/Icon';
|
|
6
|
+
import Icon from '../../Icons/Icon/Icon.vue';
|
|
6
7
|
|
|
7
8
|
describe('BlockadeStatus', () => {
|
|
8
9
|
const createComponent = (status) => {
|
|
9
|
-
const localVue = createLocalVue();
|
|
10
|
-
|
|
11
10
|
return shallowMount(BlockadeStatus, {
|
|
12
|
-
|
|
13
|
-
mocks: {},
|
|
14
|
-
propsData: {
|
|
11
|
+
props: {
|
|
15
12
|
status,
|
|
16
13
|
},
|
|
17
|
-
stubs: {},
|
|
18
14
|
});
|
|
19
15
|
};
|
|
20
16
|
|
|
@@ -33,6 +29,6 @@ describe('BlockadeStatus', () => {
|
|
|
33
29
|
const component = createComponent(status);
|
|
34
30
|
|
|
35
31
|
expect(component.text()).toBe(expectedText);
|
|
36
|
-
expect(component.
|
|
32
|
+
expect(component.findComponent(Icon).props().icon).toBe(expectedIcon);
|
|
37
33
|
});
|
|
38
34
|
});
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import BlockadeStatus from './BlockadeStatus.vue';
|
|
2
2
|
import { COURSE_BLOCKADE_ACCESS_STATUS } from '../../../consts/user';
|
|
3
3
|
|
|
4
|
-
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/
|
|
4
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: 'Components/Statuses/BlockadeStatus',
|
|
8
8
|
component: BlockadeStatus,
|
|
9
9
|
} as Meta<typeof BlockadeStatus>;
|
|
10
10
|
|
|
11
|
-
const StoryTemplate: StoryFn<typeof BlockadeStatus> = (
|
|
11
|
+
const StoryTemplate: StoryFn<typeof BlockadeStatus> = (args) => ({
|
|
12
12
|
components: { BlockadeStatus },
|
|
13
|
-
|
|
13
|
+
setup() {
|
|
14
|
+
return { ...args };
|
|
15
|
+
},
|
|
14
16
|
template: `<blockade-status :status="status" />`,
|
|
15
17
|
});
|
|
16
18
|
|
package/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.stories.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import SurveyQuestionOpenEnded from './SurveyQuestionOpenEnded.vue';
|
|
2
2
|
import { SURVEY_QUESTION_STATES } from '../SurveyQuestion.consts';
|
|
3
3
|
|
|
4
|
-
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/
|
|
4
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: 'Components/SurveyQuestions/SurveyQuestionOpenEnded',
|
|
8
8
|
component: SurveyQuestionOpenEnded,
|
|
9
9
|
} as Meta<typeof SurveyQuestionOpenEnded>;
|
|
10
10
|
|
|
11
|
-
const StoryTemplate: StoryFn<typeof SurveyQuestionOpenEnded> = (
|
|
11
|
+
const StoryTemplate: StoryFn<typeof SurveyQuestionOpenEnded> = (args, { updateArgs }) => ({
|
|
12
12
|
components: { SurveyQuestionOpenEnded },
|
|
13
|
-
props: Object.keys(argTypes),
|
|
14
13
|
setup() {
|
|
15
|
-
return { args };
|
|
14
|
+
return { ...args };
|
|
16
15
|
},
|
|
16
|
+
// TODO typing in textarea looses focus
|
|
17
17
|
template:
|
|
18
18
|
'<survey-question-open-ended :title="title" :value="value" :state="state" :placeholder="placeholder" @input="explanationUpdate">' +
|
|
19
|
-
'<
|
|
19
|
+
'<template v-if="explanation" #explanation><div v-html="explanation" /></template>' +
|
|
20
20
|
'</survey-question-open-ended>',
|
|
21
21
|
methods: {
|
|
22
22
|
explanationUpdate(value) {
|
package/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<slot name="explanation" />
|
|
8
8
|
<template #footer>
|
|
9
9
|
<div>
|
|
10
|
-
<ds-button :type="BUTTON_TYPES.OUTLINED" @click
|
|
10
|
+
<ds-button :type="BUTTON_TYPES.OUTLINED" @click="showModal = false">
|
|
11
11
|
OK, rozumiem
|
|
12
12
|
</ds-button>
|
|
13
13
|
</div>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
:icon="ICONS.FA_CIRCLE_QUESTION"
|
|
27
27
|
:size="ICON_SIZES.MEDIUM"
|
|
28
28
|
:touchable="false"
|
|
29
|
-
@click
|
|
29
|
+
@click="showModal = true"
|
|
30
30
|
/>
|
|
31
31
|
</div>
|
|
32
32
|
<div class="surveyQuestionOpenEnded__content">
|
|
@@ -121,6 +121,7 @@ export default {
|
|
|
121
121
|
},
|
|
122
122
|
},
|
|
123
123
|
},
|
|
124
|
+
emits: ['input'],
|
|
124
125
|
data() {
|
|
125
126
|
return {
|
|
126
127
|
showModal: false,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
2
|
|
|
3
3
|
import SurveyQuestionScale from './SurveyQuestionScale.vue';
|
|
4
4
|
import { SURVEY_TOGGLE_MEANINGS } from '../../SurveyToggle';
|
|
@@ -9,24 +9,18 @@ describe('SurveyQuestionScale', () => {
|
|
|
9
9
|
elaborationLabel = '',
|
|
10
10
|
elaborationValue = '',
|
|
11
11
|
title = '',
|
|
12
|
-
|
|
13
|
-
scaleOptions = [] as Array<unknown>,
|
|
12
|
+
scaleOptions = [] as Array<SurveyQuestionScaleOption>,
|
|
14
13
|
explanation = '',
|
|
15
14
|
} = {}) => {
|
|
16
|
-
const localVue = createLocalVue();
|
|
17
|
-
|
|
18
15
|
return mount(SurveyQuestionScale, {
|
|
19
|
-
|
|
20
|
-
mocks: {},
|
|
21
|
-
propsData: {
|
|
22
|
-
content,
|
|
16
|
+
props: {
|
|
23
17
|
scaleOptions,
|
|
24
18
|
title,
|
|
25
19
|
elaborationLabel,
|
|
26
20
|
elaborationValue,
|
|
27
|
-
},
|
|
21
|
+
} as any,
|
|
28
22
|
slots: {
|
|
29
|
-
explanation,
|
|
23
|
+
...(explanation !== '' && { explanation }),
|
|
30
24
|
},
|
|
31
25
|
});
|
|
32
26
|
};
|
|
@@ -36,19 +30,16 @@ describe('SurveyQuestionScale', () => {
|
|
|
36
30
|
value: '1',
|
|
37
31
|
label: 'Nie zgadzam się',
|
|
38
32
|
meaning: SURVEY_TOGGLE_MEANINGS.PRIMARY,
|
|
39
|
-
content: '1',
|
|
40
33
|
},
|
|
41
34
|
{
|
|
42
35
|
value: '2',
|
|
43
36
|
label: 'Trochę się nie zgadzam',
|
|
44
37
|
meaning: SURVEY_TOGGLE_MEANINGS.PRIMARY,
|
|
45
|
-
content: '2',
|
|
46
38
|
},
|
|
47
39
|
{
|
|
48
40
|
value: '3',
|
|
49
41
|
label: 'Trochę się zgadzam',
|
|
50
42
|
meaning: SURVEY_TOGGLE_MEANINGS.PRIMARY,
|
|
51
|
-
content: '3',
|
|
52
43
|
},
|
|
53
44
|
{
|
|
54
45
|
value: '4',
|
package/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.stories.ts
CHANGED
|
@@ -2,27 +2,29 @@ import SurveyQuestionScale from './SurveyQuestionScale.vue';
|
|
|
2
2
|
import { SURVEY_TOGGLE_MEANINGS } from '../../SurveyToggle';
|
|
3
3
|
import { SURVEY_QUESTION_STATES } from '../SurveyQuestion.consts';
|
|
4
4
|
|
|
5
|
-
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/
|
|
5
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
title: 'Components/SurveyQuestions/SurveyQuestionScale',
|
|
9
9
|
component: SurveyQuestionScale,
|
|
10
10
|
} as Meta<typeof SurveyQuestionScale>;
|
|
11
11
|
|
|
12
|
-
const StoryTemplate: StoryFn<typeof SurveyQuestionScale> = (
|
|
12
|
+
const StoryTemplate: StoryFn<typeof SurveyQuestionScale> = (args, { updateArgs }) => ({
|
|
13
13
|
components: { SurveyQuestionScale },
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return { selectedValue: null };
|
|
14
|
+
setup() {
|
|
15
|
+
return { ...args };
|
|
17
16
|
},
|
|
18
17
|
template:
|
|
19
|
-
'<survey-question-scale :title="title" :scale-options="scaleOptions" :elaboration-value="elaborationValue" :elaborationLabel="elaborationLabel" :placeholder="placeholder" :selected-value="selectedValue" :state="state" @select-change="
|
|
20
|
-
'<
|
|
18
|
+
'<survey-question-scale :title="title" :scale-options="scaleOptions" :elaboration-value="elaborationValue" :elaborationLabel="elaborationLabel" :placeholder="placeholder" :selected-value="selectedValue" :state="state" @select-change="selectedValueUpdate" @elaboration-change="elaborationUpdate">' +
|
|
19
|
+
'<template v-if="explanation" #explanation><div v-html="explanation" /></template>' +
|
|
21
20
|
'</survey-question-scale>',
|
|
22
21
|
methods: {
|
|
23
22
|
elaborationUpdate(elaborationValue) {
|
|
24
23
|
updateArgs({ elaborationValue });
|
|
25
24
|
},
|
|
25
|
+
selectedValueUpdate(selectedValue) {
|
|
26
|
+
updateArgs({ selectedValue });
|
|
27
|
+
},
|
|
26
28
|
},
|
|
27
29
|
});
|
|
28
30
|
|
|
@@ -71,8 +73,8 @@ const args = {
|
|
|
71
73
|
|
|
72
74
|
const argTypes = {
|
|
73
75
|
elaborationValue: { control: { type: 'text' } },
|
|
74
|
-
explanation: { control: { type: 'text' } },
|
|
75
76
|
selectedValue: { control: false },
|
|
77
|
+
explanation: { control: { type: 'text' } },
|
|
76
78
|
scaleOptions: { control: { type: 'object' } },
|
|
77
79
|
state: {
|
|
78
80
|
control: { type: 'select', options: Object.values(SURVEY_QUESTION_STATES) },
|
|
@@ -103,23 +105,22 @@ const argTypesDisabled = {
|
|
|
103
105
|
'select-change': { control: false },
|
|
104
106
|
} as ArgTypes;
|
|
105
107
|
|
|
106
|
-
const StoryLimitedWidthTemplate: StoryFn<typeof SurveyQuestionScale> = (
|
|
107
|
-
argTypes,
|
|
108
|
-
{ updateArgs },
|
|
109
|
-
) => ({
|
|
108
|
+
const StoryLimitedWidthTemplate: StoryFn<typeof SurveyQuestionScale> = (args, { updateArgs }) => ({
|
|
110
109
|
components: { SurveyQuestionScale },
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
return { selectedValue: null };
|
|
110
|
+
setup() {
|
|
111
|
+
return { ...args };
|
|
114
112
|
},
|
|
115
113
|
template:
|
|
116
|
-
'<div style="max-width: 600px"><survey-question-scale :title="title" :scale-options="scaleOptions" :elaboration-value="elaborationValue" :elaborationLabel="elaborationLabel" :placeholder="placeholder" :selected-value="selectedValue" :state="state" @select-change="
|
|
117
|
-
'<
|
|
114
|
+
'<div style="max-width: 600px"><survey-question-scale :title="title" :scale-options="scaleOptions" :elaboration-value="elaborationValue" :elaborationLabel="elaborationLabel" :placeholder="placeholder" :selected-value="selectedValue" :state="state" @select-change="selectedValueUpdate" @elaboration-change="elaborationUpdate">' +
|
|
115
|
+
'<template v-if="explanation" #explanation><div v-html="explanation" /></template>' +
|
|
118
116
|
'</survey-question-scale></div>',
|
|
119
117
|
methods: {
|
|
120
118
|
elaborationUpdate(elaborationValue) {
|
|
121
119
|
updateArgs({ elaborationValue });
|
|
122
120
|
},
|
|
121
|
+
selectedValueUpdate(selectedValue) {
|
|
122
|
+
updateArgs({ selectedValue });
|
|
123
|
+
},
|
|
123
124
|
},
|
|
124
125
|
});
|
|
125
126
|
|
|
@@ -167,11 +168,13 @@ LimitedWidth.args = {
|
|
|
167
168
|
],
|
|
168
169
|
} as Args;
|
|
169
170
|
|
|
170
|
-
const StorySevenOptionsTemplate: StoryFn<typeof SurveyQuestionScale> = (
|
|
171
|
+
const StorySevenOptionsTemplate: StoryFn<typeof SurveyQuestionScale> = (args, { updateArgs }) => ({
|
|
171
172
|
components: { SurveyQuestionScale },
|
|
172
|
-
|
|
173
|
+
setup() {
|
|
174
|
+
return { ...args };
|
|
175
|
+
},
|
|
173
176
|
data() {
|
|
174
|
-
return {
|
|
177
|
+
return { elaboration: '' };
|
|
175
178
|
},
|
|
176
179
|
created() {
|
|
177
180
|
this.scaleOptions = [
|
|
@@ -220,7 +223,12 @@ const StorySevenOptionsTemplate: StoryFn<typeof SurveyQuestionScale> = (argTypes
|
|
|
220
223
|
];
|
|
221
224
|
},
|
|
222
225
|
template:
|
|
223
|
-
'<survey-question-scale title="title" :scale-options="scaleOptions" elaborationLabel="elaborationLabel" :elaboration-value="elaboration" :selected-value="selectedValue" @select-change="
|
|
226
|
+
'<survey-question-scale title="title" :scale-options="scaleOptions" elaborationLabel="elaborationLabel" :elaboration-value="elaboration" :selected-value="selectedValue" @select-change="selectedValueUpdate" />',
|
|
227
|
+
methods: {
|
|
228
|
+
selectedValueUpdate(selectedValue) {
|
|
229
|
+
updateArgs({ selectedValue });
|
|
230
|
+
},
|
|
231
|
+
},
|
|
224
232
|
});
|
|
225
233
|
|
|
226
234
|
export const SevenOptions = StorySevenOptionsTemplate.bind({});
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<slot name="explanation" />
|
|
5
5
|
<template #footer>
|
|
6
6
|
<div>
|
|
7
|
-
<ds-button :type="BUTTON_TYPES.OUTLINED" @click
|
|
7
|
+
<ds-button :type="BUTTON_TYPES.OUTLINED" @click="showModal = false">
|
|
8
8
|
OK, rozumiem
|
|
9
9
|
</ds-button>
|
|
10
10
|
</div>
|
|
@@ -21,20 +21,19 @@
|
|
|
21
21
|
:icon="ICONS.FA_CIRCLE_QUESTION"
|
|
22
22
|
:size="ICON_SIZES.MEDIUM"
|
|
23
23
|
:touchable="false"
|
|
24
|
-
@click
|
|
24
|
+
@click="showModal = true"
|
|
25
25
|
/>
|
|
26
26
|
</div>
|
|
27
27
|
<div class="surveyQuestionScale__content">
|
|
28
|
-
<template
|
|
28
|
+
<template
|
|
29
|
+
v-for="(option, index) in scaleOptions"
|
|
30
|
+
:key="`surveyQuestionScale-${index}`"
|
|
31
|
+
>
|
|
29
32
|
<div
|
|
30
33
|
v-if="option.standalone"
|
|
31
|
-
:key="`surveyQuestionScale__toggleSeparator-${index}`"
|
|
32
34
|
class="surveyQuestionScale__toggleSeparator"
|
|
33
35
|
/>
|
|
34
|
-
<div
|
|
35
|
-
:key="`surveyQuestionScale__toggle${index}`"
|
|
36
|
-
class="surveyQuestionScale__toggle"
|
|
37
|
-
>
|
|
36
|
+
<div class="surveyQuestionScale__toggle">
|
|
38
37
|
<survey-toggle
|
|
39
38
|
:meaning="option.meaning"
|
|
40
39
|
:content-text="option.content"
|
|
@@ -159,8 +158,6 @@
|
|
|
159
158
|
</style>
|
|
160
159
|
|
|
161
160
|
<script lang="ts">
|
|
162
|
-
import { Prop } from 'vue/types/options';
|
|
163
|
-
|
|
164
161
|
import DsCard from '../../Cards/Card';
|
|
165
162
|
import IconButton from '../../Buttons/IconButton';
|
|
166
163
|
import { ICON_SIZES, ICONS } from '../../Icons/Icon';
|
|
@@ -200,7 +197,7 @@ export default {
|
|
|
200
197
|
},
|
|
201
198
|
},
|
|
202
199
|
scaleOptions: {
|
|
203
|
-
type: Array as
|
|
200
|
+
type: Array as () => Array<SurveyQuestionScaleOption>,
|
|
204
201
|
required: true,
|
|
205
202
|
validator(scaleOptions) {
|
|
206
203
|
return scaleOptions.every((option) => typeof option === 'object');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
2
|
|
|
3
3
|
import SurveyToggle from './SurveyToggle.vue';
|
|
4
4
|
import {
|
|
@@ -15,19 +15,14 @@ describe('SurveyToggle', () => {
|
|
|
15
15
|
state = SURVEY_TOGGLE_STATES.DEFAULT,
|
|
16
16
|
status = SURVEY_TOGGLE_STATUSES.DEFAULT as typeof SURVEY_TOGGLE_STATUSES[keyof typeof SURVEY_TOGGLE_STATUSES], // TODO: make an util
|
|
17
17
|
} = {}) => {
|
|
18
|
-
const localVue = createLocalVue();
|
|
19
|
-
|
|
20
18
|
return shallowMount(SurveyToggle, {
|
|
21
|
-
|
|
22
|
-
mocks: {},
|
|
23
|
-
propsData: {
|
|
19
|
+
props: {
|
|
24
20
|
label,
|
|
25
21
|
color,
|
|
26
22
|
contentText,
|
|
27
23
|
state,
|
|
28
24
|
status,
|
|
29
|
-
},
|
|
30
|
-
stubs: {},
|
|
25
|
+
} as any,
|
|
31
26
|
});
|
|
32
27
|
};
|
|
33
28
|
|