@policystudio/policy-studio-ui-vue 1.1.29 → 1.1.31

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.
@@ -1118,10 +1118,11 @@ video {
1118
1118
 
1119
1119
  .psui-el-accordion-item-header-wrapper {
1120
1120
  display: flex;
1121
+ align-items: flex-start;
1122
+ justify-content: space-between;
1121
1123
  width: 100%;
1122
1124
  cursor: pointer;
1123
1125
  transition-property: all;
1124
- justify-content: space-between;
1125
1126
  transition: cubic-bezier(.17,.67,.83,.67) 250ms;
1126
1127
  --text-opacity: 1;
1127
1128
  color: #28323B;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@policystudio/policy-studio-ui-vue",
3
- "version": "1.1.29",
3
+ "version": "1.1.31",
4
4
  "description": "Policy Studio UI",
5
5
  "main": "src/index.js",
6
6
  "author": "Policy Studio Team",
@@ -20,7 +20,7 @@
20
20
  padding-bottom: 16px;
21
21
 
22
22
  &-wrapper {
23
- @apply psui-flex psui-w-full psui-cursor-pointer psui-transition-all psui-justify-between transition-default psui-text-gray-80;
23
+ @apply psui-flex psui-items-start psui-justify-between psui-w-full psui-cursor-pointer psui-transition-all transition-default psui-text-gray-80;
24
24
 
25
25
  &:hover {
26
26
  .psui-el-accordion-item-icon {
@@ -1,29 +1,28 @@
1
1
  @layer components {
2
- .psui-el-dropdown-menu {
3
- @apply psui-relative psui-inline-block psui-text-left;
4
-
5
- button {
6
- @apply psui-inline-flex psui-justify-center psui-items-center psui-w-full psui-font-medium psui-leading-none;
7
- background-color: transparent;
8
- padding-top: 2.5px;
9
- padding-bottom: 2.5px;
10
- min-height: 27px;
11
- font-size: 0.875rem;
12
-
2
+ .psui-el-dropdown-menu {
3
+ @apply psui-relative psui-inline-block psui-text-left;
4
+
5
+ button {
6
+ @apply psui-inline-flex psui-justify-center psui-items-center psui-w-full psui-font-medium psui-leading-none;
7
+ background-color: transparent;
8
+ padding-top: 2.5px;
9
+ padding-bottom: 2.5px;
10
+ min-height: 27px;
11
+ font-size: 0.875rem;
12
+
13
13
 
14
- &:focus {
15
- outline: none;
16
- box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
17
- }
18
- }
19
-
20
- &-dialog-wrapper {
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
-
23
- &-dialog {
24
- @apply psui-w-full;
14
+ &:focus {
15
+ outline: none;
16
+ box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
17
+ }
18
+ }
25
19
 
26
- }
27
- }
20
+ &-dialog-wrapper {
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
+
23
+ &-dialog {
24
+ @apply psui-w-full;
25
+ }
28
26
  }
27
+ }
29
28
  }
@@ -1,14 +1,14 @@
1
1
  <template>
2
2
  <div class='psui-el-checkbox' :class="[getComponentClass, {'disabled':disabled}]" >
3
3
  <input
4
- :id="label"
4
+ :id="getInputId"
5
5
  type="checkbox"
6
6
  :value="inputValue"
7
7
  v-model="model"
8
8
  :disabled="disabled"
9
9
  />
10
10
  <label
11
- :for="label"
11
+ :for="getInputId"
12
12
  class="psui-el-checkmark"
13
13
  :class="[labelClasses, 'psui-el-checkmark']"
14
14
  >
@@ -19,6 +19,7 @@
19
19
 
20
20
  <script>
21
21
  //FIGMA CONTROLS & SELECTORS https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=1768%3A64852
22
+ import { randomString } from '../../util/GeneralFunctions'
22
23
 
23
24
  export default {
24
25
  name: 'PsCheckbox',
@@ -74,6 +75,15 @@ export default {
74
75
  getComponentClass(){
75
76
  return `size-${this.size} layout-${this.layout}`
76
77
  },
78
+ getInputId() {
79
+ if (this?.inputAttrs?.id) {
80
+ return this.inputAttrs.id
81
+ } else if (this?.$attrs?.id) {
82
+ return this.$attrs.id
83
+ } else {
84
+ return randomString(16)
85
+ }
86
+ },
77
87
  model: {
78
88
  get(){
79
89
  return this.value
@@ -1,9 +1,35 @@
1
1
  <template>
2
2
  <div
3
+ v-if="withPrevent"
3
4
  class='psui-el-checkbox'
4
5
  :class="[getComponentClass, {'disabled':disabled}]"
5
6
  v-bind="getComponentAttrs"
7
+ @click.prevent="$emit('click', $event)"
8
+ >
9
+ <input
10
+ type="checkbox"
11
+ :checked="checked"
12
+ :disabled="disabled"
13
+ :name="label"
14
+ :id="getInputId"
15
+ v-bind="inputAttrs"
16
+ @change="$emit('change', $event)"
17
+ />
18
+ <label
19
+ :for="getInputId"
20
+ class="psui-el-checkmark"
6
21
  >
22
+ <slot name="content">
23
+ <span>{{ label }}</span>
24
+ </slot>
25
+ </label>
26
+ </div>
27
+ <div
28
+ v-else
29
+ class='psui-el-checkbox'
30
+ :class="[getComponentClass, {'disabled':disabled}]"
31
+ v-bind="getComponentAttrs"
32
+ >
7
33
  <input
8
34
  type="checkbox"
9
35
  :checked="checked"
@@ -11,7 +37,7 @@
11
37
  :name="label"
12
38
  :id="getInputId"
13
39
  v-bind="inputAttrs"
14
- @change="$emit('change')"
40
+ @change="$emit('change', $event)"
15
41
  />
16
42
  <label
17
43
  :for="getInputId"
@@ -40,6 +66,11 @@ export default {
40
66
  /**
41
67
  * It disables the checkbox input.
42
68
  */
69
+ withPrevent: {
70
+ type: Boolean,
71
+ default: false,
72
+ },
73
+
43
74
  disabled: {
44
75
  type: Boolean,
45
76
  default: false,