classcard-ui 0.2.195 → 0.2.199

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "classcard-ui",
3
- "version": "0.2.195",
3
+ "version": "0.2.199",
4
4
  "main": "dist/classcard-ui.common.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -82,7 +82,7 @@ export default {
82
82
  console.log("show name", name);
83
83
  this.activeTab = name;
84
84
  var el = document.getElementById(name);
85
- el.scrollIntoView();
85
+ el.scrollIntoView({ behavior: "smooth" });
86
86
  },
87
87
  switchTabForMobile(index) {
88
88
  var selectedOption = this.tabs[index];
@@ -6,7 +6,7 @@
6
6
  type="checkbox"
7
7
  v-model="checkedValue"
8
8
  class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded cursor-pointer disabled:opacity-50"
9
- @change="onChange"
9
+ @click="changeValue"
10
10
  :disabled="isDisabled"
11
11
  />
12
12
  </div>
@@ -32,25 +32,20 @@ export default {
32
32
  },
33
33
  data() {
34
34
  return {
35
- checkedValue: this.value,
35
+ checkedValue: this.value == 0 ? false : true,
36
36
  };
37
37
  },
38
38
  methods: {
39
- onChange() {
40
- if (this.checkedValue == 1) {
41
- this.checkedValue = 0;
42
- } else if (this.checkedValue == 0) {
43
- this.checkedValue = 1;
44
- }
45
- this.$emit("onChange", this.checkedValue);
46
- },
47
39
  changeValue() {
48
- if (this.checkedValue == 1) {
49
- this.checkedValue = 0;
50
- } else if (this.checkedValue == 0) {
51
- this.checkedValue = 1;
40
+ let selectedValue = 0;
41
+ if (this.checkedValue) {
42
+ this.checkedValue = false;
43
+ selectedValue = 0;
44
+ } else if (!this.checkedValue ) {
45
+ this.checkedValue = true;
46
+ selectedValue = 1;
52
47
  }
53
- this.$emit("onChange", this.checkedValue);
48
+ this.$emit("onChange", selectedValue);
54
49
  },
55
50
  },
56
51
  watch: {
@@ -20,7 +20,7 @@
20
20
  </svg>
21
21
  <svg
22
22
  v-if="name !== 'loader' && type == 'solid'"
23
- :class="classes"
23
+ :class= "classes"
24
24
  class="cursor-pointer"
25
25
  :viewBox="viewBox"
26
26
  fill="currentColor"
@@ -11,10 +11,7 @@
11
11
  </div>
12
12
  <span v-if="hint" class="text-sm text-gray-500">{{ hint }}</span>
13
13
  </div>
14
- <div
15
- v-if="!inlineAddon && addonType == 'leading'"
16
- class="relative mt-1 flex rounded-md"
17
- >
14
+ <div v-if="!inlineAddon && addonType == 'leading'" class="relative mt-1 flex rounded-md">
18
15
  <span
19
16
  :class="disabled ? 'opacity-50' : ''"
20
17
  class="inline-flex items-center px-3 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500 sm:text-sm"
@@ -25,6 +22,7 @@
25
22
  :type="inputType"
26
23
  :value="inputValue"
27
24
  @input="$emit('input', $event.target.value)"
25
+ @blur="$emit('blur', $event.target.value)"
28
26
  :class="errorClasses"
29
27
  class="focus:ring-indigo-500 focus:border-indigo-500 flex-1 block w-full px-3 py-2 rounded-r-md sm:text-sm disabled:opacity-50"
30
28
  :placeholder="placeholder"
@@ -37,14 +35,12 @@
37
35
  <c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
38
36
  </div>
39
37
  </div>
40
- <div
41
- v-if="!inlineAddon && addonType == 'trailing'"
42
- class="relative mt-1 flex rounded-md"
43
- >
38
+ <div v-if="!inlineAddon && addonType == 'trailing'" class="relative mt-1 flex rounded-md">
44
39
  <input
45
40
  :type="inputType"
46
41
  :value="inputValue"
47
42
  @input="$emit('input', $event.target.value)"
43
+ @blur="$emit('blur', $event.target.value)"
48
44
  :class="errorClasses"
49
45
  class="focus:ring-indigo-500 focus:border-indigo-500 flex-1 block w-full px-3 py-2 rounded-l-md sm:text-sm disabled:opacity-50"
50
46
  :placeholder="placeholder"
@@ -63,22 +59,18 @@
63
59
  {{ addon }}
64
60
  </span>
65
61
  </div>
66
- <div
67
- v-if="inlineAddon && addonType == 'trailing'"
68
- class="relative mt-1 flex rounded-md"
69
- >
62
+ <div v-if="inlineAddon && addonType == 'trailing'" class="relative mt-1 flex rounded-md">
70
63
  <input
71
64
  :type="inputType"
72
65
  :value="inputValue"
73
66
  @input="$emit('input', $event.target.value)"
67
+ @blur="$emit('blur', $event.target.value)"
74
68
  :class="errorClasses"
75
69
  class="focus:ring-indigo-500 focus:border-indigo-500 flex-1 block w-full px-3 py-2 rounded-md sm:text-sm disabled:opacity-50"
76
70
  :placeholder="placeholder"
77
71
  :disabled="disabled"
78
72
  />
79
- <div
80
- class="absolute inset-y-0 right-3 flex items-center pointer-events-none"
81
- >
73
+ <div class="absolute inset-y-0 right-3 flex items-center pointer-events-none">
82
74
  <span
83
75
  v-if="isValidate"
84
76
  class="text-gray-500 sm:text-sm"
@@ -94,19 +86,15 @@
94
86
  <c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
95
87
  </div>
96
88
  </div>
97
- <div
98
- v-if="inlineAddon && addonType == 'leading'"
99
- class="relative mt-1 flex rounded-md"
100
- >
101
- <div
102
- class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"
103
- >
89
+ <div v-if="inlineAddon && addonType == 'leading'" class="relative mt-1 flex rounded-md">
90
+ <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
104
91
  <span class="text-gray-500 sm:text-sm">{{ addon }}</span>
105
92
  </div>
106
93
  <input
107
94
  :type="inputType"
108
95
  :value="inputValue"
109
96
  @input="$emit('input', $event.target.value)"
97
+ @blur="$emit('blur', $event.target.value)"
110
98
  :class="errorClasses"
111
99
  :style="`padding-left:${leftPaddingStyle}`"
112
100
  class="focus:ring-indigo-500 focus:border-indigo-500 block w-full rounded-md sm:text-sm disabled:opacity-50"
@@ -123,10 +111,7 @@
123
111
  <p v-if="!isValidate" class="mt-2 text-sm text-red-600">
124
112
  {{ errorMessage }}
125
113
  </p>
126
- <p
127
- v-if="helpText && isValidate == true"
128
- :class="`mt-2 text-sm ${helpTextColorStyles}`"
129
- >
114
+ <p v-if="helpText && isValidate == true" :class="`mt-2 text-sm ${helpTextColorStyles}`">
130
115
  {{ helpText }}
131
116
  </p>
132
117
  </div>
@@ -209,6 +194,7 @@ export default {
209
194
  inputValue: this.value,
210
195
  };
211
196
  },
197
+ methods: {},
212
198
  watch: {
213
199
  value() {
214
200
  this.inputValue = this.value;
@@ -20,7 +20,11 @@
20
20
  type="solid"
21
21
  class="h-5 w-5 mr-3 text-gray-500"
22
22
  ></c-icon>
23
- <c-avatar :size="items.size" :rounded="items.rounded" :image="items.image"></c-avatar>
23
+ <c-avatar
24
+ :size="items.size"
25
+ :rounded="items.rounded"
26
+ :image="items.image"
27
+ ></c-avatar>
24
28
  <div class="flex flex-grow items-center justify-between flex-wrap">
25
29
  <div class="ml-3">
26
30
  <div class="flex pb-1">
@@ -42,9 +46,14 @@
42
46
  <button
43
47
  type="button"
44
48
  v-if="items.listIcon"
49
+ @click="$emit('remove')"
45
50
  class="rounded-full h-8 w-8 flex items-center justify-center text-gray-500 hover:bg-red-100 hover:text-red-800 focus:outline-none focus:ring-2 focus:ring-red-500"
46
51
  >
47
- <c-icon name="trash" type="solid" class="h-5 w-5 hover:text-red-800"></c-icon>
52
+ <c-icon
53
+ name="trash"
54
+ type="solid"
55
+ class="h-5 w-5 hover:text-red-800"
56
+ ></c-icon>
48
57
  </button>
49
58
  </div>
50
59
  </li>
@@ -214,7 +214,8 @@ export default {
214
214
  },
215
215
  watch: {
216
216
  value() {
217
- this.selectedValue = this.value !== null && this.value.option ? this.value.option : this.value;
217
+ this.selectedValue =
218
+ this.value !== null && this.value.option ? this.value.option : this.value;
218
219
  },
219
220
  },
220
221
  };
@@ -7,6 +7,7 @@ export default {
7
7
  argTypes: {
8
8
  label: String,
9
9
  description: String,
10
+ value: Number,
10
11
  },
11
12
  };
12
13
 
@@ -20,5 +21,9 @@ export const Default = Template.bind({});
20
21
  Default.args = {
21
22
  label: "Includes",
22
23
  description: "Add subjects to include them in the package",
24
+ value: 1,
23
25
  isDisabled: false,
26
+ onChange(val) {
27
+ return;
28
+ },
24
29
  };
@@ -33,10 +33,10 @@ Default.args = {
33
33
  hint: "Optional",
34
34
  showImage: true,
35
35
  value: {},
36
- renderOptionName: "option",
36
+ renderOptionName: "code",
37
37
  options: [
38
- { option: "one", value: "onee" },
39
- { option: "two", value: "twoo" },
38
+ { code: "one", value: "onee" },
39
+ { code: "two", value: "twoo" },
40
40
  ],
41
41
  addAction: {
42
42
  label: "Add new",
@@ -22,7 +22,7 @@ export default {
22
22
  const Template = (args, { argTypes }) => ({
23
23
  props: Object.keys(argTypes),
24
24
  components: { CTable },
25
- template: '<c-table @hideCols="hideCols" @showCheckbox="showCheckbox" v-bind="$props" />',
25
+ template: '<c-table @hideCols="hideCols" @showCheckbox="showCheckbox" @reordered="handleReorder" v-bind="$props" />',
26
26
  });
27
27
 
28
28
  export const Default = Template.bind({});
@@ -41,28 +41,11 @@ Default.args = {
41
41
  showHideColumnList: [
42
42
  { label: "", field: "drag", hidden: false },
43
43
  {
44
- label: "Make",
45
- field: "make",
44
+ label: "Mode",
45
+ field: "mode",
46
46
  hidden: false,
47
47
  sortable: true,
48
- },
49
- { label: "Model", field: "modal", hidden: false, sortable: true },
50
- { label: "Staff", field: "staff", hidden: false },
51
- { label: "CRR", field: "crr", hidden: false, sortable: true },
52
- { label: "Switch", field: "switch", hidden: false },
53
- { label: "Icon", field: "color", hidden: false },
54
- { label: "", field: "drag", hidden: false },
55
- {
56
- label: "Make",
57
- field: "make",
58
- hidden: false,
59
- sortable: true,
60
- },
61
- { label: "Model", field: "modal", hidden: false, sortable: true },
62
- { label: "Staff", field: "staff", hidden: false },
63
- { label: "CRR", field: "crr", hidden: false, sortable: true },
64
- { label: "Switch", field: "switch", hidden: false },
65
- { label: "Icon", field: "color", hidden: false },
48
+ }
66
49
  ],
67
50
  rows: [{"id":5,"mode":"ATM Machine 1","sort_order":2,"status":1,"rcInstitutionID":82,"created_at":"2020-09-02T12:53:09.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"},{"id":11,"mode":"QA 1","sort_order":3,"status":1,"rcInstitutionID":82,"created_at":"2020-09-04T09:57:47.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"},{"id":7,"mode":"ATM Machine 2","sort_order":4,"status":1,"rcInstitutionID":82,"created_at":"2020-09-04T09:45:47.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"},{"id":18,"mode":"QA 3","sort_order":8,"status":1,"rcInstitutionID":82,"created_at":"2020-09-04T10:05:15.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"},{"id":12,"mode":"QA 2","sort_order":21,"status":1,"rcInstitutionID":82,"created_at":"2020-09-04T09:57:55.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"},{"id":15,"mode":"QA 4","sort_order":22,"status":1,"rcInstitutionID":82,"created_at":"2020-09-04T10:00:23.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"},{"id":162,"mode":"Yes bank","sort_order":62,"status":1,"rcInstitutionID":82,"created_at":"2020-11-18T09:22:43.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"},{"id":163,"mode":"SBI bank","sort_order":63,"status":1,"rcInstitutionID":82,"created_at":"2020-11-18T09:33:17.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"},{"id":164,"mode":"BOB bank","sort_order":64,"status":1,"rcInstitutionID":82,"created_at":"2020-11-18T09:35:12.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"},{"id":165,"mode":"PNB bank","sort_order":65,"status":1,"rcInstitutionID":82,"created_at":"2020-11-18T09:55:16.000000Z","updated_at":"2021-11-25T13:13:56.000000Z"}],
68
51
  pagination: true,
@@ -85,4 +68,10 @@ Default.args = {
85
68
  Default.args.cols[0].hidden = true;
86
69
  }
87
70
  },
71
+ handleReorder(val) {
72
+ Default.args.rows = val;
73
+ val.forEach((item, index) => {
74
+ console.log(item);
75
+ });
76
+ }
88
77
  };