@citizenplane/pimp 8.11.3 → 8.13.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/README.md +0 -2
- package/dist/assets/BaseInputLabel-B6HBeOYW.css +1 -0
- package/dist/assets/BaseInputLabel-BKfOnmKd.js +1 -0
- package/dist/assets/BaseInputLabel.stories-B3jMVrza.js +28 -0
- package/dist/assets/Color-YHDXOIA2-CfioBzZb.js +1 -0
- package/dist/assets/Colors-mWZwWrlN.js +1 -0
- package/dist/assets/CpAlert-6hd7PZeZ.js +1 -0
- package/dist/assets/CpAlert-BW1Zf1Km.css +1 -0
- package/dist/assets/CpAlert.stories-CcK6sLCO.js +58 -0
- package/dist/assets/CpBadge-BRRUYYEk.js +1 -0
- package/dist/assets/CpBadge-CE420vX2.css +1 -0
- package/dist/assets/CpBadge.stories-Btggeh1U.js +170 -0
- package/dist/assets/CpButton-DQb7zTje.js +1 -0
- package/dist/assets/CpButton-gbl9KLuG.css +1 -0
- package/dist/assets/CpButton.stories-Chy_2ILm.js +86 -0
- package/dist/assets/CpCheckbox-Dalwqglu.js +1 -0
- package/dist/assets/CpCheckbox-DdQW6Gbc.css +1 -0
- package/dist/assets/CpCheckbox.stories-BEtAkjE-.js +167 -0
- package/dist/assets/CpDate-BdnXxnGQ.css +1 -0
- package/dist/assets/CpDate-DdtWXX2Q.js +3 -0
- package/dist/assets/CpDate.stories-C2Jg2QqC.js +59 -0
- package/dist/assets/CpDatepicker-DlzMF4b8.js +5 -0
- package/dist/assets/CpDatepicker-DqugfF5T.css +1 -0
- package/dist/assets/CpDatepicker.stories-CvOQvZYr.js +83 -0
- package/dist/assets/CpDialog-BTJusbSJ.js +1 -0
- package/dist/assets/CpDialog-BeuM9Ffk.css +1 -0
- package/dist/assets/CpDialog.stories-jA8uhNJR.js +43 -0
- package/dist/assets/CpHeading-BfoX1SIY.js +1 -0
- package/dist/assets/CpHeading-DgViCnDE.css +1 -0
- package/dist/assets/CpHeading.stories-DYb8vPG0.js +85 -0
- package/dist/assets/CpIcon-CdMV7BxY.css +1 -0
- package/dist/assets/CpIcon-DjtGpusx.js +5 -0
- package/dist/assets/CpIcon.stories-Cavk2BnC.js +47 -0
- package/dist/assets/CpInput-BT29xZan.js +1 -0
- package/dist/assets/CpInput-CAegPnB6.css +1 -0
- package/dist/assets/CpInput.stories-BbBe4bFT.js +98 -0
- package/dist/assets/CpLoader-B--Vqrhj.js +1 -0
- package/dist/assets/CpLoader.stories-CZ0hlfa2.js +10 -0
- package/dist/assets/CpRadio-C7OtLwPR.js +1 -0
- package/dist/assets/CpRadio-DiUdGJPg.css +1 -0
- package/dist/assets/CpRadio.stories-DPcn2bvJ.js +132 -0
- package/dist/assets/CpSelect-DlLk_-bg.js +1 -0
- package/dist/assets/CpSelect-HpT9AKcz.css +1 -0
- package/dist/assets/CpSelect.stories-C90Kd5cu.js +85 -0
- package/dist/assets/CpSelectMenu-Bpz33Tbp.js +1 -0
- package/dist/assets/CpSelectMenu-Dw4sbiEj.css +1 -0
- package/dist/assets/CpSelectMenu.stories-Bw2sNo0F.js +104 -0
- package/dist/assets/CpSwitch-CIWoB1sY.css +1 -0
- package/dist/assets/CpSwitch-CeGY7EL9.js +1 -0
- package/dist/assets/CpSwitch.stories-DbepH0R0.js +132 -0
- package/dist/assets/CpTable-BN6Amfsc.css +1 -0
- package/dist/assets/CpTable-RA2YDd8h.js +1 -0
- package/dist/assets/CpTable.stories-Dgc6tAkl.js +151 -0
- package/dist/assets/CpTableEmptyState-DLgi2hhT.css +1 -0
- package/dist/assets/CpTableEmptyState-TCjommO_.js +1 -0
- package/dist/assets/CpTableEmptyState.stories-C2oOfeda.js +20 -0
- package/dist/assets/CpTextarea-CzC-Bjsy.css +1 -0
- package/dist/assets/CpTextarea-HUf2FbPC.js +1 -0
- package/dist/assets/CpTextarea.stories-_17UyFSg.js +64 -0
- package/dist/assets/CpToaster-BXpKEwda.css +1 -0
- package/dist/assets/CpToaster-D9ITJUky.js +1 -0
- package/dist/assets/CpToaster.stories-BhEsau9e.js +124 -0
- package/dist/assets/CpTooltip-BIIOHaoi.css +1 -0
- package/dist/assets/CpTooltip-CD0Q4ym2.js +1 -0
- package/dist/assets/CpTooltip.stories-acOxur2H.js +121 -0
- package/dist/assets/DocsRenderer-CFRXHY34-Do1gGJEp.js +623 -0
- package/dist/assets/Intent-UfUixXOL.js +1 -0
- package/dist/assets/ToggleColors-CSr2zujL.js +1 -0
- package/dist/assets/TransitionExpand-BHMSqajW.css +1 -0
- package/dist/assets/TransitionExpand-BLDnMZa8.js +1 -0
- package/dist/assets/TransitionExpand.stories-5x0MQdG_.js +121 -0
- package/dist/assets/_commonjsHelpers-CqkleIqs.js +1 -0
- package/dist/assets/_plugin-vue_export-helper-DlAUqK2U.js +1 -0
- package/dist/assets/anime.esm-RriTVqCw.js +8 -0
- package/dist/assets/entry-preview-CE4fSG5C.js +1 -0
- package/dist/assets/entry-preview-docs-DMfJ0ifx.js +16 -0
- package/dist/assets/iframe-DLKLJnYS.js +211 -0
- package/dist/assets/index-Bx-go_-4.js +8 -0
- package/dist/assets/index-CtrtR6PF.js +1 -0
- package/dist/assets/index-DCv8Njl6.js +1 -0
- package/dist/assets/index-DrFu-skq.js +6 -0
- package/dist/assets/preview-B8lJiyuQ.js +34 -0
- package/dist/assets/preview-BBWR9nbA.js +1 -0
- package/dist/assets/preview-BWzBA1C2.js +396 -0
- package/dist/assets/preview-CHl-kSbv.js +2 -0
- package/dist/assets/preview-CIuMKJn5.js +240 -0
- package/dist/assets/preview-CvbIS5ZJ.js +1 -0
- package/dist/assets/preview-D2UkcbT2.js +3 -0
- package/dist/assets/preview-DD_OYowb.js +1 -0
- package/dist/assets/preview-DGUiP6tS.js +7 -0
- package/dist/assets/preview-OgCpecWL.css +1 -0
- package/dist/assets/vue.esm-bundler-DmHyoj4Y.js +36 -0
- package/dist/favicon.svg +1 -0
- package/dist/iframe.html +666 -0
- package/dist/index.html +177 -0
- package/dist/index.json +1 -0
- package/dist/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/nunito-sans-bold.woff2 +0 -0
- package/dist/nunito-sans-italic.woff2 +0 -0
- package/dist/nunito-sans-regular.woff2 +0 -0
- package/dist/project.json +1 -0
- package/dist/sb-addons/chromatic-com-storybook-9/manager-bundle.js +331 -0
- package/dist/sb-addons/chromatic-com-storybook-9/manager-bundle.js.LEGAL.txt +51 -0
- package/dist/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
- package/dist/sb-addons/essentials-backgrounds-4/manager-bundle.js +12 -0
- package/dist/sb-addons/essentials-controls-1/manager-bundle.js +402 -0
- package/dist/sb-addons/essentials-docs-3/manager-bundle.js +242 -0
- package/dist/sb-addons/essentials-measure-7/manager-bundle.js +3 -0
- package/dist/sb-addons/essentials-outline-8/manager-bundle.js +3 -0
- package/dist/sb-addons/essentials-toolbars-6/manager-bundle.js +3 -0
- package/dist/sb-addons/essentials-viewport-5/manager-bundle.js +3 -0
- package/dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
- package/dist/sb-addons/storybook-experimental-addon-test-10/manager-bundle.js +223 -0
- package/dist/sb-common-assets/favicon.svg +1 -0
- package/dist/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/dist/sb-manager/globals-module-info.js +1052 -0
- package/dist/sb-manager/globals-runtime.js +42127 -0
- package/dist/sb-manager/globals.js +48 -0
- package/dist/sb-manager/runtime.js +12048 -0
- package/package.json +24 -5
- package/src/README.md +0 -25
- package/src/assets/styles/base/_base.scss +1 -5
- package/src/assets/styles/utilities/_index.scss +19 -0
- package/src/components/core/BaseInputLabel.vue +0 -1
- package/src/components/date-pickers/CpDate.vue +8 -5
- package/src/components/inputs/CpInput.vue +5 -16
- package/src/components/inputs/CpTextarea.vue +4 -6
- package/src/components/selects/CpSelect.vue +5 -5
- package/src/stories/BaseInputLabel.stories.ts +35 -0
- package/src/stories/CpAlert.stories.ts +90 -0
- package/src/stories/CpBadge.stories.ts +158 -0
- package/src/stories/CpButton.stories.ts +134 -0
- package/src/stories/CpCheckbox.stories.ts +184 -0
- package/src/stories/CpDate.stories.ts +110 -0
- package/src/stories/CpDatepicker.stories.ts +162 -0
- package/src/stories/CpDialog.stories.ts +53 -0
- package/src/stories/CpHeading.stories.ts +77 -0
- package/src/stories/CpIcon.stories.ts +79 -0
- package/src/stories/CpInput.stories.ts +155 -0
- package/src/stories/CpLoader.stories.ts +29 -0
- package/src/stories/CpRadio.stories.ts +139 -0
- package/src/stories/CpSelect.stories.ts +147 -0
- package/src/stories/CpSelectMenu.stories.ts +132 -0
- package/src/stories/CpSwitch.stories.ts +137 -0
- package/src/stories/CpTable.stories.ts +192 -0
- package/src/stories/CpTableEmptyState.stories.ts +34 -0
- package/src/stories/CpTextarea.stories.ts +112 -0
- package/src/stories/CpToaster.stories.ts +147 -0
- package/src/stories/CpTooltip.stories.ts +101 -0
- package/src/stories/TransitionExpand.stories.ts +85 -0
- package/vitest.workspace.js +31 -0
- package/dist/pimp.es.js +0 -14987
- package/dist/pimp.umd.js +0 -12
- package/dist/style.css +0 -1
- package/src/App.vue +0 -110
- package/src/components/core/playground-sections/SectionAtomicElements.vue +0 -83
- package/src/components/core/playground-sections/SectionButtons.vue +0 -142
- package/src/components/core/playground-sections/SectionContainer.vue +0 -50
- package/src/components/core/playground-sections/SectionDatePickers.vue +0 -160
- package/src/components/core/playground-sections/SectionDialog.vue +0 -47
- package/src/components/core/playground-sections/SectionFeedbackIndicators.vue +0 -47
- package/src/components/core/playground-sections/SectionInputs.vue +0 -46
- package/src/components/core/playground-sections/SectionListsAndTables.vue +0 -268
- package/src/components/core/playground-sections/SectionSelectMenus.vue +0 -98
- package/src/components/core/playground-sections/SectionSelects.vue +0 -120
- package/src/components/core/playground-sections/SectionSimpleInputs.vue +0 -305
- package/src/components/core/playground-sections/SectionToasters.vue +0 -68
- package/src/components/core/playground-sections/SectionToggles.vue +0 -158
- package/src/components/core/playground-sections/SectionTypography.vue +0 -40
- package/src/main.js +0 -15
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section-container section-title="Date picker" class="sectionDatePickers">
|
|
3
|
-
<div class="sectionDatePickers__type">
|
|
4
|
-
<cp-heading heading-level="h3" :size="600" class="sectionDatePickers__title">
|
|
5
|
-
Default date input: {{ cpDate }}
|
|
6
|
-
</cp-heading>
|
|
7
|
-
<div class="sectionDatePickers__datepickers">
|
|
8
|
-
<cp-date
|
|
9
|
-
v-model="cpDate"
|
|
10
|
-
label="default date input"
|
|
11
|
-
class="sectionDatePickers__date"
|
|
12
|
-
:is-invalid="false"
|
|
13
|
-
locale="fr"
|
|
14
|
-
/>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
<div class="sectionDatePickers__type">
|
|
18
|
-
<cp-heading heading-level="h3" :size="600" class="sectionDatePickers__title">
|
|
19
|
-
Default datepicker: {{ date }}
|
|
20
|
-
</cp-heading>
|
|
21
|
-
<div class="sectionDatePickers__datepickers">
|
|
22
|
-
<cp-datepicker label="Simple datepicker" :init-date-one="date" @dates="setDate" />
|
|
23
|
-
<cp-button class="sectionDatePickers__button" @click="resetDate">Reset date</cp-button>
|
|
24
|
-
</div>
|
|
25
|
-
<div class="sectionDatePickers__datepickers">
|
|
26
|
-
<div class="sectionDatePickers__wrapper">
|
|
27
|
-
<cp-input id="datepicker-trigger" label="CoreDatepicker" placeholder="CoreDatepicker" />
|
|
28
|
-
<cp-core-datepicker
|
|
29
|
-
class="sectionDatePickers__custom"
|
|
30
|
-
mode="range"
|
|
31
|
-
close-after-select
|
|
32
|
-
is-inline
|
|
33
|
-
@opened="() => (isDepartureDatepickerOpen = true)"
|
|
34
|
-
@closed="() => (isDepartureDatepickerOpen = false)"
|
|
35
|
-
/>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
<div class="sectionDatePickers__type">
|
|
40
|
-
<cp-heading heading-level="h3" :size="600" class="sectionDatePickers__title">
|
|
41
|
-
Simple inline datepicker: {{ date }}
|
|
42
|
-
</cp-heading>
|
|
43
|
-
<div class="sectionDatePickers__datepickers">
|
|
44
|
-
<cp-datepicker label="Range datepicker" single-month is-inline :init-date-one="date" @dates="setDate" />
|
|
45
|
-
<cp-datepicker label="Range datepicker" is-inline :init-date-one="date" @dates="setDate" />
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
<div class="sectionDatePickers__type">
|
|
49
|
-
<cp-heading heading-level="h3" :size="600" class="sectionDatePickers__title"> Range datepicker </cp-heading>
|
|
50
|
-
<div class="sectionDatePickers__datepickers">
|
|
51
|
-
<cp-datepicker label="Range datepicker" mode="range" min-date="2020-10-10" />
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
<div class="sectionDatePickers__type">
|
|
55
|
-
<cp-heading heading-level="h3" :size="600" class="sectionDatePickers__title">
|
|
56
|
-
Simple datepicker with custom placeholder
|
|
57
|
-
</cp-heading>
|
|
58
|
-
<div class="sectionDatePickers__datepickers">
|
|
59
|
-
<cp-datepicker
|
|
60
|
-
label="Simple datepicker with custom placeholder"
|
|
61
|
-
:init-date-one="date"
|
|
62
|
-
placeholder="Custom placeholder"
|
|
63
|
-
@dates="setDate"
|
|
64
|
-
/>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
<div class="sectionDatePickers__type">
|
|
68
|
-
<cp-heading heading-level="h3" :size="600" class="sectionDatePickers__title">
|
|
69
|
-
Datepicker with set minDate & maxDate (2021-01-01 / 2021-01-10)
|
|
70
|
-
</cp-heading>
|
|
71
|
-
<div class="sectionDatePickers__datepickers">
|
|
72
|
-
<cp-datepicker
|
|
73
|
-
label="Datepicker with set minDate & maxDate"
|
|
74
|
-
min-date="2022-01-01"
|
|
75
|
-
max-date="2022-01-10"
|
|
76
|
-
placeholder="Custom placeholder"
|
|
77
|
-
@dates="setDate"
|
|
78
|
-
/>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
<div class="sectionDatePickers__type">
|
|
82
|
-
<cp-heading heading-level="h3" :size="600" class="sectionDatePickers__title"> Allow-past-dates </cp-heading>
|
|
83
|
-
<div class="sectionDatePickers__datepickers">
|
|
84
|
-
<cp-datepicker label="Allow past dates" allow-past-dates placeholder="Custom placeholder" @dates="setDate" />
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
<div class="sectionDatePickers__type">
|
|
88
|
-
<cp-heading heading-level="h3" :size="600" class="sectionDatePickers__title"> Default CpCalendar </cp-heading>
|
|
89
|
-
<div class="sectionDatePickers__datepickers">
|
|
90
|
-
<cp-calendar label="Calendar" />
|
|
91
|
-
</div>
|
|
92
|
-
</div>
|
|
93
|
-
</section-container>
|
|
94
|
-
</template>
|
|
95
|
-
|
|
96
|
-
<script>
|
|
97
|
-
import SectionContainer from '@/components/core/playground-sections/SectionContainer.vue'
|
|
98
|
-
|
|
99
|
-
export default {
|
|
100
|
-
components: {
|
|
101
|
-
SectionContainer,
|
|
102
|
-
},
|
|
103
|
-
data() {
|
|
104
|
-
return {
|
|
105
|
-
cpDate: '',
|
|
106
|
-
date: null,
|
|
107
|
-
isDepartureDatepickerOpen: false,
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
methods: {
|
|
111
|
-
setDate(newValue) {
|
|
112
|
-
this.date = newValue[0]
|
|
113
|
-
},
|
|
114
|
-
resetDate() {
|
|
115
|
-
this.date = null
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
}
|
|
119
|
-
</script>
|
|
120
|
-
<style lang="scss">
|
|
121
|
-
.sectionDatePickers {
|
|
122
|
-
&__title {
|
|
123
|
-
margin-bottom: sp.$space-lg;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
&__datepickers {
|
|
127
|
-
display: flex;
|
|
128
|
-
align-items: flex-end;
|
|
129
|
-
flex-wrap: wrap;
|
|
130
|
-
|
|
131
|
-
> * {
|
|
132
|
-
margin: 0 sp.$space-lg sp.$space-lg 0;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
&__date {
|
|
137
|
-
width: min(100%, 450px);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
&__item {
|
|
141
|
-
display: flex;
|
|
142
|
-
align-items: flex-end;
|
|
143
|
-
justify-content: center;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
&__button {
|
|
147
|
-
margin-left: sp.$space-lg;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
&__wrapper {
|
|
151
|
-
position: relative;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
&__custom {
|
|
155
|
-
position: absolute;
|
|
156
|
-
top: calc(100% + 16px);
|
|
157
|
-
left: 0;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
</style>
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section-container section-title="Dialog" class="sectionDialog">
|
|
3
|
-
<cp-dialog-wrapper>
|
|
4
|
-
<cp-dialog v-if="isDialogVisible" @close="toggleDialog">
|
|
5
|
-
<template #header>
|
|
6
|
-
<h3 class="sectionDialog__header">Some dialog header...</h3>
|
|
7
|
-
</template>
|
|
8
|
-
<template #content>
|
|
9
|
-
<p class="sectionDialog__content">Some dialog content...</p>
|
|
10
|
-
</template>
|
|
11
|
-
<template #footer>
|
|
12
|
-
<div class="sectionDialog__footer">
|
|
13
|
-
<cp-button @click="toggleDialog">Close</cp-button>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
</cp-dialog>
|
|
17
|
-
</cp-dialog-wrapper>
|
|
18
|
-
<cp-button @click="toggleDialog">Show dialog</cp-button>
|
|
19
|
-
</section-container>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
22
|
-
<script setup>
|
|
23
|
-
import { ref } from 'vue'
|
|
24
|
-
|
|
25
|
-
import SectionContainer from '@/components/core/playground-sections/SectionContainer.vue'
|
|
26
|
-
import CpDialogWrapper from '@/components/atomic-elements/CpDialogWrapper.vue'
|
|
27
|
-
import CpDialog from '@/components/atomic-elements/CpDialog.vue'
|
|
28
|
-
|
|
29
|
-
const isDialogVisible = ref(false)
|
|
30
|
-
|
|
31
|
-
const toggleDialog = () => (isDialogVisible.value = !isDialogVisible.value)
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<style lang="scss">
|
|
35
|
-
.sectionDialog {
|
|
36
|
-
&__header,
|
|
37
|
-
&__content {
|
|
38
|
-
padding: sp.$space-xl;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&__footer {
|
|
42
|
-
display: flex;
|
|
43
|
-
justify-content: flex-end;
|
|
44
|
-
width: 100%;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
</style>
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section-container section-title="Feedback Indicators" class="sectionFeedbackIndicators">
|
|
3
|
-
<div class="sectionFeedbackIndicators__alertMessage">
|
|
4
|
-
<cp-heading heading-level="h3" :size="600" class="sectionFeedbackIndicators__title">Alert message</cp-heading>
|
|
5
|
-
<cp-alert
|
|
6
|
-
v-for="(alert, alertIndex) in alertMessages"
|
|
7
|
-
:key="alertIndex"
|
|
8
|
-
:intent="alert"
|
|
9
|
-
:title="`Alert intent: ${alert}`"
|
|
10
|
-
is-closable
|
|
11
|
-
>
|
|
12
|
-
The quick, brown fox jumps over a lazy dog.
|
|
13
|
-
</cp-alert>
|
|
14
|
-
</div>
|
|
15
|
-
</section-container>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script>
|
|
19
|
-
import SectionContainer from '@/components/core/playground-sections/SectionContainer.vue'
|
|
20
|
-
|
|
21
|
-
export default {
|
|
22
|
-
components: {
|
|
23
|
-
SectionContainer,
|
|
24
|
-
},
|
|
25
|
-
data() {
|
|
26
|
-
return {
|
|
27
|
-
alertMessages: ['info', 'success', 'warning', 'critical'],
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
}
|
|
31
|
-
</script>
|
|
32
|
-
|
|
33
|
-
<style lang="scss">
|
|
34
|
-
.sectionFeedbackIndicators {
|
|
35
|
-
&__alertMessage {
|
|
36
|
-
width: 100%;
|
|
37
|
-
|
|
38
|
-
> *:not(:last-of-type) {
|
|
39
|
-
margin-bottom: sp.$space;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
&__title {
|
|
44
|
-
margin-bottom: sp.$space-lg;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
</style>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section-container section-title="Inputs" class="sectionInputs">
|
|
3
|
-
<div class="sectionInputs__section">
|
|
4
|
-
<cp-heading heading-level="h3" :size="600" class="sectionInputs__title">Simple inputs</cp-heading>
|
|
5
|
-
<section-simple-inputs />
|
|
6
|
-
</div>
|
|
7
|
-
<div class="sectionInputs__section">
|
|
8
|
-
<cp-heading heading-level="h3" :size="600" class="sectionInputs__title">Textarea</cp-heading>
|
|
9
|
-
<cp-textarea
|
|
10
|
-
v-model="textarea"
|
|
11
|
-
label="Textarea label"
|
|
12
|
-
placeholder="The quick, brown fox jumps over a lazy dog."
|
|
13
|
-
/>
|
|
14
|
-
</div>
|
|
15
|
-
</section-container>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script>
|
|
19
|
-
import SectionContainer from '@/components/core/playground-sections/SectionContainer.vue'
|
|
20
|
-
import SectionSimpleInputs from '@/components/core/playground-sections/SectionSimpleInputs.vue'
|
|
21
|
-
import CpTextarea from '@/components/inputs/CpTextarea.vue'
|
|
22
|
-
|
|
23
|
-
export default {
|
|
24
|
-
components: {
|
|
25
|
-
CpTextarea,
|
|
26
|
-
SectionContainer,
|
|
27
|
-
SectionSimpleInputs,
|
|
28
|
-
},
|
|
29
|
-
data() {
|
|
30
|
-
return {
|
|
31
|
-
textarea: '',
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
}
|
|
35
|
-
</script>
|
|
36
|
-
<style lang="scss">
|
|
37
|
-
.sectionInputs {
|
|
38
|
-
&__section:not(:last-of-type) {
|
|
39
|
-
margin-bottom: sp.$space-lg;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&__title {
|
|
43
|
-
margin-bottom: sp.$space-lg;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
</style>
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section-container section-title="List and tables" class="sectionListAndTables">
|
|
3
|
-
<div class="sectionListAndTables">
|
|
4
|
-
<cp-table
|
|
5
|
-
:caption="caption"
|
|
6
|
-
:data="computedRows"
|
|
7
|
-
:columns="computedColumns"
|
|
8
|
-
class="tableExample__table"
|
|
9
|
-
:pagination="computedPagination"
|
|
10
|
-
:is-loading="isLoading"
|
|
11
|
-
enable-row-options
|
|
12
|
-
are-rows-clickable
|
|
13
|
-
@on-row-right-click="handleRightClick"
|
|
14
|
-
>
|
|
15
|
-
<template #row-quick-actions>
|
|
16
|
-
<button @click.stop="testAlert">
|
|
17
|
-
<cp-icon type="download" />
|
|
18
|
-
</button>
|
|
19
|
-
</template>
|
|
20
|
-
</cp-table>
|
|
21
|
-
<ul ref="menu" class="sectionListAndTables__menu hidden">
|
|
22
|
-
<li>First option</li>
|
|
23
|
-
<li>Second option</li>
|
|
24
|
-
<li>Third option</li>
|
|
25
|
-
</ul>
|
|
26
|
-
</div>
|
|
27
|
-
</section-container>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
<script>
|
|
31
|
-
import SectionContainer from '@/components/core/playground-sections/SectionContainer.vue'
|
|
32
|
-
|
|
33
|
-
export default {
|
|
34
|
-
components: {
|
|
35
|
-
SectionContainer,
|
|
36
|
-
},
|
|
37
|
-
data() {
|
|
38
|
-
return {
|
|
39
|
-
objectColumns: [
|
|
40
|
-
{
|
|
41
|
-
name: 'Line number (300px width)',
|
|
42
|
-
id: 'line_number',
|
|
43
|
-
width: 300,
|
|
44
|
-
},
|
|
45
|
-
'name',
|
|
46
|
-
{
|
|
47
|
-
name: 'Firstname (right aligned)',
|
|
48
|
-
id: 'firstname',
|
|
49
|
-
textAlign: 'right',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: 'Job title',
|
|
53
|
-
id: 'job_title',
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: 'Username (center aligned, 400px width)',
|
|
57
|
-
id: 'username',
|
|
58
|
-
width: 400,
|
|
59
|
-
textAlign: 'center',
|
|
60
|
-
},
|
|
61
|
-
'email',
|
|
62
|
-
{
|
|
63
|
-
name: 'Address (300px width)',
|
|
64
|
-
id: 'address',
|
|
65
|
-
width: 300,
|
|
66
|
-
},
|
|
67
|
-
'zip code',
|
|
68
|
-
{
|
|
69
|
-
name: 'City',
|
|
70
|
-
id: 'city',
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
name: 'State',
|
|
74
|
-
id: 'state',
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: 'Country',
|
|
78
|
-
id: 'country',
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
name: 'Phone number',
|
|
82
|
-
id: 'phone_number',
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
caption: 'Table caption',
|
|
86
|
-
pagination: {
|
|
87
|
-
enabled: true,
|
|
88
|
-
limit: this.rowsPerPage,
|
|
89
|
-
},
|
|
90
|
-
rowsPerPage: 4,
|
|
91
|
-
numberOfColumns: 12,
|
|
92
|
-
rowData: '',
|
|
93
|
-
cellData: '',
|
|
94
|
-
isLoading: false,
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
computed: {
|
|
98
|
-
objectRows() {
|
|
99
|
-
return [
|
|
100
|
-
{
|
|
101
|
-
groupBy: 'January',
|
|
102
|
-
rows: [
|
|
103
|
-
{
|
|
104
|
-
line_number: '0',
|
|
105
|
-
firstname: 'Vincent',
|
|
106
|
-
job_title: 'software engineer',
|
|
107
|
-
username: 'pseudodeVincent',
|
|
108
|
-
address: '34 rue de la Solidarité',
|
|
109
|
-
state: 'Nevada',
|
|
110
|
-
},
|
|
111
|
-
[
|
|
112
|
-
'1',
|
|
113
|
-
'Ohayon',
|
|
114
|
-
'Alexis',
|
|
115
|
-
'CTO',
|
|
116
|
-
'aloha',
|
|
117
|
-
'alexis@citizenplane.com',
|
|
118
|
-
'23 rue de Cléry',
|
|
119
|
-
'75002',
|
|
120
|
-
'Paris',
|
|
121
|
-
'Ile de France',
|
|
122
|
-
'France',
|
|
123
|
-
'0101010110',
|
|
124
|
-
],
|
|
125
|
-
],
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
groupBy: 'February',
|
|
129
|
-
rows: [
|
|
130
|
-
{
|
|
131
|
-
line_number: '0',
|
|
132
|
-
firstname: 'Vincent',
|
|
133
|
-
job_title: 'software engineer',
|
|
134
|
-
username: 'pseudodeVincent',
|
|
135
|
-
address: '34 rue de la Solidarité',
|
|
136
|
-
state: 'Nevada',
|
|
137
|
-
},
|
|
138
|
-
[
|
|
139
|
-
'1',
|
|
140
|
-
'Ohayon',
|
|
141
|
-
'Alexis',
|
|
142
|
-
'CTO',
|
|
143
|
-
'aloha',
|
|
144
|
-
'alexis@citizenplane.com',
|
|
145
|
-
'23 rue de Cléry',
|
|
146
|
-
'75002',
|
|
147
|
-
'Paris',
|
|
148
|
-
'Ile de France',
|
|
149
|
-
'France',
|
|
150
|
-
'0101010110',
|
|
151
|
-
],
|
|
152
|
-
],
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
groupBy: 'March',
|
|
156
|
-
rows: [
|
|
157
|
-
{
|
|
158
|
-
line_number: '0',
|
|
159
|
-
firstname: 'Vincent',
|
|
160
|
-
job_title: 'software engineer',
|
|
161
|
-
username: 'pseudodeVincent',
|
|
162
|
-
address: '34 rue de la Solidarité',
|
|
163
|
-
state: 'Nevada',
|
|
164
|
-
},
|
|
165
|
-
[
|
|
166
|
-
'1',
|
|
167
|
-
'Ohayon',
|
|
168
|
-
'Alexis',
|
|
169
|
-
'CTO',
|
|
170
|
-
'aloha',
|
|
171
|
-
'alexis@citizenplane.com',
|
|
172
|
-
'23 rue de Cléry',
|
|
173
|
-
'75002',
|
|
174
|
-
'Paris',
|
|
175
|
-
'Ile de France',
|
|
176
|
-
'France',
|
|
177
|
-
'0101010110',
|
|
178
|
-
],
|
|
179
|
-
],
|
|
180
|
-
},
|
|
181
|
-
]
|
|
182
|
-
},
|
|
183
|
-
computedPagination() {
|
|
184
|
-
return {
|
|
185
|
-
enabled: true,
|
|
186
|
-
limit: Number(this.rowsPerPage),
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
computedColumns() {
|
|
190
|
-
return this.objectColumns.slice(0, this.numberOfColumns)
|
|
191
|
-
},
|
|
192
|
-
computedRows() {
|
|
193
|
-
return this.objectRows
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
methods: {
|
|
197
|
-
testAlert() {
|
|
198
|
-
this.$toaster.success({ title: 'Custom action on option row click' })
|
|
199
|
-
},
|
|
200
|
-
handleRightClick({ event }) {
|
|
201
|
-
// Prevent event default here to hide default contextual menu
|
|
202
|
-
// when right-click is not used, default menu is displayed
|
|
203
|
-
event.preventDefault()
|
|
204
|
-
|
|
205
|
-
document.addEventListener('click', this.documentClickHandler)
|
|
206
|
-
|
|
207
|
-
const viewportWidth = window.innerWidth
|
|
208
|
-
const mouseClickXPosition = event.clientX
|
|
209
|
-
const mouseClickYPosition = event.clientY
|
|
210
|
-
const isMenuDisplayable = mouseClickXPosition + 250 <= viewportWidth
|
|
211
|
-
const computedXPosition = isMenuDisplayable ? event.clientX : event.clientX - 250
|
|
212
|
-
|
|
213
|
-
// Set the position for menu
|
|
214
|
-
this.$refs.menu.style.top = `${mouseClickYPosition}px`
|
|
215
|
-
this.$refs.menu.style.left = `${computedXPosition}px`
|
|
216
|
-
|
|
217
|
-
// Show the menu
|
|
218
|
-
this.$refs.menu.classList.remove('hidden')
|
|
219
|
-
},
|
|
220
|
-
documentClickHandler(event) {
|
|
221
|
-
const isClickedInside = this.$refs?.menu.contains(event.target)
|
|
222
|
-
if (isClickedInside) return
|
|
223
|
-
|
|
224
|
-
// Hide the menu
|
|
225
|
-
this.$refs.menu.classList.add('hidden')
|
|
226
|
-
|
|
227
|
-
// Remove the event handler
|
|
228
|
-
document.removeEventListener('click', this.documentClickHandler)
|
|
229
|
-
},
|
|
230
|
-
},
|
|
231
|
-
}
|
|
232
|
-
</script>
|
|
233
|
-
|
|
234
|
-
<style lang="scss">
|
|
235
|
-
.sectionListAndTables {
|
|
236
|
-
&__alertMessage {
|
|
237
|
-
width: 100%;
|
|
238
|
-
|
|
239
|
-
> *:not(:last-of-type) {
|
|
240
|
-
margin-bottom: sp.$space;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
&__title {
|
|
245
|
-
margin-bottom: sp.$space-lg;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
&__menu {
|
|
249
|
-
position: absolute;
|
|
250
|
-
box-shadow:
|
|
251
|
-
0 9px 24px rgba(colors.$neutral-dark, 0.2),
|
|
252
|
-
0 4px 4px rgba(colors.$neutral-dark, 0.1);
|
|
253
|
-
border: fn.px-to-rem(1) solid colors.$neutral-dark-4;
|
|
254
|
-
border-radius: fn.px-to-rem(10);
|
|
255
|
-
background-color: colors.$neutral-light;
|
|
256
|
-
padding: sp.$space 0;
|
|
257
|
-
min-width: 250px;
|
|
258
|
-
|
|
259
|
-
li {
|
|
260
|
-
padding: sp.$space sp.$space-md;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.hidden {
|
|
265
|
-
display: none;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
</style>
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section-container section-title="Select menu">
|
|
3
|
-
<div class="item">
|
|
4
|
-
<h3>Simple select menu without filter</h3>
|
|
5
|
-
<span>selected value: {{ firstMenuSelectedValue }}</span>
|
|
6
|
-
<cp-select-menu
|
|
7
|
-
v-model:selected-value="firstMenuSelectedValue"
|
|
8
|
-
:values="firstMenuSelectMenuValues"
|
|
9
|
-
:selected-value="firstMenuSelectedValue"
|
|
10
|
-
/>
|
|
11
|
-
</div>
|
|
12
|
-
<div class="item">
|
|
13
|
-
<h3>Select menu with title and filter</h3>
|
|
14
|
-
<span>selected value: {{ secondMenuSelectedValue }}</span>
|
|
15
|
-
<cp-select-menu
|
|
16
|
-
v-model:selected-value="secondMenuSelectedValue"
|
|
17
|
-
:values="secondMenuFilteredList"
|
|
18
|
-
:selected-value="secondMenuSelectedValue"
|
|
19
|
-
:has-filter="true"
|
|
20
|
-
dropdown-title="Select value"
|
|
21
|
-
dropdown-filter-placeholder="Search value..."
|
|
22
|
-
dropdown-list-placeholder="No option found"
|
|
23
|
-
@on-filter-change="filterValues"
|
|
24
|
-
/>
|
|
25
|
-
</div>
|
|
26
|
-
</section-container>
|
|
27
|
-
</template>
|
|
28
|
-
|
|
29
|
-
<script>
|
|
30
|
-
import SectionContainer from '@/components/core/playground-sections/SectionContainer.vue'
|
|
31
|
-
|
|
32
|
-
export default {
|
|
33
|
-
components: {
|
|
34
|
-
SectionContainer,
|
|
35
|
-
},
|
|
36
|
-
data() {
|
|
37
|
-
return {
|
|
38
|
-
firstMenuSelectedValue: {
|
|
39
|
-
label: 'Banana',
|
|
40
|
-
value: 'first_value',
|
|
41
|
-
},
|
|
42
|
-
firstMenuSelectMenuValues: [
|
|
43
|
-
{
|
|
44
|
-
label: 'Banana',
|
|
45
|
-
value: 'first_value',
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
label: 'Kiwi',
|
|
49
|
-
value: 'second_value',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
label: 'Orange',
|
|
53
|
-
value: 'third_value',
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
label: 'Pineapple',
|
|
57
|
-
value: 'fourth_value',
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
secondMenuSelectedValue: {
|
|
61
|
-
label: 'Dog',
|
|
62
|
-
value: 'first_value',
|
|
63
|
-
},
|
|
64
|
-
secondMenuSelectMenuValues: [
|
|
65
|
-
{
|
|
66
|
-
label: 'Dog',
|
|
67
|
-
value: 'first_value',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
label: 'Cat',
|
|
71
|
-
value: 'second_value',
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
label: 'Snake',
|
|
75
|
-
value: 'third_value',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
label: 'Dragon',
|
|
79
|
-
value: 'fourth_value',
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
secondMenuFilterValue: '',
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
computed: {
|
|
86
|
-
secondMenuFilteredList() {
|
|
87
|
-
return this.secondMenuSelectMenuValues.filter((menuValue) => {
|
|
88
|
-
return menuValue.label.toLowerCase().includes(this.secondMenuFilterValue.toLowerCase())
|
|
89
|
-
})
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
methods: {
|
|
93
|
-
filterValues(inputValue) {
|
|
94
|
-
this.secondMenuFilterValue = inputValue
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
}
|
|
98
|
-
</script>
|