@appscode/design-system 2.5.8 → 2.5.9

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": "@appscode/design-system",
3
- "version": "2.5.8",
3
+ "version": "2.5.9",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -24,6 +24,7 @@ interface Props {
24
24
  updateEditFields?: Function;
25
25
  saveNewItem?: Function;
26
26
  onDeleteItem: Function;
27
+ initiallyHidden?: boolean;
27
28
  }
28
29
 
29
30
  const prop = withDefaults(defineProps<Props>(), {
@@ -40,13 +41,14 @@ const prop = withDefaults(defineProps<Props>(), {
40
41
  updateEditFields: () => () => ({}),
41
42
  saveEditedItem: () => () => ({}),
42
43
  onDeleteItem: () => () => ({}),
44
+ initiallyHidden: false,
43
45
  });
44
46
 
45
47
  const Accordion = defineAsyncComponent(() => import("./Accordion.vue"));
46
48
 
47
49
  const expandableFieldIndex = ref(-1);
48
50
  const editFieldIndex = ref(-1);
49
- const isFormHidden = ref(true);
51
+ const isFormHidden = ref(prop.initiallyHidden);
50
52
  const isSavingNewElement = ref(false);
51
53
  const dataForTable = defineModel<Array<AcTableRow>>({ required: true });
52
54
 
@@ -89,6 +91,10 @@ function readableTime(utcTime: unknown) {
89
91
  if (typeof utcTime === "string") return new Date(utcTime).toLocaleString();
90
92
  else return utcTime;
91
93
  }
94
+
95
+ function collapseForm() {
96
+ if (prop.isCollapsible) isFormHidden.value = !isFormHidden.value;
97
+ }
92
98
  </script>
93
99
 
94
100
  <template>
@@ -102,7 +108,7 @@ function readableTime(utcTime: unknown) {
102
108
  :isRequired="isRequired"
103
109
  :errors="errors"
104
110
  :isFormHidden="isFormHidden"
105
- @click="isFormHidden = !isFormHidden"
111
+ @click="collapseForm()"
106
112
  />
107
113
  <div class="buttons pb-5">
108
114
  <!-- save button start -->
@@ -147,7 +153,7 @@ function readableTime(utcTime: unknown) {
147
153
  :isRequired="isRequired"
148
154
  :errors="errors"
149
155
  :isFormHidden="isFormHidden"
150
- @click="isFormHidden = !isFormHidden"
156
+ @click="collapseForm()"
151
157
  />
152
158
  <button
153
159
  v-if="!disabled && !isCreateDisabled"