classcard-ui 0.2.293 → 0.2.297

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.293",
3
+ "version": "0.2.297",
4
4
  "main": "dist/classcard-ui.common.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -51,9 +51,8 @@
51
51
  'rounded-l-md border-r-0': index == 0,
52
52
  'px-4': button.label,
53
53
  }"
54
- @click="buttonAction($event, button.value)"
55
- @focus="$emit('focus', $event.target.value)"
56
- @blur="$emit('blur', $event.target.value)"
54
+ @click="handleEvent(button.onClickAction)"
55
+ @blur="handleEvent(button.blurAction)"
57
56
  >
58
57
  <div v-if="button.icon == ''" class="h-5"></div>
59
58
  <c-icon
@@ -87,14 +86,11 @@ export default {
87
86
  };
88
87
  },
89
88
  methods: {
89
+ handleEvent(function_name) {
90
+ if(function_name) function_name()
91
+ },
90
92
  buttonAction(event, value) {
91
93
  this.$emit("onClick", value);
92
- },
93
- focus() {
94
- console.log("focus")
95
- },
96
- blur() {
97
- console.log("blur")
98
94
  }
99
95
  },
100
96
  };
@@ -2,7 +2,7 @@
2
2
  <div>
3
3
  <div class="bg-white rounded-md -space-y-px">
4
4
  <div
5
- class="relative rounded-tl-md rounded-tr-md pb-5 flex"
5
+ class="relative rounded-tl-md rounded-tr-md pb-5"
6
6
  v-for="item in items"
7
7
  v-bind:key="item.label"
8
8
  >
@@ -16,16 +16,16 @@
16
16
  class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 cursor-pointer border-gray-300 disabled:opacity-50"
17
17
  :disabled="isDisabled"
18
18
  />
19
+ <label class="ml-3 flex flex-col cursor-pointer" @click="onChange(item.value)">
20
+ <span class="block text-sm font-medium">
21
+ {{ item.label }}
22
+ </span>
23
+ <span class="block text-sm text-gray-500">
24
+ {{ item.description }}
25
+ </span>
26
+ </label>
19
27
  </div>
20
- <label class="ml-3 flex flex-col cursor-pointer" @click="onChange(item.value)">
21
- <span class="block text-sm font-medium">
22
- {{ item.label }}
23
- </span>
24
- <span class="block text-sm text-gray-500">
25
- {{ item.description }}
26
- </span>
27
- <slot v-if="item.value === selectedItem" :name="item.value" />
28
- </label>
28
+ <slot v-if="item.value === selectedItem" :name="item.value" />
29
29
  </div>
30
30
  </div>
31
31
  </div>
@@ -24,6 +24,7 @@
24
24
  :size="items.size"
25
25
  :rounded="items.rounded"
26
26
  :image="items.image"
27
+ :imageClasses="items.imageClasses"
27
28
  ></c-avatar>
28
29
  <div class="flex flex-grow items-center justify-between flex-wrap">
29
30
  <div class="ml-3">
package/src/icons.js CHANGED
@@ -40,7 +40,7 @@ export default {
40
40
  integration:
41
41
  "M10,13H4a1,1,0,0,0-1,1v6a1,1,0,0,0,1,1h6a1,1,0,0,0,1-1V14A1,1,0,0,0,10,13ZM9,19H5V15H9ZM20,3H14a1,1,0,0,0-1,1v6a1,1,0,0,0,1,1h6a1,1,0,0,0,1-1V4A1,1,0,0,0,20,3ZM19,9H15V5h4Zm1,7H18V14a1,1,0,0,0-2,0v2H14a1,1,0,0,0,0,2h2v2a1,1,0,0,0,2,0V18h2a1,1,0,0,0,0-2ZM10,3H4A1,1,0,0,0,3,4v6a1,1,0,0,0,1,1h6a1,1,0,0,0,1-1V4A1,1,0,0,0,10,3ZM9,9H5V5H9Z",
42
42
  clipboard:
43
- "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",
43
+ "M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z",
44
44
  package:
45
45
  "M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7",
46
46
  document:
@@ -15,10 +15,18 @@ const Template = (args, { argTypes }) => ({
15
15
  template: '<c-button-group v-bind="$props" />',
16
16
  });
17
17
 
18
+ const consoleIt = () => {
19
+ console.log("onclick fired")
20
+ }
21
+
22
+ const consoleOut = () => {
23
+ console.log("focus lost")
24
+ }
25
+
18
26
  export const Default = Template.bind({});
19
27
  Default.args = {
20
28
  buttonObject: [
21
- { icon: "bookmark", label: "Students", value:'students' },
29
+ { icon: "bookmark", label: "Students", value:'students', onClickAction: consoleIt, blurAction: consoleOut },
22
30
  { icon: "chat", label: "Alkama", value:'alkama'},
23
31
  { icon: "bookmark", label: "Attendance", value:'attendance' },
24
32
  ],
@@ -18,6 +18,6 @@ const Template = (args, { argTypes }) => ({
18
18
  export const Default = Template.bind({});
19
19
  Default.args = {
20
20
  listItems: [
21
- { image: "https://images.unsplash.com/photo-1491528323818-fdd1faba62cc?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;auto=format&amp;fit=facearea&amp;facepad=2&amp;w=256&amp;h=256&amp;q=80", heading: "Maths-Level1", description: "calvin.hawkins@example.com", size:"medium", rounded:false, tag:true, collapse:false, listIcon: true, reorder:true },
21
+ { image: "https://images.unsplash.com/photo-1491528323818-fdd1faba62cc?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;auto=format&amp;fit=facearea&amp;facepad=2&amp;w=256&amp;h=256&amp;q=80", heading: "Maths-Level1", description: "calvin.hawkins@example.com", size:"medium", rounded:false, tag:true, collapse:false, listIcon: true, reorder:true, imageClasses: "bg-gray-200 border-gray-200 border" },
22
22
  ],
23
23
  };