@bethinkpl/design-system 34.2.1 → 35.0.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/dist/design-system.css +1 -1
- package/dist/design-system.js +4938 -4941
- package/dist/design-system.js.map +1 -1
- package/dist/i18n/en/blockadeStatus.json +4 -0
- package/dist/i18n/en/cardExpandable.json +4 -0
- package/dist/i18n/en/overlayHeader.json +3 -0
- package/dist/i18n/en/survey.json +3 -0
- package/dist/i18n/pl/blockadeStatus.json +4 -0
- package/dist/i18n/pl/cardExpandable.json +4 -0
- package/dist/i18n/pl/overlayHeader.json +3 -0
- package/dist/i18n/pl/survey.json +3 -0
- package/dist/lib/js/components/Cards/CardExpandable/CardExpandable.vue.d.ts +9 -5
- package/dist/lib/js/components/Headers/OverlayHeader/OverlayHeader.vue.d.ts +3 -1
- package/dist/lib/js/components/Pagination/Pagination.vue.d.ts +73 -435
- package/dist/lib/js/components/SelectList/SelectListItem/SelectListItem.vue.d.ts +36 -449
- package/dist/lib/js/components/SelectList/SelectListItemContainer/SelectListItemContainer.vue.d.ts +11 -0
- package/dist/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue.d.ts +80 -441
- package/dist/lib/js/components/Statuses/BlockadeStatus/BlockadeStatus.vue.d.ts +4 -2
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue.d.ts +12 -6
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts +10 -5
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionTextarea.vue.d.ts +7 -3
- package/dist/lib/js/components/TextGroup/TextGroup.consts.d.ts +1 -0
- package/dist/lib/js/i18n/en.d.ts +6 -0
- package/dist/lib/js/i18n/index.d.ts +12 -0
- package/dist/lib/js/i18n/pl.d.ts +6 -0
- package/dist/lib/js/index.d.ts +2 -2
- package/lib/js/components/Cards/CardExpandable/CardExpandable.stories.ts +2 -2
- package/lib/js/components/Cards/CardExpandable/CardExpandable.vue +19 -3
- package/lib/js/components/Divider/Divider.vue +1 -0
- package/lib/js/components/Headers/OverlayHeader/OverlayHeader.vue +7 -1
- package/lib/js/components/SelectList/SelectListItem/SelectListItem.stories.ts +26 -16
- package/lib/js/components/SelectList/SelectListItem/SelectListItem.vue +29 -73
- package/lib/js/components/SelectList/SelectListItemContainer/SelectListItemContainer.stories.ts +35 -0
- package/lib/js/components/SelectList/SelectListItemContainer/SelectListItemContainer.vue +19 -0
- package/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue +3 -3
- package/lib/js/components/Statuses/BlockadeStatus/BlockadeStatus.vue +8 -2
- package/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.stories.ts +2 -2
- package/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue +7 -2
- package/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.stories.ts +4 -4
- package/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue +5 -2
- package/lib/js/components/SurveyQuestions/SurveyQuestionTextarea.vue +13 -2
- package/lib/js/components/TextGroup/TextGroup.consts.ts +1 -0
- package/lib/js/components/TextGroup/TextGroup.vue +21 -0
- package/lib/js/i18n/en/blockadeStatus.json +4 -0
- package/lib/js/i18n/en/cardExpandable.json +4 -0
- package/lib/js/i18n/en/overlayHeader.json +3 -0
- package/lib/js/i18n/en/survey.json +3 -0
- package/lib/js/i18n/en.ts +8 -0
- package/lib/js/i18n/pl/blockadeStatus.json +4 -0
- package/lib/js/i18n/pl/cardExpandable.json +4 -0
- package/lib/js/i18n/pl/overlayHeader.json +3 -0
- package/lib/js/i18n/pl/survey.json +3 -0
- package/lib/js/i18n/pl.ts +8 -0
- package/lib/js/index.ts +2 -2
- package/package.json +1 -1
- package/lib/js/components/SelectList/SelectListItemTile/SelectListItemTile.stories.ts +0 -60
- package/lib/js/components/SelectList/SelectListItemTile/SelectListItemTile.vue +0 -41
|
@@ -11,7 +11,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
11
11
|
};
|
|
12
12
|
placeholder: {
|
|
13
13
|
type: StringConstructor;
|
|
14
|
-
default:
|
|
14
|
+
default: null;
|
|
15
15
|
};
|
|
16
16
|
state: {
|
|
17
17
|
type: StringConstructor;
|
|
@@ -322,7 +322,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
322
322
|
readonly DEFAULT: "default";
|
|
323
323
|
readonly DISABLED: "disabled";
|
|
324
324
|
}>;
|
|
325
|
-
}, {
|
|
325
|
+
}, {
|
|
326
|
+
resolvedPlaceholder(): string;
|
|
327
|
+
}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "input"[], "input", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
326
328
|
title: {
|
|
327
329
|
type: StringConstructor;
|
|
328
330
|
required: true;
|
|
@@ -333,7 +335,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
333
335
|
};
|
|
334
336
|
placeholder: {
|
|
335
337
|
type: StringConstructor;
|
|
336
|
-
default:
|
|
338
|
+
default: null;
|
|
337
339
|
};
|
|
338
340
|
state: {
|
|
339
341
|
type: StringConstructor;
|
|
@@ -353,13 +355,17 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
353
355
|
};
|
|
354
356
|
placeholder: {
|
|
355
357
|
type: StringConstructor;
|
|
356
|
-
default:
|
|
358
|
+
default: null;
|
|
357
359
|
};
|
|
358
360
|
disabled: {
|
|
359
361
|
type: BooleanConstructor;
|
|
360
362
|
default: boolean;
|
|
361
363
|
};
|
|
362
|
-
}>, {
|
|
364
|
+
}>, {
|
|
365
|
+
t: import('../../../i18n').TranslateFunction;
|
|
366
|
+
}, {}, {
|
|
367
|
+
resolvedPlaceholder(): string;
|
|
368
|
+
}, {
|
|
363
369
|
onInput(evt: any): void;
|
|
364
370
|
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "input"[], "input", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
365
371
|
value: {
|
|
@@ -368,7 +374,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
368
374
|
};
|
|
369
375
|
placeholder: {
|
|
370
376
|
type: StringConstructor;
|
|
371
|
-
default:
|
|
377
|
+
default: null;
|
|
372
378
|
};
|
|
373
379
|
disabled: {
|
|
374
380
|
type: BooleanConstructor;
|
package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
26
26
|
};
|
|
27
27
|
placeholder: {
|
|
28
28
|
type: StringConstructor;
|
|
29
|
-
default:
|
|
29
|
+
default: null;
|
|
30
30
|
};
|
|
31
31
|
selectedValue: {
|
|
32
32
|
type: StringConstructor;
|
|
@@ -359,6 +359,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
359
359
|
readonly TWO: "two";
|
|
360
360
|
}>;
|
|
361
361
|
}, {
|
|
362
|
+
resolvedPlaceholder(): string;
|
|
362
363
|
standaloneOptions(): any;
|
|
363
364
|
}, {
|
|
364
365
|
onToggleClick(value: string): void;
|
|
@@ -387,7 +388,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
387
388
|
};
|
|
388
389
|
placeholder: {
|
|
389
390
|
type: StringConstructor;
|
|
390
|
-
default:
|
|
391
|
+
default: null;
|
|
391
392
|
};
|
|
392
393
|
selectedValue: {
|
|
393
394
|
type: StringConstructor;
|
|
@@ -415,13 +416,17 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
415
416
|
};
|
|
416
417
|
placeholder: {
|
|
417
418
|
type: StringConstructor;
|
|
418
|
-
default:
|
|
419
|
+
default: null;
|
|
419
420
|
};
|
|
420
421
|
disabled: {
|
|
421
422
|
type: BooleanConstructor;
|
|
422
423
|
default: boolean;
|
|
423
424
|
};
|
|
424
|
-
}>, {
|
|
425
|
+
}>, {
|
|
426
|
+
t: import('../../../i18n').TranslateFunction;
|
|
427
|
+
}, {}, {
|
|
428
|
+
resolvedPlaceholder(): string;
|
|
429
|
+
}, {
|
|
425
430
|
onInput(evt: any): void;
|
|
426
431
|
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "input"[], "input", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
427
432
|
value: {
|
|
@@ -430,7 +435,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
430
435
|
};
|
|
431
436
|
placeholder: {
|
|
432
437
|
type: StringConstructor;
|
|
433
|
-
default:
|
|
438
|
+
default: null;
|
|
434
439
|
};
|
|
435
440
|
disabled: {
|
|
436
441
|
type: BooleanConstructor;
|
|
@@ -5,13 +5,17 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
5
5
|
};
|
|
6
6
|
placeholder: {
|
|
7
7
|
type: StringConstructor;
|
|
8
|
-
default:
|
|
8
|
+
default: null;
|
|
9
9
|
};
|
|
10
10
|
disabled: {
|
|
11
11
|
type: BooleanConstructor;
|
|
12
12
|
default: boolean;
|
|
13
13
|
};
|
|
14
|
-
}>, {
|
|
14
|
+
}>, {
|
|
15
|
+
t: import('../../i18n').TranslateFunction;
|
|
16
|
+
}, {}, {
|
|
17
|
+
resolvedPlaceholder(): string;
|
|
18
|
+
}, {
|
|
15
19
|
onInput(evt: any): void;
|
|
16
20
|
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "input"[], "input", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
17
21
|
value: {
|
|
@@ -20,7 +24,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
20
24
|
};
|
|
21
25
|
placeholder: {
|
|
22
26
|
type: StringConstructor;
|
|
23
|
-
default:
|
|
27
|
+
default: null;
|
|
24
28
|
};
|
|
25
29
|
disabled: {
|
|
26
30
|
type: BooleanConstructor;
|
package/dist/lib/js/i18n/en.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
"ds.blockadeStatus.active": string;
|
|
3
|
+
"ds.blockadeStatus.ended": string;
|
|
4
|
+
"ds.cardExpandable.collapse": string;
|
|
5
|
+
"ds.cardExpandable.expand": string;
|
|
6
|
+
"ds.overlayHeader.close": string;
|
|
7
|
+
"ds.survey.placeholder": string;
|
|
2
8
|
"ds.datePicker.selectDate": string;
|
|
3
9
|
"ds.datePicker.set": string;
|
|
4
10
|
"ds.statsLayout.default.leftColumnLabel": string;
|
|
@@ -4,6 +4,12 @@ import { default as pl } from './pl';
|
|
|
4
4
|
export type MessageSchema = typeof pl;
|
|
5
5
|
export declare const messages: {
|
|
6
6
|
pl: {
|
|
7
|
+
"ds.blockadeStatus.active": string;
|
|
8
|
+
"ds.blockadeStatus.ended": string;
|
|
9
|
+
"ds.cardExpandable.collapse": string;
|
|
10
|
+
"ds.cardExpandable.expand": string;
|
|
11
|
+
"ds.overlayHeader.close": string;
|
|
12
|
+
"ds.survey.placeholder": string;
|
|
7
13
|
"ds.datePicker.selectDate": string;
|
|
8
14
|
"ds.datePicker.set": string;
|
|
9
15
|
"ds.statsLayout.default.leftColumnLabel": string;
|
|
@@ -26,6 +32,12 @@ export declare const messages: {
|
|
|
26
32
|
"ds.globals.loading": string;
|
|
27
33
|
};
|
|
28
34
|
en: {
|
|
35
|
+
"ds.blockadeStatus.active": string;
|
|
36
|
+
"ds.blockadeStatus.ended": string;
|
|
37
|
+
"ds.cardExpandable.collapse": string;
|
|
38
|
+
"ds.cardExpandable.expand": string;
|
|
39
|
+
"ds.overlayHeader.close": string;
|
|
40
|
+
"ds.survey.placeholder": string;
|
|
29
41
|
"ds.datePicker.selectDate": string;
|
|
30
42
|
"ds.datePicker.set": string;
|
|
31
43
|
"ds.statsLayout.default.leftColumnLabel": string;
|
package/dist/lib/js/i18n/pl.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
"ds.blockadeStatus.active": string;
|
|
3
|
+
"ds.blockadeStatus.ended": string;
|
|
4
|
+
"ds.cardExpandable.collapse": string;
|
|
5
|
+
"ds.cardExpandable.expand": string;
|
|
6
|
+
"ds.overlayHeader.close": string;
|
|
7
|
+
"ds.survey.placeholder": string;
|
|
2
8
|
"ds.datePicker.selectDate": string;
|
|
3
9
|
"ds.datePicker.set": string;
|
|
4
10
|
"ds.statsLayout.default.leftColumnLabel": string;
|
package/dist/lib/js/index.d.ts
CHANGED
|
@@ -127,8 +127,8 @@ export { default as SelectListItemDivider } from './components/SelectList/Select
|
|
|
127
127
|
export { default as DsSelectListItemDivider } from './components/SelectList/SelectListItemDivider/SelectListItemDivider.vue';
|
|
128
128
|
export { default as SelectListItemToggle } from './components/SelectList/SelectListItemToggle/SelectListItemToggle.vue';
|
|
129
129
|
export { default as DsSelectListItemToggle } from './components/SelectList/SelectListItemToggle/SelectListItemToggle.vue';
|
|
130
|
-
export { default as
|
|
131
|
-
export { default as
|
|
130
|
+
export { default as SelectListItemContainer } from './components/SelectList/SelectListItemContainer/SelectListItemContainer.vue';
|
|
131
|
+
export { default as DsSelectListItemContainer } from './components/SelectList/SelectListItemContainer/SelectListItemContainer.vue';
|
|
132
132
|
export { default as SelectListSectionTitle } from './components/SelectList/SelectListSectionTitle/SelectListSectionTitle.vue';
|
|
133
133
|
export { default as DsSelectListSectionTitle } from './components/SelectList/SelectListSectionTitle/SelectListSectionTitle.vue';
|
|
134
134
|
export * from './components/SelectList/SelectListItem/SelectListItem.consts';
|
|
@@ -13,8 +13,8 @@ const StoryTemplate: StoryFn<typeof CardExpandable> = (args) => ({
|
|
|
13
13
|
return args;
|
|
14
14
|
},
|
|
15
15
|
template: `
|
|
16
|
-
<card-expandable :is-expander-visible="isExpanderVisible" :expander-text-collapsed="expanderTextCollapsed"
|
|
17
|
-
:expander-text-expanded="expanderTextExpanded" :is-expanded="isExpanded"
|
|
16
|
+
<card-expandable :is-expander-visible="isExpanderVisible" :expander-text-collapsed="expanderTextCollapsed !== '' ? expanderTextCollapsed : null"
|
|
17
|
+
:expander-text-expanded="expanderTextExpanded !== '' ? expanderTextExpanded : null" :is-expanded="isExpanded"
|
|
18
18
|
:header-has-padding="headerHasPadding" :divider-under-header="dividerUnderHeader">
|
|
19
19
|
<template v-if="header" #header>
|
|
20
20
|
<div v-html="header" />
|
|
@@ -16,7 +16,11 @@
|
|
|
16
16
|
<template v-if="isExpanderVisible" #footer>
|
|
17
17
|
<div class="ds-cardExpandable__expander" @click="onExpanderClick">
|
|
18
18
|
<span class="ds-cardExpandable__expanderLabel">
|
|
19
|
-
{{
|
|
19
|
+
{{
|
|
20
|
+
isExpandedInternal
|
|
21
|
+
? resolvedExpanderTextExpanded
|
|
22
|
+
: resolvedExpanderTextCollapsed
|
|
23
|
+
}}
|
|
20
24
|
</span>
|
|
21
25
|
<ds-icon
|
|
22
26
|
class="ds-cardExpandable__expanderIcon"
|
|
@@ -72,6 +76,7 @@
|
|
|
72
76
|
import { defineComponent } from 'vue';
|
|
73
77
|
import DsCard from '../Card/';
|
|
74
78
|
import DsIcon, { ICON_SIZES, ICONS } from '../../../components/Icons/Icon';
|
|
79
|
+
import { useLegacyI18n } from '../../../composables/useLegacyI18n';
|
|
75
80
|
|
|
76
81
|
export default defineComponent({
|
|
77
82
|
name: 'CardExpandable',
|
|
@@ -90,11 +95,11 @@ export default defineComponent({
|
|
|
90
95
|
},
|
|
91
96
|
expanderTextCollapsed: {
|
|
92
97
|
type: String,
|
|
93
|
-
default:
|
|
98
|
+
default: null,
|
|
94
99
|
},
|
|
95
100
|
expanderTextExpanded: {
|
|
96
101
|
type: String,
|
|
97
|
-
default:
|
|
102
|
+
default: null,
|
|
98
103
|
},
|
|
99
104
|
headerHasPadding: {
|
|
100
105
|
type: Boolean,
|
|
@@ -106,6 +111,11 @@ export default defineComponent({
|
|
|
106
111
|
},
|
|
107
112
|
},
|
|
108
113
|
emits: { 'update:isExpanded': (payload: Boolean) => true },
|
|
114
|
+
setup() {
|
|
115
|
+
const { t } = useLegacyI18n();
|
|
116
|
+
|
|
117
|
+
return { t };
|
|
118
|
+
},
|
|
109
119
|
data() {
|
|
110
120
|
return {
|
|
111
121
|
isExpandedInternal: false,
|
|
@@ -114,6 +124,12 @@ export default defineComponent({
|
|
|
114
124
|
};
|
|
115
125
|
},
|
|
116
126
|
computed: {
|
|
127
|
+
resolvedExpanderTextCollapsed(): string {
|
|
128
|
+
return this.expanderTextCollapsed ?? this.t('ds.cardExpandable.expand');
|
|
129
|
+
},
|
|
130
|
+
resolvedExpanderTextExpanded(): string {
|
|
131
|
+
return this.expanderTextExpanded ?? this.t('ds.cardExpandable.collapse');
|
|
132
|
+
},
|
|
117
133
|
chevronRotation(): number | null {
|
|
118
134
|
return this.isExpandedInternal ? 180 : null;
|
|
119
135
|
},
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
<ds-tooltip
|
|
105
105
|
:is-pointer-visible="false"
|
|
106
106
|
:placement="TOOLTIP_PLACEMENTS.LEFT"
|
|
107
|
-
text="
|
|
107
|
+
:text="t('ds.overlayHeader.close')"
|
|
108
108
|
>
|
|
109
109
|
<ds-icon-button
|
|
110
110
|
data-test-selector="overlay-header-close-button"
|
|
@@ -320,6 +320,7 @@ import {
|
|
|
320
320
|
} from './OverlayHeader.consts';
|
|
321
321
|
import { Value } from '../../../utils/type.utils';
|
|
322
322
|
import { isElementEditable } from '../../../utils/shortcut-keys';
|
|
323
|
+
import { useLegacyI18n } from '../../../composables/useLegacyI18n';
|
|
323
324
|
import { toRaw } from 'vue';
|
|
324
325
|
|
|
325
326
|
import { defineComponent } from 'vue';
|
|
@@ -369,6 +370,11 @@ export default defineComponent({
|
|
|
369
370
|
close: () => true,
|
|
370
371
|
titleClick: () => true,
|
|
371
372
|
},
|
|
373
|
+
setup() {
|
|
374
|
+
const { t } = useLegacyI18n();
|
|
375
|
+
|
|
376
|
+
return { t };
|
|
377
|
+
},
|
|
372
378
|
data() {
|
|
373
379
|
return {
|
|
374
380
|
ICON_BUTTON_SIZES: Object.freeze(ICON_BUTTON_SIZES),
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import SelectListItem from './SelectListItem.vue';
|
|
2
2
|
import { ICONS } from '../../Icons/Icon';
|
|
3
|
+
import SlotPlaceholder, {
|
|
4
|
+
SLOT_PLACEHOLDER_SIZES,
|
|
5
|
+
} from '../../../../../.storybook/SlotPlaceholder/SlotPlaceholder.vue';
|
|
3
6
|
|
|
4
7
|
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
5
8
|
import {
|
|
@@ -14,27 +17,30 @@ export default {
|
|
|
14
17
|
} as Meta<typeof SelectListItem>;
|
|
15
18
|
|
|
16
19
|
const StoryTemplate: StoryFn<typeof SelectListItem> = (args) => ({
|
|
17
|
-
components: { SelectListItem },
|
|
20
|
+
components: { SelectListItem, SlotPlaceholder },
|
|
18
21
|
setup() {
|
|
19
|
-
return
|
|
22
|
+
return {
|
|
23
|
+
args,
|
|
24
|
+
ICONS,
|
|
25
|
+
SLOT_PLACEHOLDER_SIZES,
|
|
26
|
+
};
|
|
20
27
|
},
|
|
21
28
|
template: `
|
|
22
29
|
<select-list-item
|
|
23
|
-
:icon-left="ICONS[iconLeft]"
|
|
24
|
-
:label="label"
|
|
25
|
-
:eyebrow-text="eyebrowText"
|
|
26
|
-
:is-eyebrow-text-uppercase="isEyebrowTextUppercase"
|
|
27
|
-
:is-selected="isSelected"
|
|
28
|
-
:selection-mode="selectionMode"
|
|
29
|
-
:size="size"
|
|
30
|
-
:state="state"
|
|
31
|
-
|
|
30
|
+
:icon-left="ICONS[args.iconLeft]"
|
|
31
|
+
:label="args.label"
|
|
32
|
+
:eyebrow-text="args.eyebrowText"
|
|
33
|
+
:is-eyebrow-text-uppercase="args.isEyebrowTextUppercase"
|
|
34
|
+
:is-selected="args.isSelected"
|
|
35
|
+
:selection-mode="args.selectionMode"
|
|
36
|
+
:size="args.size"
|
|
37
|
+
:state="args.state"
|
|
38
|
+
>
|
|
39
|
+
<template v-if="args.accessorySlot" #accessory>
|
|
40
|
+
<slot-placeholder :size="SLOT_PLACEHOLDER_SIZES.SMALL" :label="args.accessorySlot" />
|
|
41
|
+
</template>
|
|
42
|
+
</select-list-item>
|
|
32
43
|
`,
|
|
33
|
-
data() {
|
|
34
|
-
return {
|
|
35
|
-
ICONS: Object.freeze(ICONS),
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
44
|
});
|
|
39
45
|
|
|
40
46
|
export const Interactive = StoryTemplate.bind({});
|
|
@@ -48,6 +54,7 @@ const args = {
|
|
|
48
54
|
state: SELECT_LIST_ITEM_STATES.DEFAULT,
|
|
49
55
|
isSelected: false,
|
|
50
56
|
selectionMode: SELECT_LIST_ITEM_SELECTION_MODE.SELECT_ONLY,
|
|
57
|
+
accessorySlot: 'accessory',
|
|
51
58
|
} as Args;
|
|
52
59
|
|
|
53
60
|
const argTypes = {
|
|
@@ -67,6 +74,9 @@ const argTypes = {
|
|
|
67
74
|
control: 'select',
|
|
68
75
|
options: Object.values(SELECT_LIST_ITEM_STATES),
|
|
69
76
|
},
|
|
77
|
+
accessorySlot: {
|
|
78
|
+
control: 'text',
|
|
79
|
+
},
|
|
70
80
|
} as ArgTypes;
|
|
71
81
|
|
|
72
82
|
Interactive.argTypes = argTypes;
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
}"
|
|
11
11
|
:title="label"
|
|
12
12
|
>
|
|
13
|
+
<slot name="accessory" />
|
|
14
|
+
|
|
13
15
|
<ds-icon
|
|
14
16
|
v-if="iconLeft || isLoading"
|
|
15
17
|
class="ds-selectListItem__iconLeft"
|
|
@@ -54,6 +56,7 @@
|
|
|
54
56
|
color: $color-neutral-text-heavy;
|
|
55
57
|
cursor: pointer;
|
|
56
58
|
display: flex;
|
|
59
|
+
gap: $space-3xs;
|
|
57
60
|
min-height: $minHeight;
|
|
58
61
|
padding: $space-xs;
|
|
59
62
|
|
|
@@ -100,7 +103,6 @@
|
|
|
100
103
|
|
|
101
104
|
&__iconLeft {
|
|
102
105
|
color: $color-neutral-icon;
|
|
103
|
-
margin-right: $space-3xs;
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
&__iconRight {
|
|
@@ -160,7 +162,8 @@
|
|
|
160
162
|
}
|
|
161
163
|
</style>
|
|
162
164
|
|
|
163
|
-
<script lang="ts">
|
|
165
|
+
<script setup lang="ts">
|
|
166
|
+
import { computed } from 'vue';
|
|
164
167
|
import {
|
|
165
168
|
SELECT_LIST_ITEM_SELECTION_MODE,
|
|
166
169
|
SELECT_LIST_ITEM_SIZES,
|
|
@@ -169,75 +172,28 @@ import {
|
|
|
169
172
|
SelectListItemSize,
|
|
170
173
|
SelectListItemState,
|
|
171
174
|
} from './SelectListItem.consts';
|
|
172
|
-
import DsIcon, { ICON_SIZES, ICONS } from '../../Icons/Icon';
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
eyebrowText: {
|
|
197
|
-
type: String,
|
|
198
|
-
default: '',
|
|
199
|
-
},
|
|
200
|
-
isEyebrowTextUppercase: {
|
|
201
|
-
type: Boolean,
|
|
202
|
-
default: false,
|
|
203
|
-
},
|
|
204
|
-
selectionMode: {
|
|
205
|
-
type: String,
|
|
206
|
-
default: SELECT_LIST_ITEM_SELECTION_MODE.SELECT_ONLY,
|
|
207
|
-
validator(selectionMode: SelectListItemSelectionMode) {
|
|
208
|
-
return Object.values(SELECT_LIST_ITEM_SELECTION_MODE).includes(selectionMode);
|
|
209
|
-
},
|
|
210
|
-
},
|
|
211
|
-
size: {
|
|
212
|
-
type: String,
|
|
213
|
-
default: SELECT_LIST_ITEM_SIZES.SMALL,
|
|
214
|
-
validator(size: SelectListItemSize) {
|
|
215
|
-
return Object.values(SELECT_LIST_ITEM_SIZES).includes(size);
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
state: {
|
|
219
|
-
type: String,
|
|
220
|
-
default: SELECT_LIST_ITEM_STATES.DEFAULT,
|
|
221
|
-
validator(state: SelectListItemState) {
|
|
222
|
-
return Object.values(SELECT_LIST_ITEM_STATES).includes(state);
|
|
223
|
-
},
|
|
224
|
-
},
|
|
225
|
-
},
|
|
226
|
-
data() {
|
|
227
|
-
return {
|
|
228
|
-
ICON_SIZES: Object.freeze(ICON_SIZES),
|
|
229
|
-
ICONS: Object.freeze(ICONS),
|
|
230
|
-
SELECT_LIST_ITEM_SELECTION_MODE: Object.freeze(SELECT_LIST_ITEM_SELECTION_MODE),
|
|
231
|
-
SELECT_LIST_ITEM_STATES: Object.freeze(SELECT_LIST_ITEM_STATES),
|
|
232
|
-
};
|
|
233
|
-
},
|
|
234
|
-
computed: {
|
|
235
|
-
isLoading(): boolean {
|
|
236
|
-
return this.state === SELECT_LIST_ITEM_STATES.LOADING;
|
|
237
|
-
},
|
|
238
|
-
isDisabled(): boolean {
|
|
239
|
-
return this.state === SELECT_LIST_ITEM_STATES.DISABLED;
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
});
|
|
175
|
+
import DsIcon, { ICON_SIZES, ICONS, IconItem } from '../../Icons/Icon';
|
|
176
|
+
|
|
177
|
+
const {
|
|
178
|
+
iconLeft = null,
|
|
179
|
+
isSelected = false,
|
|
180
|
+
label,
|
|
181
|
+
eyebrowText = '',
|
|
182
|
+
isEyebrowTextUppercase = false,
|
|
183
|
+
selectionMode = SELECT_LIST_ITEM_SELECTION_MODE.SELECT_ONLY,
|
|
184
|
+
size = SELECT_LIST_ITEM_SIZES.SMALL,
|
|
185
|
+
state = SELECT_LIST_ITEM_STATES.DEFAULT,
|
|
186
|
+
} = defineProps<{
|
|
187
|
+
iconLeft?: IconItem | null;
|
|
188
|
+
isSelected?: boolean;
|
|
189
|
+
label: string;
|
|
190
|
+
eyebrowText?: string;
|
|
191
|
+
isEyebrowTextUppercase?: boolean;
|
|
192
|
+
selectionMode?: SelectListItemSelectionMode;
|
|
193
|
+
size?: SelectListItemSize;
|
|
194
|
+
state?: SelectListItemState;
|
|
195
|
+
}>();
|
|
196
|
+
|
|
197
|
+
const isLoading = computed(() => state === SELECT_LIST_ITEM_STATES.LOADING);
|
|
198
|
+
const isDisabled = computed(() => state === SELECT_LIST_ITEM_STATES.DISABLED);
|
|
243
199
|
</script>
|
package/lib/js/components/SelectList/SelectListItemContainer/SelectListItemContainer.stories.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import SelectListItemContainer from './SelectListItemContainer.vue';
|
|
2
|
+
import Tile from '../../Tile';
|
|
3
|
+
import { TILE_STATES } from '../../Tile';
|
|
4
|
+
|
|
5
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Components/SelectList/SelectListItemContainer',
|
|
9
|
+
component: SelectListItemContainer,
|
|
10
|
+
} as Meta<typeof SelectListItemContainer>;
|
|
11
|
+
|
|
12
|
+
const StoryTemplate: StoryFn<typeof SelectListItemContainer> = () => ({
|
|
13
|
+
components: { SelectListItemContainer, DsTile: Tile },
|
|
14
|
+
template: `
|
|
15
|
+
<select-list-item-container>
|
|
16
|
+
<ds-tile
|
|
17
|
+
text="this is a text text"
|
|
18
|
+
eyebrow-text="this is an eyebrowText text"
|
|
19
|
+
additional-text="this is some additionalText"
|
|
20
|
+
:interactive="false"
|
|
21
|
+
:state="TILE_STATES.DEFAULT"
|
|
22
|
+
/>
|
|
23
|
+
</select-list-item-container>
|
|
24
|
+
`,
|
|
25
|
+
data: () => ({ TILE_STATES }),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const Default = StoryTemplate.bind({});
|
|
29
|
+
|
|
30
|
+
Default.parameters = {
|
|
31
|
+
design: {
|
|
32
|
+
type: 'figma',
|
|
33
|
+
url: 'https://www.figma.com/design/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?node-id=5367-94238&m=dev',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ds-selectListItemContainer">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<style scoped lang="scss">
|
|
8
|
+
@import '../../../../styles/settings/spacings';
|
|
9
|
+
|
|
10
|
+
.ds-selectListItemContainer {
|
|
11
|
+
padding: $space-2xs $space-xs;
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
|
|
15
|
+
<script setup lang="ts">
|
|
16
|
+
defineOptions({
|
|
17
|
+
name: 'SelectListItemContainer',
|
|
18
|
+
});
|
|
19
|
+
</script>
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from '../SelectListItem/SelectListItem.consts';
|
|
20
20
|
import { IconItem, ICONS } from '../../Icons/Icon';
|
|
21
21
|
import SelectListItem from '../SelectListItem/SelectListItem.vue';
|
|
22
|
-
import { defineComponent, toRaw } from 'vue';
|
|
22
|
+
import { defineComponent, PropType, toRaw } from 'vue';
|
|
23
23
|
|
|
24
24
|
export default defineComponent({
|
|
25
25
|
name: 'SelectListItemToggle',
|
|
@@ -54,14 +54,14 @@ export default defineComponent({
|
|
|
54
54
|
required: true,
|
|
55
55
|
},
|
|
56
56
|
size: {
|
|
57
|
-
type: String
|
|
57
|
+
type: String as PropType<SelectListItemSize>,
|
|
58
58
|
default: SELECT_LIST_ITEM_SIZES.SMALL,
|
|
59
59
|
validator(size: SelectListItemSize) {
|
|
60
60
|
return Object.values(SELECT_LIST_ITEM_SIZES).includes(size);
|
|
61
61
|
},
|
|
62
62
|
},
|
|
63
63
|
state: {
|
|
64
|
-
type: String
|
|
64
|
+
type: String as PropType<SelectListItemState>,
|
|
65
65
|
default: SELECT_LIST_ITEM_STATES.DEFAULT,
|
|
66
66
|
validator(state: SelectListItemState) {
|
|
67
67
|
return Object.values(SELECT_LIST_ITEM_STATES).includes(state);
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
import { defineComponent } from 'vue';
|
|
41
41
|
import Icon, { ICON_SIZES, ICONS } from '../../Icons/Icon';
|
|
42
42
|
import { COURSE_BLOCKADE_ACCESS_STATUS } from '../../../consts/user';
|
|
43
|
+
import { useLegacyI18n } from '../../../composables/useLegacyI18n';
|
|
43
44
|
|
|
44
45
|
export default defineComponent({
|
|
45
46
|
name: 'BlockadeStatus',
|
|
@@ -52,6 +53,11 @@ export default defineComponent({
|
|
|
52
53
|
required: true,
|
|
53
54
|
},
|
|
54
55
|
},
|
|
56
|
+
setup() {
|
|
57
|
+
const { t } = useLegacyI18n();
|
|
58
|
+
|
|
59
|
+
return { t };
|
|
60
|
+
},
|
|
55
61
|
data() {
|
|
56
62
|
return {
|
|
57
63
|
ICONS: Object.freeze(ICONS),
|
|
@@ -73,9 +79,9 @@ export default defineComponent({
|
|
|
73
79
|
},
|
|
74
80
|
text() {
|
|
75
81
|
if (this.status === COURSE_BLOCKADE_ACCESS_STATUS.ACTIVE) {
|
|
76
|
-
return '
|
|
82
|
+
return this.t('ds.blockadeStatus.active');
|
|
77
83
|
}
|
|
78
|
-
return '
|
|
84
|
+
return this.t('ds.blockadeStatus.ended');
|
|
79
85
|
},
|
|
80
86
|
},
|
|
81
87
|
});
|
package/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.stories.ts
CHANGED
|
@@ -19,7 +19,7 @@ const StoryTemplate: StoryFn<typeof SurveyQuestionOpenEnded> = (args) => {
|
|
|
19
19
|
},
|
|
20
20
|
// TODO typing in textarea looses focus
|
|
21
21
|
template:
|
|
22
|
-
'<survey-question-open-ended :title="title" :value="value" :state="state" :placeholder="placeholder" @input="explanationUpdate">' +
|
|
22
|
+
'<survey-question-open-ended :title="title" :value="value" :state="state" :placeholder="placeholder !== \'\' ? placeholder: null" @input="explanationUpdate">' +
|
|
23
23
|
'<template v-if="explanation" #explanation><div v-html="explanation" /></template>' +
|
|
24
24
|
'</survey-question-open-ended>',
|
|
25
25
|
methods: {
|
|
@@ -37,7 +37,7 @@ const args = {
|
|
|
37
37
|
value: 'value',
|
|
38
38
|
explanation:
|
|
39
39
|
'<h3 class="modalHeader" style="text-align: center; margin-bottom: 16px;">Jak ocenić, czy slajdy i diagramy były zrozumiałe?</h3><div>Wyczerpujące materiały dają poczucie pełnego zrozumieina, przy jednoczesnym usystematyzowaniu informacji. Wpływa na to nie tylko ich jakość, ale też ilość.</div>',
|
|
40
|
-
placeholder: '
|
|
40
|
+
placeholder: '',
|
|
41
41
|
state: SURVEY_QUESTION_STATES.DEFAULT,
|
|
42
42
|
} as Args;
|
|
43
43
|
|