classcard-ui 0.2.195 → 0.2.196

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.196",
4
4
  "main": "dist/classcard-ui.common.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -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"
@@ -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
  };