@policystudio/policy-studio-ui-vue 1.0.18 → 1.0.22
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 +67 -0
- package/.storybook/main.js +11 -2
- package/.storybook/preview.js +1 -1
- package/README.md +8 -0
- package/babel.config.js +3 -0
- package/backup-package-lock.json +37194 -0
- package/{src/assets/scss/tailwind.css → dist/css/psui_styles.css} +16720 -17120
- package/package.json +32 -19
- package/postcss.config.js +2 -0
- package/src/assets/images/check-checkbox-button.svg +1 -0
- package/src/assets/images/radio-checked-button.svg +1 -0
- package/src/assets/scss/base.scss +6 -5
- package/src/assets/scss/components/PsInput.scss +89 -0
- package/src/components/accordion/PsAccordion.vue +40 -0
- package/src/components/accordion/PsAccordionItem.vue +102 -0
- package/src/components/badges-and-tags/PsChartLegend.vue +128 -0
- package/src/components/badges-and-tags/PsClimateZoneBadge.vue +18 -0
- package/src/components/badges-and-tags/PsCostEffectBar.vue +114 -0
- package/src/components/badges-and-tags/PsHighlightRippleDot.vue +78 -0
- package/src/components/badges-and-tags/PsMiniTag.vue +46 -0
- package/src/components/badges-and-tags/PsProgressBar.vue +0 -0
- package/src/components/buttons/PsButton.vue +36 -13
- package/src/components/chips/PsChips.vue +154 -0
- package/src/components/controls/PsCheckbox.vue +30 -17
- package/src/components/controls/PsDraggable.vue +174 -3
- package/src/components/controls/PsRadioButton.vue +67 -60
- package/src/components/controls/PsSlider.vue +13 -12
- package/src/components/controls/PsSwitch.vue +76 -76
- package/src/components/datatable/PsDataTable.vue +89 -0
- package/src/components/datatable/PsDataTableItem.vue +57 -0
- package/src/components/forms/PsDropdown.vue +196 -0
- package/src/components/forms/PsInput.vue +122 -99
- package/src/components/notifications/PsDialog.vue +37 -18
- package/src/components/tabs/PsTabHeader.vue +20 -21
- package/src/components/tooltip/PsDialogTooltip.vue +79 -0
- package/src/components/tooltip/PsRichTooltip.vue +44 -0
- package/src/components/tooltip/PsTooltip.vue +118 -0
- package/src/components/ui/PsIcon.vue +128 -0
- package/src/index.js +53 -24
- package/src/stories/Accordion.stories.js +41 -0
- package/src/stories/Button.stories.js +11 -11
- package/src/stories/ChartLegend.stories.js +16 -0
- package/src/stories/Checkbox.stories.js +21 -14
- package/src/stories/Chips.stories.js +55 -0
- package/src/stories/ClimateZoneBadge.stories.js +24 -0
- package/src/stories/Colors.stories.mdx +35 -35
- package/src/stories/CostEffectBar.stories.js +23 -0
- package/src/stories/Datatable.stories.js +50 -0
- package/src/stories/Dialog.stories.js +150 -17
- package/src/stories/Draggable.stories.js +22 -0
- package/src/stories/Dropdown.stories.js +32 -0
- package/src/stories/HighlightRippleDot.stories.js +16 -0
- package/src/stories/Input.stories.js +46 -15
- package/src/stories/MiniTag.stories.js +46 -0
- package/src/stories/ProgressBar.stories.js +23 -0
- package/src/stories/RadioButton.stories.js +25 -9
- package/src/stories/Slider.stories.js +9 -9
- package/src/stories/Swith.stories.js +10 -10
- package/src/stories/TabHeader.stories.js +9 -9
- package/src/stories/Toast.stories.js +13 -13
- package/src/stories/Toggle.stories.js +12 -13
- package/src/stories/Tooltip.stories.js +114 -0
- package/src/util/GeneralFunctions.js +22 -0
- package/src/util/imageLoader.js +50 -0
- package/tailwind.config.js +82 -45
- package/src/assets/scss/tailwind.scss +0 -61088
package/package.json
CHANGED
|
@@ -1,36 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@policystudio/policy-studio-ui-vue",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"description": "Policy Studio UI",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "Policy Studio Team",
|
|
7
7
|
"url": "https://bitbucket.org/policy-studio/policy-studio-ui-vue",
|
|
8
|
-
"
|
|
9
|
-
"storybook": "start-storybook -p 6006",
|
|
10
|
-
"build-storybook": "build-storybook",
|
|
11
|
-
"build:tailwind": "postcss src/assets/scss/base.scss -o src/assets/scss/tailwind.css",
|
|
12
|
-
"publish": "npm run build:tailwind && npm publish"
|
|
13
|
-
},
|
|
8
|
+
"license": "MIT",
|
|
14
9
|
"keywords": [
|
|
15
10
|
"vue",
|
|
16
11
|
"ui"
|
|
17
12
|
],
|
|
18
|
-
"
|
|
13
|
+
"scripts": {
|
|
14
|
+
"lint": "vue-cli-service lint",
|
|
15
|
+
"storybook": "start-storybook -p 6006",
|
|
16
|
+
"build-storybook": "build-storybook",
|
|
17
|
+
"build-tailwind": "postcss src/assets/scss/base.scss -o dist/css/psui_styles.css",
|
|
18
|
+
"publish": "npm run lint && npm run build-tailwind && npm publish"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"core-js": "^3.6.5",
|
|
22
|
+
"vue": "^2.6.11"
|
|
23
|
+
},
|
|
19
24
|
"devDependencies": {
|
|
20
|
-
"@babel/core": "^7.16.
|
|
21
|
-
"@storybook/addon-actions": "^6.
|
|
22
|
-
"@storybook/addon-essentials": "^6.
|
|
23
|
-
"@storybook/addon-links": "^6.
|
|
24
|
-
"@storybook/
|
|
25
|
-
"
|
|
25
|
+
"@babel/core": "^7.16.7",
|
|
26
|
+
"@storybook/addon-actions": "^6.4.13",
|
|
27
|
+
"@storybook/addon-essentials": "^6.4.13",
|
|
28
|
+
"@storybook/addon-links": "^6.4.13",
|
|
29
|
+
"@storybook/addon-postcss": "^2.0.0",
|
|
30
|
+
"@storybook/vue": "^6.4.13",
|
|
31
|
+
"@vue/cli-plugin-babel": "~4.5.0",
|
|
32
|
+
"@vue/cli-plugin-eslint": "~4.5.0",
|
|
33
|
+
"@vue/cli-service": "~4.5.0",
|
|
34
|
+
"@vue/eslint-config-prettier": "^6.0.0",
|
|
35
|
+
"babel-eslint": "^10.1.0",
|
|
26
36
|
"babel-loader": "^8.2.3",
|
|
37
|
+
"eslint": "^6.7.2",
|
|
38
|
+
"eslint-plugin-prettier": "^3.3.1",
|
|
39
|
+
"eslint-plugin-vue": "^6.2.2",
|
|
27
40
|
"postcss": "^8.3.11",
|
|
28
41
|
"postcss-cli": "^9.0.2",
|
|
42
|
+
"postcss-import": "^14.0.2",
|
|
43
|
+
"postcss-nested": "^5.0.6",
|
|
44
|
+
"prettier": "^2.2.1",
|
|
29
45
|
"tailwindcss": "^1.9.6",
|
|
30
|
-
"vue": "^2.6.14",
|
|
31
46
|
"vue-loader": "^15.9.8",
|
|
32
|
-
"vue-
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
"dependencies": {}
|
|
47
|
+
"vue-template-compiler": "^2.6.11"
|
|
48
|
+
}
|
|
36
49
|
}
|
package/postcss.config.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 24 24" width="16px" fill="#ffffff"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#64b5ce"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"/><circle cx="12" cy="12" r="5"/></svg>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
3
|
-
@
|
|
4
|
-
@import
|
|
1
|
+
@import url('https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Round');
|
|
2
|
+
@import './components/PsInput.scss';
|
|
3
|
+
@import "tailwindcss/base";
|
|
4
|
+
@import "tailwindcss/components";
|
|
5
|
+
@import "tailwindcss/utilities";
|
|
5
6
|
|
|
6
7
|
*:focus {
|
|
7
8
|
outline: none;
|
|
@@ -9,4 +10,4 @@
|
|
|
9
10
|
html {
|
|
10
11
|
-webkit-font-smoothing: antialiased;
|
|
11
12
|
-moz-osx-font-smoothing: grayscale;
|
|
12
|
-
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
@layer components{
|
|
2
|
+
|
|
3
|
+
.psui-el-input {
|
|
4
|
+
|
|
5
|
+
input {
|
|
6
|
+
@apply psui-w-full psui-border psui-border-gray-30 psui-rounded-md psui-block
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&-prepend {
|
|
10
|
+
@apply psui-absolute psui-inset-y-0 psui-left-0 psui-pl-2 psui-flex psui-items-center psui-pointer-events-none
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&-append {
|
|
14
|
+
@apply psui-absolute psui-inset-y-0 psui-right-0 psui-pr-2 psui-flex psui-items-center
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&-hint {
|
|
18
|
+
@apply psui-text-gray-50 psui-text-xsmall
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&-wrapper {
|
|
22
|
+
@apply psui-relative;
|
|
23
|
+
&.hover input {
|
|
24
|
+
@apply psui-border-blue-50
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
label {
|
|
29
|
+
@apply psui-font-bold psui-text-gray-80
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
input {
|
|
33
|
+
@apply psui-bg-white psui-text-gray-60
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/* Layout Default */
|
|
38
|
+
/* ----------------------------------------- */
|
|
39
|
+
|
|
40
|
+
&.layout-default {
|
|
41
|
+
|
|
42
|
+
input {
|
|
43
|
+
@apply psui-text-p;
|
|
44
|
+
padding: 11.5px 16px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&.status-active {
|
|
48
|
+
input {
|
|
49
|
+
@apply psui-border-blue-60
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&.status-error {
|
|
54
|
+
input {
|
|
55
|
+
@apply psui-border-red-20
|
|
56
|
+
}
|
|
57
|
+
&-hint {
|
|
58
|
+
@apply psui-text-red-20
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&.status-disabled {
|
|
63
|
+
|
|
64
|
+
input {
|
|
65
|
+
@apply psui-bg-gray-20 psui-border-gray-20 psui-text-gray-40
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
label {
|
|
69
|
+
@apply psui-text-gray-40
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/* ----------------------------------------- Layout Default */
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
/* Layout Mini */
|
|
78
|
+
/* ----------------------------------------- */
|
|
79
|
+
&.layout-mini {
|
|
80
|
+
input {
|
|
81
|
+
@apply psui-text-small;
|
|
82
|
+
padding: 7px 8px;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/* ----------------------------------------- Layout Mini */
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="classes" class="accordion">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export const sizes = ['big', 'medium']
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name: 'PsAccordion',
|
|
12
|
+
props: {
|
|
13
|
+
size: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'medium',
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
computed: {
|
|
20
|
+
classes() {
|
|
21
|
+
if (this.size === 'big') return 'big'
|
|
22
|
+
return 'medium'
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
27
|
+
<style scoped>
|
|
28
|
+
.medium {
|
|
29
|
+
width: 390px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.big {
|
|
33
|
+
width: 580px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.accordion {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container">
|
|
3
|
+
<div
|
|
4
|
+
@click="toggleTitle"
|
|
5
|
+
:class="cssClass"
|
|
6
|
+
class="
|
|
7
|
+
psui-flex psui-cursor-pointer psui-transition-all psui-justify-between
|
|
8
|
+
"
|
|
9
|
+
>
|
|
10
|
+
<div
|
|
11
|
+
v-if="title"
|
|
12
|
+
:class="display ? 'selected' : ''"
|
|
13
|
+
class="psui-font-bold psui-gray04"
|
|
14
|
+
>
|
|
15
|
+
{{ title }}
|
|
16
|
+
</div>
|
|
17
|
+
<i v-if="!display" class="material-icons">{{ iconClass.closed }}</i>
|
|
18
|
+
<i v-else :class="display ? 'selected' : ''" class="material-icons">{{
|
|
19
|
+
iconClass.open
|
|
20
|
+
}}</i>
|
|
21
|
+
</div>
|
|
22
|
+
<div v-if="display" class="psui-transition-all psui-duration-300">
|
|
23
|
+
<slot></slot>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
export const iconTypes = ["mathsign", "chevron"]
|
|
30
|
+
export const fontCss = ["medium", "big"]
|
|
31
|
+
|
|
32
|
+
export default {
|
|
33
|
+
name: "PsAccordionItem",
|
|
34
|
+
props: {
|
|
35
|
+
title: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: true,
|
|
38
|
+
},
|
|
39
|
+
iconType: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: "chevron",
|
|
42
|
+
},
|
|
43
|
+
fontCss: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "medium",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
data() {
|
|
49
|
+
return {
|
|
50
|
+
display: false,
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
computed: {
|
|
54
|
+
iconClass() {
|
|
55
|
+
if (this.iconType === "chevron") {
|
|
56
|
+
return { closed: "expand_more", open: "expand_less" }
|
|
57
|
+
} else if (this.iconType === "mathsign") {
|
|
58
|
+
return { closed: "add", open: "remove" }
|
|
59
|
+
}
|
|
60
|
+
return ''
|
|
61
|
+
},
|
|
62
|
+
cssClass() {
|
|
63
|
+
if (this.fontCss === "big") return "big"
|
|
64
|
+
return "medium"
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
methods: {
|
|
68
|
+
toggleTitle() {
|
|
69
|
+
this.display = !this.display
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
}
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<style scoped>
|
|
76
|
+
.container {
|
|
77
|
+
border-bottom: 1px solid #e6ecf2;
|
|
78
|
+
padding-top: 16px;
|
|
79
|
+
padding-bottom: 16px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
span {
|
|
83
|
+
font-weight: 700;
|
|
84
|
+
color: #e6ecf2;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.selected {
|
|
88
|
+
color: #318fac;
|
|
89
|
+
transition: color 300ms;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.big {
|
|
93
|
+
font-size: 18px;
|
|
94
|
+
line-height: 130%;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.medium {
|
|
98
|
+
font-size: 16px;
|
|
99
|
+
line-height: 130%;
|
|
100
|
+
}
|
|
101
|
+
</style>
|
|
102
|
+
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="toView psui-flex psui-flex-row psui-p-8 psui-rounded">
|
|
3
|
+
<div class="container psui-p-2 psui-rounded">
|
|
4
|
+
<div class="psui-flex">
|
|
5
|
+
<div class="dot"></div>
|
|
6
|
+
<div class="text">{{ text }}</div>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="container1">
|
|
9
|
+
<span v-if="this.value" :class="isValue">{{ value }}</span>
|
|
10
|
+
<span :class="isBar"></span>
|
|
11
|
+
<span :class="isPercentage">{{ percentage }}</span>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
export default {
|
|
19
|
+
props: {
|
|
20
|
+
text: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: 'Climate Zone 10',
|
|
23
|
+
},
|
|
24
|
+
value: {
|
|
25
|
+
type: Number,
|
|
26
|
+
// required: true,
|
|
27
|
+
default: null,
|
|
28
|
+
},
|
|
29
|
+
percentage: {
|
|
30
|
+
type: String,
|
|
31
|
+
// required: true,
|
|
32
|
+
default: '',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
computed: {
|
|
36
|
+
isValue() {
|
|
37
|
+
if (this.value) {
|
|
38
|
+
return 'value'
|
|
39
|
+
} else {
|
|
40
|
+
return 'hide'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
isPercentage() {
|
|
44
|
+
if (this.percentage) {
|
|
45
|
+
return 'percentage'
|
|
46
|
+
} else {
|
|
47
|
+
return 'hide'
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
isBar() {
|
|
51
|
+
if (this.value !== 0 && this.percentage !== '') {
|
|
52
|
+
return 'bar'
|
|
53
|
+
} else {
|
|
54
|
+
return 'hide'
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
}
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<style scoped>
|
|
62
|
+
.toView {
|
|
63
|
+
/* display: flex; */
|
|
64
|
+
/* flex-direction: row; */
|
|
65
|
+
/* padding: 32px; */
|
|
66
|
+
|
|
67
|
+
width: 351px;
|
|
68
|
+
height: 119px;
|
|
69
|
+
|
|
70
|
+
background: #f3ebfa;
|
|
71
|
+
border: 1.5px dashed #7b61ff;
|
|
72
|
+
/* border-radius: 5px; */
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.container {
|
|
76
|
+
/* padding: 8px; */
|
|
77
|
+
|
|
78
|
+
width: fit-content;
|
|
79
|
+
height: fit-content;
|
|
80
|
+
|
|
81
|
+
background: #ffffff;
|
|
82
|
+
/* border-radius: 4px; */
|
|
83
|
+
|
|
84
|
+
/* margin: 0px 32px; */
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.hide {
|
|
88
|
+
display: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.dot {
|
|
92
|
+
width: 14px;
|
|
93
|
+
height: 14px;
|
|
94
|
+
background: #43cec2;
|
|
95
|
+
border-radius: 8px;
|
|
96
|
+
margin: 0px 6px 0px 0px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.text {
|
|
100
|
+
font-weight: bold;
|
|
101
|
+
font-size: 12px;
|
|
102
|
+
line-height: 120%;
|
|
103
|
+
|
|
104
|
+
color: #798490;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.container1 {
|
|
108
|
+
margin: 0px 0px 0px 20px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.value {
|
|
112
|
+
color: #28323b;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.percentage {
|
|
116
|
+
color: #798490;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.bar {
|
|
120
|
+
background-color: #d6dde5;
|
|
121
|
+
height: 14px;
|
|
122
|
+
|
|
123
|
+
border-radius: 2px;
|
|
124
|
+
|
|
125
|
+
padding: 0px 1px;
|
|
126
|
+
margin-right: 3px;
|
|
127
|
+
}
|
|
128
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
class="psui-flex psui-p-3 psui-bg-gray-10 psui-text-gray-50 hover:psui-text-blue-60 hover:psui-bg-blue-20 psui-transition-all psui-duration-300 psui-ease-out psui-shadow-lg psui-rounded"
|
|
4
|
+
>
|
|
5
|
+
<i v-if="icon" class="material-icons psui-text-base"> {{ icon }} </i>
|
|
6
|
+
<p class="psui-text-sm">10</p>
|
|
7
|
+
</button>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
export default {
|
|
12
|
+
props: {
|
|
13
|
+
icon: {
|
|
14
|
+
type: String,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="container">
|
|
4
|
+
<div
|
|
5
|
+
class="loading-bar"
|
|
6
|
+
:class="{
|
|
7
|
+
'psui-bg-blue-20': value >= breakEven,
|
|
8
|
+
'psui-bg-red-10': value < breakEven,
|
|
9
|
+
}"
|
|
10
|
+
>
|
|
11
|
+
<span class="breakEven" :style="breakEvenPosition"> </span>
|
|
12
|
+
|
|
13
|
+
<input
|
|
14
|
+
type="number"
|
|
15
|
+
min="0"
|
|
16
|
+
max="100"
|
|
17
|
+
class="percentage"
|
|
18
|
+
:style="{ width: `${value}px` }"
|
|
19
|
+
:class="{
|
|
20
|
+
'psui-bg-blue-60': value >= breakEven,
|
|
21
|
+
'psui-bg-red-20': value < breakEven,
|
|
22
|
+
}"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
export default {
|
|
31
|
+
props: {
|
|
32
|
+
value: {
|
|
33
|
+
type: Number,
|
|
34
|
+
required: true,
|
|
35
|
+
default: 0,
|
|
36
|
+
},
|
|
37
|
+
breakEven: {
|
|
38
|
+
type: Number,
|
|
39
|
+
required: true,
|
|
40
|
+
default: 1,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
data() {
|
|
44
|
+
return {
|
|
45
|
+
errors: [],
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
computed: {
|
|
50
|
+
valueBar() {
|
|
51
|
+
if (this.value > 100) return 100
|
|
52
|
+
else if (this.value < 0) return 0
|
|
53
|
+
else return this.value
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
breakEvenPosition() {
|
|
57
|
+
return `left: ${this.breakEven}px`
|
|
58
|
+
},
|
|
59
|
+
getIsBreakEven() {
|
|
60
|
+
if (this.breakEven < 0) return 0
|
|
61
|
+
else if (this.breakEven > 100) return 100
|
|
62
|
+
else return this.breakEven
|
|
63
|
+
// else return true;
|
|
64
|
+
// return this.value > this.breakEven ? true : false;
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
}
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<style scoped>
|
|
71
|
+
.container {
|
|
72
|
+
overflow: visible;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.loading-bar {
|
|
76
|
+
position: relative;
|
|
77
|
+
width: 100px;
|
|
78
|
+
height: 8px;
|
|
79
|
+
border-radius: 15px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.loading-bar .percentage {
|
|
83
|
+
position: absolute;
|
|
84
|
+
display: block;
|
|
85
|
+
max-width: 100px;
|
|
86
|
+
height: 100%;
|
|
87
|
+
border-radius: 15px;
|
|
88
|
+
overflow: visible;
|
|
89
|
+
background-size: 30px 30px;
|
|
90
|
+
animation: animate-stripes 3s linear infinite;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.breakEven {
|
|
94
|
+
position: absolute;
|
|
95
|
+
background-color: #d6dde5;
|
|
96
|
+
width: 2px;
|
|
97
|
+
height: 14px;
|
|
98
|
+
/* max-width: 100px; */
|
|
99
|
+
border-radius: 2px;
|
|
100
|
+
top: -3px;
|
|
101
|
+
z-index: 1;
|
|
102
|
+
/* left: 2px; */
|
|
103
|
+
/* right: -2px; */
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@keyframes animate-stripes {
|
|
107
|
+
0% {
|
|
108
|
+
background-position: 0 0;
|
|
109
|
+
}
|
|
110
|
+
100% {
|
|
111
|
+
background-position: 60px 0;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
</style>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="example">
|
|
3
|
+
<div class="dot"></div>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<style scoped>
|
|
12
|
+
.example {
|
|
13
|
+
position: static;
|
|
14
|
+
/* margin: 0px 32px; */
|
|
15
|
+
/* width: 275px;
|
|
16
|
+
height: 229px; */
|
|
17
|
+
/* left: 0px;
|
|
18
|
+
top: 0px; */
|
|
19
|
+
/* border: 1.5px dashed #9b51e0; */
|
|
20
|
+
/* background: #f3f6f9; */
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
}
|
|
23
|
+
.dot {
|
|
24
|
+
background: #5db883;
|
|
25
|
+
/* border: solid 1px #2bb24c; */
|
|
26
|
+
border-radius: 50%;
|
|
27
|
+
/* box-shadow: 0px 0 2px #2bb24c; */
|
|
28
|
+
width: 8px;
|
|
29
|
+
height: 8px;
|
|
30
|
+
/* left: 6px;
|
|
31
|
+
top: 6px; */
|
|
32
|
+
margin: 100px auto;
|
|
33
|
+
position: relative;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.dot::before,
|
|
37
|
+
.dot::after {
|
|
38
|
+
background: #def8e8;
|
|
39
|
+
border: solid 0px #2bb24c;
|
|
40
|
+
border-radius: 50%;
|
|
41
|
+
content: '';
|
|
42
|
+
width: 36px;
|
|
43
|
+
height: 36px;
|
|
44
|
+
left: -8px;
|
|
45
|
+
top: -8px;
|
|
46
|
+
position: absolute;
|
|
47
|
+
transform-origin: center center;
|
|
48
|
+
transform: scale(1) translate(-1px, -1px);
|
|
49
|
+
}
|
|
50
|
+
.dot::before {
|
|
51
|
+
animation: ripple 1s infinite;
|
|
52
|
+
}
|
|
53
|
+
.dot::after {
|
|
54
|
+
animation: ripple 1s infinite;
|
|
55
|
+
/* animation-delay: 0.4s; */
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@keyframes ripple {
|
|
59
|
+
0% {
|
|
60
|
+
/* transform: scale(1) translate(-1px, -1px);
|
|
61
|
+
opacity: 0.75; */
|
|
62
|
+
left: 5px;
|
|
63
|
+
top: 5px;
|
|
64
|
+
opacity: 0.95;
|
|
65
|
+
width: 0;
|
|
66
|
+
height: 0;
|
|
67
|
+
}
|
|
68
|
+
100% {
|
|
69
|
+
/* transform: scale(2) translate(-1px, -1px);
|
|
70
|
+
opacity: 0; */
|
|
71
|
+
left: -13px;
|
|
72
|
+
top: -13px;
|
|
73
|
+
opacity: 0;
|
|
74
|
+
width: 36px;
|
|
75
|
+
height: 36px;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
</style>
|