@policystudio/policy-studio-ui-vue 1.0.31 → 1.0.32

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 CHANGED
@@ -15,41 +15,42 @@ module.exports = {
15
15
  'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
16
16
  'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
17
17
  'semi': ['warn', 'never'],
18
- "vue/order-in-components": ["warn", {
19
- "order": [
20
- "el",
21
- "name",
22
- "key",
23
- "parent",
24
- ["components", "directives", "filters"],
25
- ["props", "propsData"],
26
- "functional",
27
- ["delimiters", "comments"],
28
- "extends",
29
- "mixins",
30
- ["provide", "inject"],
31
- "ROUTER_GUARDS",
32
- "layout",
33
- "middleware",
34
- "validate",
35
- "scrollToTop",
36
- "transition",
37
- "loading",
38
- "inheritAttrs",
39
- "model",
40
- "emits",
41
- "setup",
42
- "asyncData",
43
- "data",
44
- "fetch",
45
- "head",
46
- "computed",
47
- "watch",
48
- "watchQuery",
49
- "LIFECYCLE_HOOKS",
50
- "methods",
51
- ["template", "render"],
52
- "renderError"
18
+ 'quotes': [2, 'single'],
19
+ 'vue/order-in-components': ['warn', {
20
+ 'order': [
21
+ 'el',
22
+ 'name',
23
+ 'key',
24
+ 'parent',
25
+ ['components', 'directives', 'filters'],
26
+ ['props', 'propsData'],
27
+ 'functional',
28
+ ['delimiters', 'comments'],
29
+ 'extends',
30
+ 'mixins',
31
+ ['provide', 'inject'],
32
+ 'ROUTER_GUARDS',
33
+ 'layout',
34
+ 'middleware',
35
+ 'validate',
36
+ 'scrollToTop',
37
+ 'transition',
38
+ 'loading',
39
+ 'inheritAttrs',
40
+ 'model',
41
+ 'emits',
42
+ 'setup',
43
+ 'asyncData',
44
+ 'data',
45
+ 'fetch',
46
+ 'head',
47
+ 'computed',
48
+ 'watch',
49
+ 'watchQuery',
50
+ 'LIFECYCLE_HOOKS',
51
+ 'methods',
52
+ ['template', 'render'],
53
+ 'renderError'
53
54
  ]
54
55
  }]
55
56
  },
package/babel.config.js CHANGED
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- presets: ["@vue/cli-plugin-babel/preset"],
2
+ presets: ['@vue/cli-plugin-babel/preset'],
3
3
  }
@@ -17618,7 +17618,6 @@ html {
17618
17618
  transition-duration: 300ms;
17619
17619
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
17620
17620
  transition-delay: 0.4s;
17621
- min-width: 256px;
17622
17621
  }
17623
17622
 
17624
17623
  .psui-el-tooltip .psui-el-tooltip-wrapper .psui-el-tooltip-dialog .psui-el-tooltip-content {
@@ -18189,6 +18188,8 @@ html {
18189
18188
  .psui-el-dropdown-menu-list {
18190
18189
  width: 100%;
18191
18190
  font-weight: 700;
18191
+ margin-top: 0.75rem;
18192
+ margin-bottom: 0.75rem;
18192
18193
  }
18193
18194
 
18194
18195
  .psui-el-dropdown-menu-list li {
@@ -18209,7 +18210,10 @@ html {
18209
18210
  .psui-el-dropdown-menu-list li:hover {
18210
18211
  --text-opacity: 1;
18211
18212
  color: #318FAC;
18212
- color: rgba(49, 143, 172, var(--text-opacity))
18213
+ color: rgba(49, 143, 172, var(--text-opacity));
18214
+ --bg-opacity: 1;
18215
+ background-color: #ECF7FB;
18216
+ background-color: rgba(236, 247, 251, var(--bg-opacity));
18213
18217
  }
18214
18218
 
18215
18219
  .psui-el-dropdown-menu-list li span {
@@ -18244,8 +18248,6 @@ html {
18244
18248
  .psui-el-dropdown-menu-dialog-wrapper {
18245
18249
  display: none;
18246
18250
  transform-origin: top right;
18247
- padding-top: 1rem;
18248
- padding-bottom: 1rem;
18249
18251
  background-color: #ffffff;
18250
18252
  position: fixed;
18251
18253
  width: auto;
@@ -18895,6 +18897,19 @@ html {
18895
18897
  border-bottom: 0;
18896
18898
  }
18897
18899
 
18900
+ .psui-el-table-rich thead th {
18901
+ padding: 15px 16px;
18902
+ }
18903
+
18904
+ .psui-el-table-rich tbody th,
18905
+ .psui-el-table-rich tbody td,
18906
+ .psui-el-table-rich tbody tr {
18907
+ padding: 7px 16px;
18908
+ --text-opacity: 1;
18909
+ color: #28323B;
18910
+ color: rgba(40, 50, 59, var(--text-opacity));
18911
+ }
18912
+
18898
18913
  .psui-el-highlight-ripple-icon {
18899
18914
  position: static;
18900
18915
  box-sizing: border-box;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@policystudio/policy-studio-ui-vue",
3
- "version": "1.0.31",
3
+ "version": "1.0.32",
4
4
  "description": "Policy Studio UI",
5
5
  "main": "src/index.js",
6
6
  "author": "Policy Studio Team",
@@ -17,6 +17,7 @@
17
17
  "build-temp-tailwind": "postcss src/assets/scss/base.scss -o temp/css/psui_styles.css",
18
18
  "publish": "npm run lint && npm run build-tailwind && build-storybook && npm publish",
19
19
  "serve": "concurrently --kill-others \"npm run watch-storybook\" \"npm run watch-tailwind\"",
20
+ "serve-prod": "concurrently --kill-others \"npm run watch-storybook\" \"npm run watch-prod-tailwind\"",
20
21
  "watch-storybook": "start-storybook -p 6006",
21
22
  "watch-prod-tailwind": "watch 'npm run build-tailwind' ./src/assets",
22
23
  "watch-tailwind": "watch 'npm run build-temp-tailwind' ./src/assets",
package/postcss.config.js CHANGED
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
2
  plugins: {
3
3
  'postcss-nested': {},
4
- "postcss-import": {},
4
+ 'postcss-import': {},
5
5
  tailwindcss: {},
6
6
  autoprefixer: {},
7
7
  },
@@ -45,6 +45,23 @@
45
45
  border-bottom: 0;
46
46
  }
47
47
  }
48
+
49
+ &-rich {
50
+ thead {
51
+ th {
52
+ padding: 15px 16px;
53
+ }
54
+ }
55
+
56
+ tbody {
57
+ th,
58
+ td,
59
+ tr {
60
+ padding: 7px 16px;
61
+ @apply .psui-text-gray-80;
62
+ }
63
+ }
64
+ }
48
65
  }
49
66
 
50
67
  }
@@ -1,7 +1,7 @@
1
1
  @layer components {
2
2
  .psui-el-dropdown-menu {
3
3
  @apply psui-relative psui-inline-block psui-text-left;
4
-
4
+
5
5
  button {
6
6
  @apply psui-inline-flex psui-justify-center psui-items-center psui-w-full psui-font-medium psui-leading-none;
7
7
  background-color: transparent;
@@ -9,6 +9,7 @@
9
9
  padding-bottom: 2.5px;
10
10
  min-height: 27px;
11
11
  font-size: 0.875rem;
12
+
12
13
 
13
14
  &:focus {
14
15
  outline: none;
@@ -17,10 +18,11 @@
17
18
  }
18
19
 
19
20
  &-dialog-wrapper {
20
- @apply psui-hidden psui-origin-top-right psui-py-4 psui-bg-white psui-fixed psui-w-auto psui-rounded-md psui-z-50 psui-opacity-0 psui-shadow-elevation-20 psui-transition-all psui-duration-100 psui-ease-in;
21
-
21
+ @apply psui-hidden psui-origin-top-right psui-bg-white psui-fixed psui-w-auto psui-rounded-md psui-z-50 psui-opacity-0 psui-shadow-elevation-20 psui-transition-all psui-duration-100 psui-ease-in;
22
+
22
23
  &-dialog {
23
- @apply w-full;
24
+ @apply psui-w-full;
25
+
24
26
  }
25
27
  }
26
28
  }
@@ -1,6 +1,6 @@
1
1
  @layer components {
2
2
  .psui-el-dropdown-menu-list {
3
- @apply psui-w-full psui-font-bold;
3
+ @apply psui-w-full psui-font-bold psui-my-3;
4
4
 
5
5
  li {
6
6
  @apply psui-w-full psui-text-gray-60 psui-text-small psui-list-none psui-flex psui-flex-col psui-cursor-pointer;
@@ -8,7 +8,7 @@
8
8
  font-weight: 700;
9
9
 
10
10
  &:hover {
11
- @apply psui-text-blue-60
11
+ @apply psui-text-blue-60 psui-bg-blue-10;
12
12
  }
13
13
 
14
14
  span {
@@ -7,7 +7,6 @@
7
7
  .psui-el-tooltip-dialog {
8
8
  @apply psui-fixed psui-opacity-0 psui-transition-opacity psui-duration-300 psui-ease-in-out;
9
9
  transition-delay: 0.4s;
10
- min-width: 256px;
11
10
 
12
11
  .psui-el-tooltip-content {
13
12
  @apply psui-flex psui-flex-col psui-bg-gray-50 psui-text-white;
@@ -21,7 +21,7 @@
21
21
  <script>
22
22
  import { getParentVueComponentByName } from '../../util/GeneralFunctions'
23
23
  export default {
24
- name: "PsAccordionItem",
24
+ name: 'PsAccordionItem',
25
25
  props: {
26
26
  /**
27
27
  * It sets the title of the accordion item.
@@ -31,17 +31,17 @@
31
31
  </template>
32
32
 
33
33
  <script>
34
- export const type = ["radio", "checkbox", "button"]
34
+ export const type = ['radio', 'checkbox', 'button']
35
35
 
36
36
  export default {
37
- name: "PsChips",
37
+ name: 'PsChips',
38
38
  props: {
39
39
  /**
40
40
  * It sets the label of the chips button.
41
41
  */
42
42
  label: {
43
43
  type: String,
44
- default: "",
44
+ default: '',
45
45
  },
46
46
  /**
47
47
  * It sets the type of the chips button. eg: radio, checkbox, button.
@@ -50,7 +50,7 @@ export default {
50
50
  type: String,
51
51
  required: true,
52
52
  default: 'button',
53
- validator: (type) => ["radio", "checkbox", "button"].includes(type)
53
+ validator: (type) => ['radio', 'checkbox', 'button'].includes(type)
54
54
  },
55
55
  /**
56
56
  * It sets the layout of the chipsbutton. eg: simple, with-icon, rich.
@@ -65,7 +65,7 @@ export default {
65
65
  */
66
66
  icon: {
67
67
  type: String,
68
- default: "",
68
+ default: '',
69
69
  },
70
70
  /**
71
71
  * It sets if the button was checked or not checked.
@@ -89,7 +89,7 @@ export default {
89
89
  default: false
90
90
  },
91
91
  },
92
- emits: ["click", "change"],
92
+ emits: ['click', 'change'],
93
93
  data() {
94
94
  return {
95
95
  isChecked: false,
@@ -107,7 +107,7 @@ export default {
107
107
  let cssClass = ''
108
108
 
109
109
  if (this.checked === true ) {
110
- cssClass = "psui-text-blue-50 psui-bg-blue-20"
110
+ cssClass = 'psui-text-blue-50 psui-bg-blue-20'
111
111
  }
112
112
 
113
113
  return cssClass
@@ -116,15 +116,15 @@ export default {
116
116
  methods: {
117
117
  onClick() {
118
118
  this.isChecked = !this.isChecked
119
- this.$emit("click")
119
+ this.$emit('click')
120
120
  },
121
121
  onChange(event) {
122
122
  this.isChecked = event.target.checked
123
123
  this.$emit('update:checked', event.target.checked)
124
- this.$emit("change", event)
124
+ this.$emit('change', event)
125
125
  },
126
126
  onClose() {
127
- this.$emit("close")
127
+ this.$emit('close')
128
128
  },
129
129
  },
130
130
  }
@@ -57,7 +57,9 @@ export default {
57
57
  */
58
58
  data: {
59
59
  type: Array,
60
- required: true
60
+ default() {
61
+ return []
62
+ }
61
63
  },
62
64
  /**
63
65
  * It sets the values which will be use to render the footer.
@@ -36,7 +36,7 @@
36
36
 
37
37
  <script>
38
38
  export default {
39
- name: "PsDataTableItem",
39
+ name: 'PsDataTableItem',
40
40
  props: {
41
41
  data: {
42
42
  type: Array,
@@ -1,31 +1,33 @@
1
1
  <template>
2
- <div
3
- class="psui-el-dropdown-menu"
4
- ref="PSDropdown"
5
- v-click-outside="close"
6
- >
7
-
8
- <div ref="PSDropdownTrigger" v-if="$slots.dropdownTrigger" @click="show && !toggleWhenActive ? '' : toggle()">
2
+ <div class="psui-el-dropdown-menu" ref="PSDropdown" v-click-outside="close">
3
+ <div
4
+ ref="PSDropdownTrigger"
5
+ v-if="$slots.dropdownTrigger"
6
+ @click="show && !toggleWhenActive ? '' : toggle()"
7
+ >
9
8
  <slot name="dropdownTrigger"></slot>
10
9
  </div>
11
10
 
12
11
  <button
13
12
  v-else
14
- @click="show && !toggleWhenActive ? '' : toggle()"
15
- type="button"
13
+ @click="show && !toggleWhenActive ? '' : toggle()"
14
+ type="button"
16
15
  :id="id"
17
- aria-haspopup="true"
16
+ aria-haspopup="true"
18
17
  aria-expanded="true"
19
18
  ref="PSDropdownTrigger"
20
19
  >
21
- <slot v-if="show && $slots.buttonLabelOnShow" name="buttonLabelOnShow"></slot>
20
+ <slot
21
+ v-if="show && $slots.buttonLabelOnShow"
22
+ name="buttonLabelOnShow"
23
+ ></slot>
22
24
  <slot v-else name="buttonLabel"></slot>
23
25
  </button>
24
- <div
26
+ <div
25
27
  ref="PSDropdownDialog"
26
- role="menu"
27
- class="psui-el-dropdown-menu-dialog-wrapper psui-duration-300"
28
- aria-orientation="vertical"
28
+ role="menu"
29
+ class="psui-el-dropdown-menu-dialog-wrapper psui-duration-300"
30
+ aria-orientation="vertical"
29
31
  :aria-labelledby="id"
30
32
  :style="{ minWidth: minWidthDropDown }"
31
33
  >
@@ -39,7 +41,10 @@
39
41
  <script>
40
42
  // Figma - 2.3 Dropdown with category divider https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=1768%3A64886
41
43
 
42
- import { randomString, getParentScrollableEl } from '../../util/GeneralFunctions'
44
+ import {
45
+ randomString,
46
+ getParentScrollableEl,
47
+ } from '../../util/GeneralFunctions'
43
48
 
44
49
  export default {
45
50
  name: 'PsDropdown',
@@ -49,21 +54,21 @@ export default {
49
54
  */
50
55
  minWidthDropDown: {
51
56
  type: String,
52
- default: '340px'
57
+ default: '240px',
53
58
  },
54
59
  /**
55
60
  * It's a boolean responsible for showing a slot within the html tag button.
56
61
  */
57
62
  buttonLabelOnShow: {
58
63
  type: Boolean,
59
- default: false
64
+ default: false,
60
65
  },
61
66
  /**
62
67
  * It's a property responsible for toggling the dropdown menu. default: true.
63
68
  */
64
69
  toggleWhenActive: {
65
70
  type: Boolean,
66
- default: true
71
+ default: true,
67
72
  },
68
73
  },
69
74
  data() {
@@ -71,14 +76,14 @@ export default {
71
76
  show: false,
72
77
  id: randomString(8),
73
78
  marginLeft: '-0px',
74
- scrollableParentEl : null
79
+ scrollableParentEl: null,
75
80
  }
76
81
  },
77
82
  computed: {
78
83
  getMaxWidth() {
79
84
  let bounds = this.$refs.PSDropdown.getBoundingClientRect()
80
- return (document.documentElement.clientWidth - bounds['left']) -30
81
- }
85
+ return document.documentElement.clientWidth - bounds['left'] - 30
86
+ },
82
87
  },
83
88
  beforeDestroy() {
84
89
  this.unwatchParentScrolling()
@@ -99,36 +104,41 @@ export default {
99
104
  },
100
105
  unwatchParentScrolling() {
101
106
  if (this.scrollableParentEl) {
102
- this.scrollableParentEl.removeEventListener('scroll', this.updatePosition)
107
+ this.scrollableParentEl.removeEventListener(
108
+ 'scroll',
109
+ this.updatePosition
110
+ )
103
111
  }
104
112
  },
105
113
  updatePosition() {
106
-
107
114
  const PSDropdownDialog = this.$refs.PSDropdownDialog
108
115
  const PSDropdownTrigger = this.$refs.PSDropdownTrigger
109
- if (!PSDropdownDialog || !PSDropdownTrigger) return
116
+ if (!PSDropdownDialog || !PSDropdownTrigger) return
110
117
 
111
118
  const rectTrigger = PSDropdownTrigger.getBoundingClientRect()
112
119
  const rectDialog = PSDropdownDialog.getBoundingClientRect()
113
120
  const windowWidth = document.documentElement.clientWidth
114
121
 
115
122
  PSDropdownDialog.style.position = 'fixed'
116
- PSDropdownDialog.style.top = `${rectTrigger.y + rectTrigger.height }px`
117
-
118
- if (( rectTrigger.x + rectDialog.width + 20 ) > windowWidth ) {
119
- PSDropdownDialog.style.left = `${windowWidth - rectDialog.width - 30}px`
120
- } else {
123
+ PSDropdownDialog.style.top = `${rectTrigger.y + rectTrigger.height}px`
124
+
125
+ if (rectTrigger.x + rectDialog.width + 20 > windowWidth) {
126
+ PSDropdownDialog.style.left = `${
127
+ windowWidth - rectDialog.width - 30
128
+ }px`
129
+ } else {
121
130
  PSDropdownDialog.style.left = `${rectTrigger.x}px`
122
131
  }
123
132
 
124
- if(rectTrigger.top < 10) {
133
+ if (rectTrigger.top < 10) {
125
134
  this.close()
126
135
  console.warn('The dropdown are too close from the top of the page')
127
136
  return
128
137
  }
129
138
 
130
- setTimeout(() => { PSDropdownDialog.style.opacity = 1 }, 10)
131
-
139
+ setTimeout(() => {
140
+ PSDropdownDialog.style.opacity = 1
141
+ }, 10)
132
142
  },
133
143
  open() {
134
144
  this.$emit('open')
@@ -138,9 +148,9 @@ export default {
138
148
  setTimeout(() => {
139
149
  this.updatePosition()
140
150
  this.watchParentScrolling()
141
- document.addEventListener("keyup", this.handleEsc)
142
- window.addEventListener("resize", this.updatePosition)
143
- window.addEventListener("click", this.clickOutside)
151
+ document.addEventListener('keyup', this.handleEsc)
152
+ window.addEventListener('resize', this.updatePosition)
153
+ window.addEventListener('click', this.clickOutside)
144
154
  }, 10)
145
155
  },
146
156
  close() {
@@ -151,20 +161,24 @@ export default {
151
161
  this.show = false
152
162
  this.unwatchParentScrolling()
153
163
  }
154
- document.removeEventListener("keyup", this.handleEsc)
155
- document.removeEventListener("resize", this.updatePosition)
156
- document.removeEventListener("click", this.clickOutside)
164
+ document.removeEventListener('keyup', this.handleEsc)
165
+ document.removeEventListener('resize', this.updatePosition)
166
+ document.removeEventListener('click', this.clickOutside)
157
167
  },
158
168
  handleEsc(evt) {
159
169
  if (this.show && evt.keyCode === 27) this.close()
160
170
  },
161
171
  clickOutside(event) {
162
- if(!this.show) return
163
- if (!(this.$refs.PSDropdown == event.target || this.$refs.PSDropdown.contains(event.target))) {
172
+ if (!this.show) return
173
+ if (
174
+ !(
175
+ this.$refs.PSDropdown == event.target ||
176
+ this.$refs.PSDropdown.contains(event.target)
177
+ )
178
+ ) {
164
179
  this.close()
165
180
  }
166
- }
167
- }
181
+ },
182
+ },
168
183
  }
169
184
  </script>
170
-
@@ -79,4 +79,4 @@ export default {
79
79
  },
80
80
  }
81
81
  }
82
- </script>
82
+ </script>
@@ -21,7 +21,7 @@
21
21
 
22
22
  <script>
23
23
  export default {
24
- name: "PsInputTextArea",
24
+ name: 'PsInputTextArea',
25
25
  props: {
26
26
  /**
27
27
  * It sets the placeholder of the textarea input.
@@ -1,13 +1,52 @@
1
1
  <template>
2
- <div>
3
- Playground
2
+ <div
3
+ class="psui-flex psui-flex-col psui-h-56 psui-w-2/6 psui-overflow-y-scroll"
4
+ :style="getComponentClass"
5
+ >
6
+ <h2 class="psui-font-bold ">Scrollbar Playground</h2>
7
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
8
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
9
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
10
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
11
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
12
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
13
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
14
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
15
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
16
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
17
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
18
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
19
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
20
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
21
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
22
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
23
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
24
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
25
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
26
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
27
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
28
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
29
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
30
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
31
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
4
32
  </div>
5
33
  </template>
6
34
 
7
35
  <script>
8
36
  export default {
9
37
  name: 'PsScrollBar',
38
+ props:{
39
+ thumbColor:{
40
+ type: String,
41
+ }
42
+ },
43
+ computed:{
44
+ getComponentClass(){
45
+ return `scrollbarColor: ${this.thumbColor}`
46
+ }
47
+ }
10
48
  }
49
+
11
50
  </script>
12
51
 
13
52
  <style>
@@ -7,18 +7,26 @@
7
7
 
8
8
  <template v-for="item in getItems">
9
9
  <slot v-bind:item="item" >
10
+ <PsRichTooltip v-if="item.tooltip" :title="item.tooltip" layout="blue">
11
+ <template v-slot:trigger>
12
+ <button
13
+ :key="item[keyValue]"
14
+ type="button"
15
+ @click="selectTab(item)"
16
+ :class="getButtonClass(item)"
17
+ >
18
+ <span>{{ item[keyLabel] }}</span>
19
+ </button>
20
+ </template>
21
+ </PsRichTooltip>
10
22
  <button
23
+ v-else
11
24
  :key="item[keyValue]"
12
25
  type="button"
13
26
  @click="selectTab(item)"
14
27
  :class="getButtonClass(item)"
15
28
  >
16
- <PsRichTooltip v-if="item.tooltip" :title="item.tooltip" layout="blue">
17
- <template v-slot:trigger>
18
29
  <span>{{ item[keyLabel] }}</span>
19
- </template>
20
- </PsRichTooltip>
21
- <span v-else>{{ item[keyLabel] }}</span>
22
30
  </button>
23
31
  </slot>
24
32
  </template>
@@ -35,7 +35,7 @@
35
35
  <script>
36
36
 
37
37
  export default {
38
- name: "PsDialogTooltip",
38
+ name: 'PsDialogTooltip',
39
39
  props: {
40
40
  /**
41
41
  * It sets the title of the tooltip if needed.
@@ -54,8 +54,8 @@ export default {
54
54
  */
55
55
  layout: {
56
56
  type: String,
57
- default: "white",
58
- validator: (value) => ["white", "dark", "color"].includes(value),
57
+ default: 'white',
58
+ validator: (value) => ['white', 'dark', 'color'].includes(value),
59
59
  },
60
60
  /**
61
61
  * It sets a additional styling if needed.
@@ -66,7 +66,7 @@ export default {
66
66
  },
67
67
  },
68
68
  inheritAttrs: true,
69
- emits: ["show", 'click'],
69
+ emits: ['show', 'click'],
70
70
  data() {
71
71
  return {
72
72
  show: false,
@@ -79,18 +79,18 @@ export default {
79
79
  }
80
80
  },
81
81
  mounted() {
82
- document.addEventListener("resize", this.updatePosition)
82
+ document.addEventListener('resize', this.updatePosition)
83
83
  },
84
84
  beforeDestroy() {
85
- document.removeEventListener("resize", this.updatePosition)
85
+ document.removeEventListener('resize', this.updatePosition)
86
86
  },
87
87
  methods: {
88
88
  open() {
89
89
  if (this.show || this.ignoreDialog) return
90
- this.$emit("show")
90
+ this.$emit('show')
91
91
  this.show = true
92
92
 
93
- this.$refs.dialog.style.display = "block"
93
+ this.$refs.dialog.style.display = 'block'
94
94
  this.$refs.dialog.style.opacity = 0
95
95
 
96
96
  setTimeout(() => {
@@ -99,10 +99,10 @@ export default {
99
99
  },
100
100
  close() {
101
101
  if (this.show && this.$refs.dialog) {
102
- this.$emit("close")
102
+ this.$emit('close')
103
103
  this.show = false
104
104
 
105
- this.$refs.dialog.style.display = "none"
105
+ this.$refs.dialog.style.display = 'none'
106
106
  }
107
107
  },
108
108
  updatePosition() {
@@ -129,7 +129,7 @@ export default {
129
129
  }, 100)
130
130
  },
131
131
  onClick() {
132
- this.$emit("click", this.$event)
132
+ this.$emit('click', this.$event)
133
133
  },
134
134
  },
135
135
  }
@@ -10,10 +10,10 @@
10
10
  </template>
11
11
 
12
12
  <script>
13
- import PsTooltip from "../tooltip/PsTooltip.vue"
13
+ import PsTooltip from '../tooltip/PsTooltip.vue'
14
14
 
15
15
  export default {
16
- name: "PsRichTooltip",
16
+ name: 'PsRichTooltip',
17
17
  components: { PsTooltip },
18
18
  props: {
19
19
  /**
@@ -21,19 +21,19 @@ export default {
21
21
  */
22
22
  title: {
23
23
  type: String,
24
- default: "",
24
+ default: '',
25
25
  },
26
26
  /**
27
27
  * It sets the layout of the tooltip. eg: gray, red and blue.
28
28
  */
29
29
  layout: {
30
30
  type: String,
31
- default: "gray",
32
- validator: (type) => ["gray", "red", "blue"].includes(type),
31
+ default: 'gray',
32
+ validator: (type) => ['gray', 'red', 'blue'].includes(type),
33
33
  },
34
34
  cssClass: {
35
35
  type: String,
36
- default: "",
36
+ default: '',
37
37
  },
38
38
  },
39
39
  }
@@ -28,7 +28,7 @@
28
28
 
29
29
  <script>
30
30
  export default {
31
- name: "PsTooltip",
31
+ name: 'PsTooltip',
32
32
  props: {
33
33
  /**
34
34
  * It sets the title of the tooltip if needed.
@@ -57,7 +57,7 @@ export default {
57
57
  }
58
58
  },
59
59
  inheritAttrs: true,
60
- emits: ["show"],
60
+ emits: ['show'],
61
61
  data() {
62
62
  return {
63
63
  show: false,
@@ -70,18 +70,18 @@ export default {
70
70
  }
71
71
  },
72
72
  mounted() {
73
- document.addEventListener("resize", this.updatePosition)
73
+ document.addEventListener('resize', this.updatePosition)
74
74
  },
75
75
  beforeDestroy() {
76
- document.removeEventListener("resize", this.updatePosition)
76
+ document.removeEventListener('resize', this.updatePosition)
77
77
  },
78
78
  methods: {
79
79
  open() {
80
80
  if (this.show || this.ignoreDialog) return
81
- this.$emit("show")
81
+ this.$emit('show')
82
82
  this.show = true
83
83
 
84
- this.$refs.dialog.style.display = "block"
84
+ this.$refs.dialog.style.display = 'block'
85
85
  this.$refs.dialog.style.opacity = 0
86
86
 
87
87
  setTimeout(() => {
@@ -90,10 +90,10 @@ export default {
90
90
  },
91
91
  close() {
92
92
  if (this.show && this.$refs.dialog) {
93
- this.$emit("close")
93
+ this.$emit('close')
94
94
  this.show = false
95
95
 
96
- this.$refs.dialog.style.display = "none"
96
+ this.$refs.dialog.style.display = 'none'
97
97
  }
98
98
  },
99
99
  updatePosition() {
@@ -1,4 +1,4 @@
1
- import PsChips from "../components/chips/PsChips.vue"
1
+ import PsChips from '../components/chips/PsChips.vue'
2
2
 
3
3
  export default {
4
4
  title: 'Components/Chips',
@@ -26,7 +26,7 @@ const Template = (args, { argTypes }) => ({
26
26
  export const Simple = Template.bind({})
27
27
  Simple.args = {
28
28
  label: 'Simple Chip',
29
- icon:"",
29
+ icon:'',
30
30
  }
31
31
 
32
32
  export const SimpleWithIcon = Template.bind({})
@@ -1,55 +1,99 @@
1
1
  import PsDropdown from '../components/forms/PsDropdown.vue'
2
2
  import PsDropdownList from '../components/forms/PsDropdownList.vue'
3
3
  export default {
4
- title: 'Components/Dropdown',
5
- component: { PsDropdown , PsDropdownList },
4
+ title: 'Components/Dropdown',
5
+ component: { PsDropdown, PsDropdownList },
6
6
  }
7
7
 
8
8
  const Template = (args, { argTypes }) => ({
9
9
  props: Object.keys(argTypes),
10
10
  components: { PsDropdown, PsDropdownList },
11
11
  template: `
12
- <div style='background: #E6ECF2; width:900px; height: 700px; padding: 20px;' class='psui-flex psui-gap-64 psui-bg-gray-20 '>
12
+ <div style='background: #E6ECF2; width:1200px; height: 700px; padding: 20px;' class='psui-flex psui-gap-64 psui-bg-gray-20 '>
13
13
  <PsDropdown>
14
- <template v-slot:dropdownTrigger>
14
+ <template #dropdownTrigger>
15
15
  <i class='psui-icon psui-text-gray-50 psui-cursor-pointer psui-h-2'>more_horiz</i>
16
16
  </template>
17
- <template v-slot:items>
18
- <p class='psui-uppercase psui-text-gray-40' style='padding: 24px 20px 8px 20px;'>divider label</p>
17
+ <template #items>
18
+ <div class='psui-pb-5'>
19
+ <p class='psui-uppercase psui-text-gray-40 psui-text-accentSmall' style='padding: 24px 20px 8px 20px;'>divider label</p>
20
+
19
21
  <ul>
20
- <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i class='psui-icon'>public</i><span>Selectable option 01</span></li>
21
- <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i class='psui-icon'>share</i><span>Selectable option 02</span></li>
22
- <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i class='psui-icon'>person</i><span>Selectable option 03</span></li>
23
- <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i class='psui-icon'>settings</i><span>Selectable option 04</span></li>
24
- <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i class='psui-icon'>save</i><span>Selectable option 05</span></li>
25
- <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i class='psui-icon'>equalizer</i><span>Selectable option 06</span></li>
22
+ <li style='padding: 7px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 01</li>
23
+ <li style='padding: 7px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 02</li>
24
+ <li style='padding: 7px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 03</li>
25
+
26
+ <p class='psui-uppercase psui-text-gray-40 psui-text-accentSmall' style='padding: 24px 24px 8px 24px;'>divider label</p>
27
+
28
+ <li style='padding: 7px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 04</li>
29
+ <li style='padding: 7px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 05</li>
30
+ <li style='padding: 7px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 06</li>
26
31
  </ul>
27
- <p class='psui-uppercase psui-text-gray-40' style='padding: 24px 20px 8px 20px;'>divider label</p>
28
- <ul>
29
- <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 01</li>
30
- <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 02</li>
31
- <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 03</li>
32
- <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 04</li>
33
- <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 05</li>
34
- <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 06</li>
35
- </ul>
36
-
32
+ </div>
37
33
  </template>
38
34
  </PsDropdown>
35
+
39
36
  <PsDropdown>
40
- <template v-slot:dropdownTrigger>
41
- <i class='psui-icon psui-text-gray-50 psui-cursor-pointer psui-h-auto'>more_horiz</i>
37
+ <template #dropdownTrigger>
38
+ <i class='psui-icon psui-text-gray-50 psui-cursor-pointer psui-h-2'>more_horiz</i>
39
+ </template>
40
+ <template #items>
41
+ <div class='psui-pb-5'>
42
+ <p class='psui-uppercase psui-text-gray-40 psui-text-accentSmall' style='padding: 24px 24px 8px 24px;'>divider label</p>
43
+
44
+ <ul>
45
+ <li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>public</i><span>Selectable option 01</span></li>
46
+ <li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>share</i><span>Selectable option 02</span></li>
47
+ <li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>person</i><span>Selectable option 03</span></li>
48
+
49
+ <p class='psui-uppercase psui-text-gray-40 psui-text-accentSmall' style='padding: 24px 24px 8px 24px;'>divider label</p>
50
+
51
+ <li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>settings</i><span>Selectable option 04</span></li>
52
+ <li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>save</i><span>Selectable option 05</span></li>
53
+ <li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>equalizer</i><span>Selectable option 06</span></li>
54
+ </ul>
55
+ </div>
56
+ </template>
57
+ </PsDropdown>
58
+
59
+ <PsDropdown>
60
+ <template #dropdownTrigger>
61
+ <i class='psui-icon psui-text-gray-50 psui-cursor-pointer psui-h-auto'>more_horiz</i>
42
62
  </template>
43
- <template v-slot:items>
63
+ <template #items>
44
64
  <PsDropdownList v-bind='$props'></PsDropdownList>
45
- </template>
65
+ </template>
46
66
  </PsDropdown>
67
+
68
+ <PsDropdown>
69
+ <template #dropdownTrigger>
70
+ <i class='psui-icon psui-text-gray-50 psui-cursor-pointer psui-h-auto'>more_horiz</i>
71
+ </template>
72
+ <template #items>
73
+ <div class='psui-my-3'>
74
+ <ul>
75
+ <li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>public</i><span>Selectable option 01</span></li>
76
+ <li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>share</i><span>Selectable option 02</span></li>
77
+ <li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>person</i><span>Selectable option 03</span></li>
78
+ <li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>settings</i><span>Selectable option 04</span></li>
79
+ <li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>save</i><span>Selectable option 05</span></li>
80
+ <li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>equalizer</i><span>Selectable option 06</span></li>
81
+ </ul>
82
+ </div>
83
+ </template>
84
+ </PsDropdown>
47
85
  </div>
48
86
  `,
49
87
  })
50
88
 
51
-
52
- export const DropdownMenu= Template.bind({})
89
+ export const DropdownMenu = Template.bind({})
53
90
  DropdownMenu.args = {
54
- items: ["Selectable option 01", "Selectable option 02", "Selectable option 03", "Selectable option 04"]
91
+ items: [
92
+ 'Selectable option 01',
93
+ 'Selectable option 02',
94
+ 'Selectable option 03',
95
+ 'Selectable option 04',
96
+ 'Selectable option 05',
97
+ 'Selectable option 06',
98
+ ],
55
99
  }
@@ -1,4 +1,4 @@
1
- import PsInlineSelector from "../components/controls/PsInlineSelector.vue"
1
+ import PsInlineSelector from '../components/controls/PsInlineSelector.vue'
2
2
 
3
3
  export default {
4
4
  title: 'Components/InlineSelector',
@@ -9,7 +9,7 @@ const Template = (args, {argTypes}) => ({
9
9
  props: Object.keys(argTypes),
10
10
  components: { PsScrollBar},
11
11
  template: `
12
- <PsScrollBar v-bind='$props'></PsScrollbar>
12
+ <PsScrollBar v-bind='$props' thumbColor="blue"></PsScrollbar>
13
13
  `
14
14
  })
15
15
 
@@ -19,7 +19,7 @@ export default ({ imageUrl, onProgress = null, returnsBase64 = true }) => {
19
19
  }
20
20
 
21
21
  xhr.onloadend = () => {
22
- const contentType = xhr.getResponseHeader("Content-Type")
22
+ const contentType = xhr.getResponseHeader('Content-Type')
23
23
  if (!contentType.includes('image')) {
24
24
  reject(xhr)
25
25
  } else {