classcard-ui 0.2.291 → 0.2.295

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.291",
3
+ "version": "0.2.295",
4
4
  "main": "dist/classcard-ui.common.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -51,7 +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)"
54
+ @click="handleEvent(button.onClickAction)"
55
+ @blur="handleEvent(button.blurAction)"
55
56
  >
56
57
  <div v-if="button.icon == ''" class="h-5"></div>
57
58
  <c-icon
@@ -85,9 +86,12 @@ export default {
85
86
  };
86
87
  },
87
88
  methods: {
89
+ handleEvent(function_name) {
90
+ if(function_name) function_name()
91
+ },
88
92
  buttonAction(event, value) {
89
93
  this.$emit("onClick", value);
90
- },
94
+ }
91
95
  },
92
96
  };
93
97
  </script>
@@ -18,6 +18,7 @@
18
18
  :value="inputValue"
19
19
  @input="$emit('input', $event.target.value)"
20
20
  @blur="$emit('blur', $event.target.value)"
21
+ @focus="$emit('focus', $event.target.value)"
21
22
  :class="errorClasses"
22
23
  class="shadow-sm 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 text-gray-900"
23
24
  :placeholder="placeholder"
@@ -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">
@@ -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
  };