@policystudio/policy-studio-ui-vue 1.0.62 → 1.0.63

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.
@@ -0,0 +1,47 @@
1
+ name: Deploy Storybook
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+
7
+ permissions:
8
+ contents: read
9
+ pull-requests: write
10
+
11
+ jobs:
12
+ deploy:
13
+ runs-on: ubuntu-latest
14
+ timeout-minutes: 20
15
+ steps:
16
+ - name: Checkout code
17
+ uses: actions/checkout@v2
18
+
19
+ - name: Cache dependencies
20
+ uses: actions/cache@v2
21
+ with:
22
+ path: ~/.npm
23
+ key: npm-${{ hashFiles('package-lock.json') }}
24
+ restore-keys: npm-
25
+
26
+ - name: Setup Node.js
27
+ uses: actions/setup-node@v2
28
+ with:
29
+ node-version: ^14.0.0
30
+
31
+ - name: Install dependencies
32
+ run: npm install && npm install vercel@25.1.0 && npm install -g vercel@25.1.0
33
+
34
+ - name: Build storybook
35
+ run: npm run build-storybook && cp ./vercel.json storybook-static/
36
+
37
+ - name: Deploy Storybook into vercel
38
+ uses: amondnet/vercel-action@v25.1.0
39
+ with:
40
+ vercel-token: ${{ secrets.VERCEL_TOKEN }}
41
+ github-token: ${{ github.token }}
42
+ github-comment: false
43
+ vercel-org-id: ${{ secrets.VERCEL_TEAM_ID }}
44
+ vercel-project-id: ${{ secrets.VERCEL_STORYBOOK_PROJECT_ID }}
45
+ scope: ${{ secrets.VERCEL_TEAM_ID }}
46
+ working-directory: ./storybook-static
47
+ vercel-args: '--prod'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@policystudio/policy-studio-ui-vue",
3
- "version": "1.0.62",
3
+ "version": "1.0.63",
4
4
  "description": "Policy Studio UI",
5
5
  "main": "src/index.js",
6
6
  "author": "Policy Studio Team",
@@ -8,12 +8,12 @@
8
8
  :disabled="disabled"
9
9
  v-if="type != 'button'"
10
10
  :type="type"
11
- :id="label"
11
+ :id="getInputId"
12
12
  :checked="checked"
13
13
  />
14
14
  <label
15
15
  :disabled="disabled"
16
- :for="label"
16
+ :for="getInputId"
17
17
  :class="{'checked':checked && type === 'button'}"
18
18
  >
19
19
  <i v-if="icon" class="psui-el-chips-icon psui-el-chips-icon-prepend">{{ icon }}</i>
@@ -31,6 +31,7 @@
31
31
 
32
32
  <script>
33
33
  export const type = ['radio', 'checkbox', 'button']
34
+ import { randomString } from '../../util/GeneralFunctions'
34
35
 
35
36
  export default {
36
37
  name: 'PsChips',
@@ -87,6 +88,13 @@ export default {
87
88
  type: Boolean,
88
89
  default: false
89
90
  },
91
+ /**
92
+ * Add html attributes to the element input
93
+ */
94
+ inputAttrs: {
95
+ type: Object,
96
+ default: () => ({})
97
+ },
90
98
  },
91
99
  emits: ['click', 'change'],
92
100
  computed: {
@@ -97,6 +105,15 @@ export default {
97
105
  return 'status-resting'
98
106
  }
99
107
  },
108
+ getInputId() {
109
+ if (this?.inputAttrs?.id) {
110
+ return this.inputAttrs.id
111
+ } else if (this?.$attrs?.id) {
112
+ return this.$attrs.id
113
+ } else {
114
+ return randomString(16)
115
+ }
116
+ },
100
117
  },
101
118
  methods: {
102
119
  onClick() {
@@ -1,7 +1,6 @@
1
1
  <template>
2
2
  <div
3
3
  class='psui-el-checkbox'
4
- @click="$emit('click')"
5
4
  :class="[getComponentClass, {'disabled':disabled}]"
6
5
  v-bind="getComponentAttrs"
7
6
  >
@@ -12,7 +11,7 @@
12
11
  :name="label"
13
12
  :id="getInputId"
14
13
  v-bind="inputAttrs"
15
- @change="$emit('change')"
14
+ @change="$emit('change')"
16
15
  />
17
16
  <label
18
17
  :for="getInputId"
@@ -7,9 +7,10 @@
7
7
  :autocapitalize="autocapitalize"
8
8
  :aria-required="required"
9
9
  :value="value"
10
- @blur="onBlur"
11
- @focus="onFocus"
12
- @input="onInput"
10
+ @focus="onInputFocus"
11
+ @blur="onInputBlur"
12
+ @input="$emit('input', $event)"
13
+ @change="$emit('change', $event)"
13
14
  :rows="rows"
14
15
  :placeholder="placeholder"
15
16
  :readonly='disabled'
@@ -52,8 +53,8 @@ export default {
52
53
  * It sets aria-required property. eg: true or false.
53
54
  */
54
55
  required:{
55
- type: Boolean,
56
- default:true
56
+ type: Boolean,
57
+ default:true
57
58
  },
58
59
  /**
59
60
  * It sets the type of autocapitalize. See mdn web-doc for full information. default: sentences.
@@ -73,19 +74,18 @@ export default {
73
74
  * It disabled the textarea input. All mouse events are disabled.
74
75
  */
75
76
  disabled: {
76
- type: Boolean,
77
- default: false,
77
+ type: Boolean,
78
+ default: false,
78
79
  }
80
+ },
81
+ methods: {
82
+ onInputFocus($event) {
83
+ this.isFocus = true
84
+ this.$emit('focus', $event)
79
85
  },
80
- methods: {
81
- onBlur(){
82
- this.$emit('blur', this.$event)
83
- },
84
- onFocus(){
85
- this.$emit('focus',this.$event)
86
- },
87
- onInput(){
88
- this.$emit('input', this.$event)
86
+ onInputBlur($event) {
87
+ this.isFocus = false
88
+ this.$emit('blur', $event)
89
89
  }
90
90
  }
91
91
  }
package/vercel.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": 2,
3
+ "public": false,
4
+ "github": {
5
+ "enabled": false
6
+ },
7
+ "rewrites": [
8
+ { "source": "/(.*)", "destination": "/index.html" },
9
+ { "source": "/:path*", "destination": "/index.html" }
10
+ ]
11
+ }