frappe-ui 0.0.104 → 0.0.106

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": "frappe-ui",
3
- "version": "0.0.104",
3
+ "version": "0.0.106",
4
4
  "description": "A set of components and utilities for rapid UI development",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -24,10 +24,10 @@
24
24
  <h3 class="text-lg font-medium text-gray-900" v-if="title">
25
25
  {{ title }}
26
26
  </h3>
27
- <div class="mt-1 md:mt-0 md:ml-2">
27
+ <div class="mt-1 md:ml-2 md:mt-0">
28
28
  <slot></slot>
29
29
  </div>
30
- <div class="mt-3 md:mt-0 md:ml-auto">
30
+ <div class="mt-3 md:ml-auto md:mt-0">
31
31
  <slot name="actions"></slot>
32
32
  </div>
33
33
  </div>
@@ -10,7 +10,7 @@
10
10
  v-if="loading"
11
11
  class="h-3 w-3"
12
12
  :class="{
13
- 'mr-2 -ml-1': !isIconButton,
13
+ '-ml-1 mr-2': !isIconButton,
14
14
  'm-0.5': isIconButton,
15
15
  'text-white': appearance == 'primary',
16
16
  'text-gray-600': appearance == 'secondary',
@@ -80,7 +80,7 @@
80
80
  </template>
81
81
 
82
82
  <script>
83
- import { debounce } from '../index'
83
+ import debounce from '../utils/debounce.js'
84
84
  import FeatherIcon from './FeatherIcon.vue'
85
85
 
86
86
  export default {
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="flex items-center text-base text-gray-500">
3
- <LoadingIndicator class="mr-2 -ml-1 h-3 w-3" /> {{ text }}
3
+ <LoadingIndicator class="-ml-1 mr-2 h-3 w-3" /> {{ text }}
4
4
  </div>
5
5
  </template>
6
6
  <script>
@@ -54,7 +54,7 @@ export default {
54
54
  default: null,
55
55
  },
56
56
  placeholder: {
57
- type: String,
57
+ type: [String, Function],
58
58
  default: '',
59
59
  },
60
60
  editorClass: {
@@ -152,9 +152,10 @@ export default {
152
152
  }),
153
153
  Placeholder.configure({
154
154
  showOnlyWhenEditable: false,
155
- placeholder: () => {
156
- return this.placeholder
157
- },
155
+ placeholder:
156
+ typeof this.placeholder === 'function'
157
+ ? this.placeholder
158
+ : () => this.placeholder,
158
159
  }),
159
160
  configureMention(this.mentions),
160
161
  ...(this.extensions || []),
@@ -33,6 +33,8 @@ export function createListResource(options, vm) {
33
33
  debug: options.debug || 0,
34
34
  originalData: null,
35
35
  data: null,
36
+ previous,
37
+ hasPreviousPage: false,
36
38
  next,
37
39
  hasNextPage: true,
38
40
  auto: options.auto,
@@ -55,6 +57,7 @@ export function createListResource(options, vm) {
55
57
  }
56
58
  },
57
59
  onSuccess(data) {
60
+ out.hasPreviousPage = !!out.start
58
61
  if (data.length < out.pageLength) {
59
62
  out.hasNextPage = false
60
63
  }
@@ -221,6 +224,11 @@ export function createListResource(options, vm) {
221
224
  out.data = transform(data)
222
225
  }
223
226
 
227
+ function previous() {
228
+ out.start = out.start - out.pageLength
229
+ out.list.fetch()
230
+ }
231
+
224
232
  function next() {
225
233
  out.start = out.start + out.pageLength
226
234
  out.list.fetch()