frappe-ui 0.0.52 → 0.0.55

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,12 +1,13 @@
1
1
  {
2
2
  "name": "frappe-ui",
3
- "version": "0.0.52",
3
+ "version": "0.0.55",
4
4
  "description": "A set of components and utilities for rapid UI development",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
7
7
  "test": "npx prettier --check ./src",
8
8
  "prettier": "npx prettier -w ./src",
9
- "prepare": "husky install"
9
+ "prepare": "husky install",
10
+ "bump-and-release": "yarn version --patch && git push && git push --tags"
10
11
  },
11
12
  "files": [
12
13
  "src"
@@ -43,7 +44,8 @@
43
44
  "devDependencies": {
44
45
  "husky": ">=6",
45
46
  "lint-staged": ">=10",
46
- "prettier": "2.7.1"
47
+ "prettier": "2.7.1",
48
+ "prettier-plugin-tailwindcss": "^0.1.13"
47
49
  },
48
50
  "lint-staged": {
49
51
  "*.{js,css,md,vue}": "prettier --write"
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="block w-full">
3
3
  <div
4
- class="items-start px-4 md:px-5 py-3.5 text-base rounded-md flex"
4
+ class="flex items-start rounded-md px-4 py-3.5 text-base md:px-5"
5
5
  :class="classes"
6
6
  >
7
7
  <svg
@@ -19,8 +19,8 @@
19
19
  fill="#318AD8"
20
20
  />
21
21
  </svg>
22
- <div class="w-full ml-2">
23
- <div class="flex flex-col md:items-baseline md:flex-row">
22
+ <div class="ml-2 w-full">
23
+ <div class="flex flex-col md:flex-row md:items-baseline">
24
24
  <h3 class="text-lg font-medium text-gray-900" v-if="title">
25
25
  {{ title }}
26
26
  </h3>
@@ -4,7 +4,7 @@
4
4
  <template #target="{ open: openPopover }">
5
5
  <div class="w-full">
6
6
  <ComboboxButton
7
- class="flex items-center justify-between w-full py-1.5 pl-3 pr-2 rounded-md bg-gray-100"
7
+ class="flex w-full items-center justify-between rounded-md bg-gray-100 py-1.5 pl-3 pr-2"
8
8
  :class="{ 'rounded-b-none': isComboboxOpen }"
9
9
  @click="
10
10
  () => {
@@ -12,7 +12,10 @@
12
12
  }
13
13
  "
14
14
  >
15
- <span class="text-base" v-if="selectedValue">
15
+ <span
16
+ class="overflow-hidden text-ellipsis text-base"
17
+ v-if="selectedValue"
18
+ >
16
19
  {{ displayValue(selectedValue) }}
17
20
  </span>
18
21
  <span class="text-base text-gray-500" v-else>
@@ -20,7 +23,7 @@
20
23
  </span>
21
24
  <FeatherIcon
22
25
  name="chevron-down"
23
- class="w-4 h-4 text-gray-500"
26
+ class="h-4 w-4 text-gray-500"
24
27
  aria-hidden="true"
25
28
  />
26
29
  </ComboboxButton>
@@ -28,15 +31,15 @@
28
31
  </template>
29
32
  <template #body>
30
33
  <ComboboxOptions
31
- class="px-1.5 pb-1.5 bg-white rounded-md shadow-md rounded-t-none max-h-[11rem] overflow-y-auto"
34
+ class="max-h-[11rem] overflow-y-auto rounded-md rounded-t-none bg-white px-1.5 pb-1.5 shadow-md"
32
35
  static
33
36
  v-show="isComboboxOpen"
34
37
  >
35
38
  <div
36
- class="flex items-st items-stretch space-x-1.5 sticky top-0 pt-1.5 mb-1.5 bg-white"
39
+ class="items-st sticky top-0 mb-1.5 flex items-stretch space-x-1.5 bg-white pt-1.5"
37
40
  >
38
41
  <ComboboxInput
39
- class="w-full placeholder-gray-500 form-input"
42
+ class="form-input w-full placeholder-gray-500"
40
43
  type="text"
41
44
  @change="
42
45
  (e) => {
@@ -58,7 +61,7 @@
58
61
  >
59
62
  <li
60
63
  :class="[
61
- 'px-2.5 py-1.5 rounded-md text-base',
64
+ 'rounded-md px-2.5 py-1.5 text-base',
62
65
  { 'bg-gray-100': active },
63
66
  ]"
64
67
  >
@@ -67,7 +70,7 @@
67
70
  </ComboboxOption>
68
71
  <li
69
72
  v-if="filteredOptions.length == 0"
70
- class="px-2.5 py-1.5 rounded-md text-base text-gray-600"
73
+ class="rounded-md px-2.5 py-1.5 text-base text-gray-600"
71
74
  >
72
75
  No results found
73
76
  </li>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="overflow-hidden shrink-0" :class="styleClasses">
2
+ <div class="shrink-0 overflow-hidden" :class="styleClasses">
3
3
  <img
4
4
  v-if="imageURL"
5
5
  :src="imageURL"
@@ -8,7 +8,7 @@
8
8
  />
9
9
  <div
10
10
  v-else
11
- class="flex items-center justify-center w-full h-full text-gray-600 uppercase bg-gray-200"
11
+ class="flex h-full w-full items-center justify-center bg-gray-200 uppercase text-gray-600"
12
12
  :class="{ sm: 'text-xs', md: 'text-base', lg: 'text-lg' }[size]"
13
13
  >
14
14
  {{ label && label[0] }}
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <span
3
- class="inline-block px-3 py-1 text-xs font-medium rounded-md cursor-default"
3
+ class="inline-block cursor-default rounded-md px-3 py-1 text-xs font-medium"
4
4
  :class="classes"
5
5
  >
6
6
  <slot>{{ status }}</slot>
@@ -9,39 +9,50 @@
9
9
  <script>
10
10
  export default {
11
11
  name: 'Badge',
12
- props: ['color', 'status'],
12
+ props: ['color', 'status', 'colorMap'],
13
+ data: {
14
+ defaultColorMap: {
15
+ Pending: 'yellow',
16
+ Running: 'yellow',
17
+ Success: 'green',
18
+ Failure: 'red',
19
+ Active: 'green',
20
+ Broken: 'red',
21
+ Updating: 'blue',
22
+ Rejected: 'red',
23
+ Published: 'green',
24
+ Approved: 'green',
25
+ },
26
+ },
13
27
  computed: {
14
28
  classes() {
15
- let color = this.color
16
- if (typeof color === 'object') {
17
- for (let key in color) {
18
- if (color[key]) {
19
- color = key
20
- break
21
- }
22
- }
23
- }
24
- if (!color && this.status) {
25
- color = {
26
- Pending: 'yellow',
27
- Running: 'yellow',
28
- Success: 'green',
29
- Failure: 'red',
30
- Active: 'green',
31
- Broken: 'red',
32
- Updating: 'blue',
33
- Rejected: 'red',
34
- Published: 'green',
35
- Approved: 'green',
36
- }[this.status]
37
- }
38
- return {
29
+ let color = this.getBadgeColor()
30
+
31
+ let cssClasses = {
39
32
  gray: 'text-gray-700 bg-gray-50',
40
33
  green: 'text-green-700 bg-green-50',
41
34
  red: 'text-red-700 bg-red-50',
42
35
  yellow: 'text-yellow-700 bg-yellow-50',
43
36
  blue: 'text-blue-700 bg-blue-50',
44
- }[color || 'gray']
37
+ }[color]
38
+
39
+ return cssClasses
40
+ },
41
+ },
42
+ methods: {
43
+ getBadgeColor() {
44
+ let color = this.color
45
+ if (color) {
46
+ return color
47
+ }
48
+
49
+ let statusColorMap = Object.assign(
50
+ this.defaultColorMap,
51
+ this.colorMap || {}
52
+ )
53
+ color = statusColorMap[this.status] || 'gray'
54
+
55
+ return color
45
56
  },
46
57
  },
47
58
  }
@@ -7,7 +7,7 @@
7
7
  >
8
8
  <LoadingIndicator
9
9
  v-if="loading"
10
- class="w-3 h-3 mr-2 -ml-1"
10
+ class="mr-2 -ml-1 h-3 w-3"
11
11
  :class="{
12
12
  'text-white': appearance == 'primary',
13
13
  'text-gray-600': appearance == 'secondary',
@@ -19,12 +19,12 @@
19
19
  <FeatherIcon
20
20
  v-else-if="iconLeft"
21
21
  :name="iconLeft"
22
- class="w-4 h-4 mr-1.5"
22
+ class="mr-1.5 h-4 w-4"
23
23
  aria-hidden="true"
24
24
  />
25
25
  <template v-if="loading && loadingText">{{ loadingText }}</template>
26
26
  <template v-else-if="icon">
27
- <FeatherIcon :name="icon" class="w-4 h-4" :aria-label="label" />
27
+ <FeatherIcon :name="icon" class="h-4 w-4" :aria-label="label" />
28
28
  </template>
29
29
  <span :class="icon ? 'sr-only' : ''">
30
30
  <slot>
@@ -34,7 +34,7 @@
34
34
  <FeatherIcon
35
35
  v-if="iconRight"
36
36
  :name="iconRight"
37
- class="w-4 h-4 ml-2"
37
+ class="ml-2 h-4 w-4"
38
38
  aria-hidden="true"
39
39
  />
40
40
  </button>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="flex flex-col px-6 py-5 bg-white border rounded-lg shadow">
2
+ <div class="flex flex-col rounded-lg border bg-white px-6 py-5 shadow">
3
3
  <div class="flex items-baseline justify-between">
4
4
  <div class="flex items-baseline space-x-2">
5
5
  <div class="flex items-center space-x-2" v-if="$slots['actions-left']">
@@ -11,16 +11,16 @@
11
11
  <slot name="actions"></slot>
12
12
  </div>
13
13
  </div>
14
- <p class="text-base text-gray-600 mt-1.5" v-if="subtitle">
14
+ <p class="mt-1.5 text-base text-gray-600" v-if="subtitle">
15
15
  {{ subtitle }}
16
16
  </p>
17
17
  <div
18
18
  v-if="loading"
19
- class="flex flex-col items-center justify-center flex-auto mt-4 rounded-md"
19
+ class="mt-4 flex flex-auto flex-col items-center justify-center rounded-md"
20
20
  >
21
21
  <LoadingText />
22
22
  </div>
23
- <div class="flex-auto mt-4 overflow-auto" v-else-if="$slots['default']">
23
+ <div class="mt-4 flex-auto overflow-auto" v-else-if="$slots['default']">
24
24
  <slot></slot>
25
25
  </div>
26
26
  </div>
@@ -13,36 +13,36 @@
13
13
  />
14
14
  </template>
15
15
  <template #body-main="{ togglePopover }">
16
- <div class="p-3 mt-1 text-left select-none">
16
+ <div class="mt-1 select-none p-3 text-left">
17
17
  <div class="flex items-center justify-between">
18
18
  <span class="text-base font-medium text-blue-500">
19
19
  {{ formatMonth }}
20
20
  </span>
21
21
  <span class="flex">
22
22
  <div
23
- class="grid w-5 h-5 rounded-md cursor-pointer hover:bg-gray-100 place-items-center"
23
+ class="grid h-5 w-5 cursor-pointer place-items-center rounded-md hover:bg-gray-100"
24
24
  >
25
25
  <FeatherIcon
26
26
  @click="prevMonth"
27
27
  name="chevron-left"
28
- class="w-4 h-4"
28
+ class="h-4 w-4"
29
29
  />
30
30
  </div>
31
31
  <div
32
- class="grid w-5 h-5 ml-2 rounded-md cursor-pointer hover:bg-gray-100 place-items-center"
32
+ class="ml-2 grid h-5 w-5 cursor-pointer place-items-center rounded-md hover:bg-gray-100"
33
33
  >
34
34
  <FeatherIcon
35
35
  @click="nextMonth"
36
36
  name="chevron-right"
37
- class="w-4 h-4"
37
+ class="h-4 w-4"
38
38
  />
39
39
  </div>
40
40
  </span>
41
41
  </div>
42
42
  <div class="mt-2 text-sm">
43
- <div class="grid w-full grid-cols-7 text-gray-600 place-items-center">
43
+ <div class="grid w-full grid-cols-7 place-items-center text-gray-600">
44
44
  <div
45
- class="grid w-6 h-6 gap-1 text-center place-items-center"
45
+ class="grid h-6 w-6 place-items-center gap-1 text-center"
46
46
  v-for="(d, i) in ['S', 'M', 'T', 'W', 'T', 'F', 'S']"
47
47
  :key="i"
48
48
  >
@@ -50,11 +50,11 @@
50
50
  </div>
51
51
  </div>
52
52
  <div v-for="(week, i) in datesAsWeeks" :key="i" class="mt-1">
53
- <div class="grid w-full grid-cols-7 gap-1 place-items-center">
53
+ <div class="grid w-full grid-cols-7 place-items-center gap-1">
54
54
  <div
55
55
  v-for="date in week"
56
56
  :key="toValue(date)"
57
- class="grid w-6 h-6 rounded-md cursor-pointer place-items-center hover:bg-blue-100 hover:text-blue-700"
57
+ class="grid h-6 w-6 cursor-pointer place-items-center rounded-md hover:bg-blue-100 hover:text-blue-700"
58
58
  :class="{
59
59
  'text-gray-600': date.getMonth() !== currentMonth - 1,
60
60
  'text-blue-500': toValue(date) === toValue(today),
@@ -73,9 +73,9 @@
73
73
  </div>
74
74
  </div>
75
75
  </div>
76
- <div class="flex justify-end w-full mt-2">
76
+ <div class="mt-2 flex w-full justify-end">
77
77
  <div
78
- class="px-2 py-1 text-sm rounded-md cursor-pointer hover:bg-gray-100"
78
+ class="cursor-pointer rounded-md px-2 py-1 text-sm hover:bg-gray-100"
79
79
  @click="
80
80
  () => {
81
81
  selectDate('')
@@ -10,7 +10,7 @@
10
10
  @close="open = false"
11
11
  >
12
12
  <div
13
- class="flex flex-col items-center justify-center min-h-screen px-4 pt-4 pb-20 text-center"
13
+ class="flex min-h-screen flex-col items-center justify-center px-4 pt-4 pb-20 text-center"
14
14
  >
15
15
  <TransitionChild
16
16
  as="template"
@@ -22,7 +22,7 @@
22
22
  leave-to="opacity-0"
23
23
  >
24
24
  <DialogOverlay
25
- class="fixed inset-0 transition-opacity bg-gray-500 bg-opacity-75"
25
+ class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"
26
26
  />
27
27
  </TransitionChild>
28
28
 
@@ -36,15 +36,15 @@
36
36
  leave-to="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
37
37
  >
38
38
  <div
39
- class="inline-block w-full max-w-lg my-8 overflow-hidden text-left align-middle transition-all transform bg-white rounded-lg shadow-xl"
39
+ class="my-8 inline-block w-full max-w-lg transform overflow-hidden rounded-lg bg-white text-left align-middle shadow-xl transition-all"
40
40
  >
41
41
  <slot name="body">
42
42
  <slot name="body-main">
43
- <div class="px-4 py-5 bg-white sm:p-6">
43
+ <div class="bg-white px-4 py-5 sm:p-6">
44
44
  <div class="flex flex-col sm:flex-row">
45
45
  <div
46
46
  v-if="icon"
47
- class="flex items-center justify-center flex-shrink-0 w-12 h-12 mx-auto mb-3 rounded-full sm:mx-0 sm:h-9 sm:w-9 sm:mb-0 sm:mr-4"
47
+ class="mx-auto mb-3 flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full sm:mx-0 sm:mb-0 sm:mr-4 sm:h-9 sm:w-9"
48
48
  :class="{
49
49
  'bg-yellow-100': icon.appearance === 'warning',
50
50
  'bg-blue-100': icon.appearance === 'info',
@@ -54,7 +54,7 @@
54
54
  >
55
55
  <FeatherIcon
56
56
  :name="icon.name"
57
- class="w-6 h-6 text-red-600 sm:w-5 sm:h-5"
57
+ class="h-6 w-6 text-red-600 sm:h-5 sm:w-5"
58
58
  :class="{
59
59
  'text-yellow-600': icon.appearance === 'warning',
60
60
  'text-blue-600': icon.appearance === 'info',
@@ -85,7 +85,7 @@
85
85
  </div>
86
86
  </slot>
87
87
  <div
88
- class="px-4 py-3 space-y-2 sm:space-x-reverse sm:space-x-3 sm:space-y-0 bg-gray-50 sm:px-6 sm:flex sm:flex-row-reverse"
88
+ class="space-y-2 bg-gray-50 px-4 py-3 sm:flex sm:flex-row-reverse sm:space-x-3 sm:space-y-0 sm:space-x-reverse sm:px-6"
89
89
  v-if="options?.actions || $slots.actions"
90
90
  >
91
91
  <slot name="actions" v-bind="{ close: () => (open = false) }">
@@ -16,7 +16,7 @@
16
16
  leave-to-class="transform scale-95 opacity-0"
17
17
  >
18
18
  <MenuItems
19
- class="absolute z-10 mt-2 bg-white divide-y divide-gray-100 rounded-md shadow-lg min-w-40 ring-1 ring-black ring-opacity-5 focus:outline-none"
19
+ class="min-w-40 absolute z-10 mt-2 divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"
20
20
  :class="{
21
21
  'left-0 origin-top-left': placement == 'left',
22
22
  'right-0 origin-top-right': placement == 'right',
@@ -26,7 +26,7 @@
26
26
  <div v-for="group in groups" :key="group.key" class="px-1 py-1">
27
27
  <div
28
28
  v-if="group.group && !group.hideLabel"
29
- class="px-2 py-1 text-xs font-semibold tracking-wider text-gray-500 uppercase"
29
+ class="px-2 py-1 text-xs font-semibold uppercase tracking-wider text-gray-500"
30
30
  >
31
31
  {{ group.group }}
32
32
  </div>
@@ -38,14 +38,14 @@
38
38
  <button
39
39
  :class="[
40
40
  active ? 'bg-gray-100' : 'text-gray-900',
41
- 'group flex rounded-md items-center w-full px-2 py-2 text-sm',
41
+ 'group flex w-full items-center rounded-md px-2 py-2 text-sm',
42
42
  ]"
43
43
  @click="item.onClick"
44
44
  >
45
45
  <FeatherIcon
46
46
  v-if="item.icon"
47
47
  :name="item.icon"
48
- class="flex-shrink-0 w-4 h-4 mr-2 text-gray-500"
48
+ class="mr-2 h-4 w-4 flex-shrink-0 text-gray-500"
49
49
  aria-hidden="true"
50
50
  />
51
51
  <span class="whitespace-nowrap">
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  v-if="message"
4
- class="text-sm text-red-600 whitespace-pre-line"
4
+ class="whitespace-pre-line text-sm text-red-600"
5
5
  role="alert"
6
6
  v-html="message"
7
7
  ></div>
@@ -2,7 +2,7 @@
2
2
  <label :class="[type == 'checkbox' ? 'flex' : 'block', $attrs.class]">
3
3
  <span
4
4
  v-if="label && type != 'checkbox'"
5
- class="block mb-2 text-sm leading-4 text-gray-700"
5
+ class="mb-2 block text-sm leading-4 text-gray-700"
6
6
  >
7
7
  {{ label }}
8
8
  </span>
@@ -13,11 +13,11 @@
13
13
  )
14
14
  "
15
15
  v-bind="inputAttributes"
16
- class="placeholder-gray-500 border-gray-400"
16
+ class="border-gray-400 placeholder-gray-500"
17
17
  ref="input"
18
18
  :class="[
19
19
  {
20
- 'block w-full form-input': type != 'checkbox',
20
+ 'form-input block w-full': type != 'checkbox',
21
21
  'form-checkbox': type == 'checkbox',
22
22
  },
23
23
  inputClass,
@@ -32,7 +32,7 @@
32
32
  v-bind="inputAttributes"
33
33
  :placeholder="placeholder"
34
34
  class="placeholder-gray-500"
35
- :class="['block w-full resize-none form-textarea', inputClass]"
35
+ :class="['form-textarea block w-full resize-none', inputClass]"
36
36
  ref="input"
37
37
  :value="passedInputValue"
38
38
  :disabled="disabled"
@@ -40,7 +40,7 @@
40
40
  ></textarea>
41
41
  <select
42
42
  v-bind="inputAttributes"
43
- class="block w-full form-select"
43
+ class="form-select block w-full"
44
44
  ref="input"
45
45
  v-if="type === 'select'"
46
46
  :disabled="disabled"
@@ -57,7 +57,7 @@
57
57
  </select>
58
58
  <span
59
59
  v-if="label && type == 'checkbox'"
60
- class="inline-block ml-2 text-base leading-4"
60
+ class="ml-2 inline-block text-base leading-4"
61
61
  >
62
62
  {{ label }}
63
63
  </span>
@@ -2,7 +2,7 @@
2
2
  <component
3
3
  :is="isExternal ? 'a' : 'router-link'"
4
4
  v-bind="attributes"
5
- class="text-blue-500 cursor-pointer hover:text-blue-600"
5
+ class="cursor-pointer text-blue-500 hover:text-blue-600"
6
6
  >
7
7
  <slot></slot>
8
8
  </component>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="flex items-center text-base text-gray-500">
3
- <LoadingIndicator class="w-3 h-3 mr-2 -ml-1" /> {{ text }}
3
+ <LoadingIndicator class="mr-2 -ml-1 h-3 w-3" /> {{ text }}
4
4
  </div>
5
5
  </template>
6
6
  <script>
@@ -14,7 +14,7 @@
14
14
 
15
15
  <div
16
16
  v-show="show"
17
- class="w-full overflow-auto transition-all transform bg-white rounded-lg shadow-xl"
17
+ class="w-full transform overflow-auto rounded-lg bg-white shadow-xl transition-all"
18
18
  :class="!full ? 'sm:max-w-lg' : ''"
19
19
  style="max-height: 95vh"
20
20
  >
@@ -18,7 +18,7 @@
18
18
  <div
19
19
  ref="popover"
20
20
  :class="popoverClass"
21
- class="relative z-[100] popover-container"
21
+ class="popover-container relative z-[100]"
22
22
  :style="{ minWidth: targetWidth ? targetWidth + 'px' : null }"
23
23
  v-show="isOpen"
24
24
  >
@@ -28,7 +28,7 @@
28
28
  name="body"
29
29
  v-bind="{ togglePopover, updatePosition, open, close, isOpen }"
30
30
  >
31
- <div class="bg-white border border-gray-100 rounded-lg shadow-xl">
31
+ <div class="rounded-lg border border-gray-100 bg-white shadow-xl">
32
32
  <slot
33
33
  name="body-main"
34
34
  v-bind="{
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  v-if="message"
4
- class="text-sm text-green-600 whitespace-pre-line"
4
+ class="whitespace-pre-line text-sm text-green-600"
5
5
  role="success"
6
6
  v-html="message"
7
7
  ></div>
@@ -7,7 +7,7 @@
7
7
  >
8
8
  <template #body-content>
9
9
  <label
10
- class="relative py-1 bg-gray-100 rounded-lg cursor-pointer focus-within:bg-gray-200 hover:bg-gray-200"
10
+ class="relative cursor-pointer rounded-lg bg-gray-100 py-1 focus-within:bg-gray-200 hover:bg-gray-200"
11
11
  >
12
12
  <input
13
13
  type="file"
@@ -15,14 +15,14 @@
15
15
  @change="onImageSelect"
16
16
  accept="image/*"
17
17
  />
18
- <span class="absolute inset-0 px-2 py-1 text-base select-none">
18
+ <span class="absolute inset-0 select-none px-2 py-1 text-base">
19
19
  {{ addImageDialog.file ? 'Select another image' : 'Select an image' }}
20
20
  </span>
21
21
  </label>
22
22
  <img
23
23
  v-if="addImageDialog.url"
24
24
  :src="addImageDialog.url"
25
- class="w-full mt-2 rounded-lg"
25
+ class="mt-2 w-full rounded-lg"
26
26
  />
27
27
  </template>
28
28
  <template #actions>
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <div
3
3
  v-if="items.length"
4
- class="p-1 text-base bg-white border rounded-lg shadow-lg min-w-40"
4
+ class="min-w-40 rounded-lg border bg-white p-1 text-base shadow-lg"
5
5
  >
6
6
  <button
7
7
  :class="[
8
8
  index === selectedIndex ? 'bg-gray-100' : 'text-gray-900',
9
- 'whitespace-nowrap flex rounded-md items-center w-full px-2 py-2 text-sm',
9
+ 'flex w-full items-center whitespace-nowrap rounded-md px-2 py-2 text-sm',
10
10
  ]"
11
11
  v-for="(item, index) in items"
12
12
  :key="index"
@@ -1,16 +1,16 @@
1
1
  <template>
2
- <div class="inline-flex px-1 py-1 bg-white">
2
+ <div class="inline-flex bg-white px-1 py-1">
3
3
  <div class="inline-flex items-center gap-1">
4
4
  <template v-for="button in buttons" :key="button.label">
5
5
  <div
6
- class="border-l w-[2px] h-4"
6
+ class="h-4 w-[2px] border-l"
7
7
  v-if="button.type === 'separator'"
8
8
  ></div>
9
9
  <div class="shrink-0" v-else-if="button.map">
10
10
  <Popover>
11
11
  <template #target="{ togglePopover }">
12
12
  <button
13
- class="px-2 py-1 text-base font-medium text-gray-800 transition-colors rounded hover:bg-gray-100"
13
+ class="rounded px-2 py-1 text-base font-medium text-gray-800 transition-colors hover:bg-gray-100"
14
14
  @click="togglePopover"
15
15
  :set="
16
16
  (activeBtn =
@@ -20,7 +20,7 @@
20
20
  <component
21
21
  v-if="activeBtn.icon"
22
22
  :is="activeBtn.icon"
23
- class="w-4 h-4"
23
+ class="h-4 w-4"
24
24
  />
25
25
  <span v-else>
26
26
  {{ activeBtn.label }}
@@ -28,14 +28,14 @@
28
28
  </button>
29
29
  </template>
30
30
  <template #body="{ close }">
31
- <ul class="p-1 bg-white border rounded shadow-md">
31
+ <ul class="rounded border bg-white p-1 shadow-md">
32
32
  <li
33
33
  class="w-full"
34
34
  v-for="option in button"
35
35
  v-show="option.isDisabled ? !option.isDisabled(editor) : true"
36
36
  >
37
37
  <button
38
- class="w-full px-2 py-1 text-base text-left rounded hover:bg-gray-50"
38
+ class="w-full rounded px-2 py-1 text-left text-base hover:bg-gray-50"
39
39
  @click="
40
40
  () => {
41
41
  onClick(option)
@@ -52,13 +52,13 @@
52
52
  </div>
53
53
  <button
54
54
  v-else
55
- class="flex p-1 text-gray-800 transition-colors rounded"
55
+ class="flex rounded p-1 text-gray-800 transition-colors"
56
56
  :class="button.isActive(editor) ? 'bg-gray-100' : 'hover:bg-gray-100'"
57
57
  @click="onClick(button)"
58
58
  :title="button.label"
59
59
  >
60
- <component v-if="button.icon" :is="button.icon" class="w-4 h-4" />
61
- <span class="inline-block h-4 text-sm leading-4 min-w-[1rem]" v-else>
60
+ <component v-if="button.icon" :is="button.icon" class="h-4 w-4" />
61
+ <span class="inline-block h-4 min-w-[1rem] text-sm leading-4" v-else>
62
62
  {{ button.text }}
63
63
  </span>
64
64
  </button>
@@ -8,14 +8,14 @@
8
8
  >
9
9
  <Menu
10
10
  :editor="editor"
11
- class="border border-gray-100 rounded-md shadow-sm"
11
+ class="rounded-md border border-gray-100 shadow-sm"
12
12
  :buttons="bubbleMenuButtons"
13
13
  />
14
14
  </BubbleMenu>
15
15
 
16
16
  <Menu
17
17
  v-if="fixedMenuButtons"
18
- class="w-full overflow-x-auto border border-gray-200 rounded-t-lg"
18
+ class="w-full overflow-x-auto rounded-t-lg border border-gray-200"
19
19
  :editor="editor"
20
20
  :buttons="fixedMenuButtons"
21
21
  />
@@ -29,13 +29,13 @@
29
29
  <button
30
30
  v-for="button in floatingMenuButtons"
31
31
  :key="button.label"
32
- class="flex p-1 text-gray-800 transition-colors rounded"
32
+ class="flex rounded p-1 text-gray-800 transition-colors"
33
33
  :class="button.isActive(editor) ? 'bg-gray-100' : 'hover:bg-gray-100'"
34
34
  @click="() => button.action(editor)"
35
35
  :title="button.label"
36
36
  >
37
- <component v-if="button.icon" :is="button.icon" class="w-4 h-4" />
38
- <span class="inline-block h-4 text-sm leading-4 min-w-[1rem]" v-else>
37
+ <component v-if="button.icon" :is="button.icon" class="h-4 w-4" />
38
+ <span class="inline-block h-4 min-w-[1rem] text-sm leading-4" v-else>
39
39
  {{ button.text }}
40
40
  </span>
41
41
  </button>
@@ -5,16 +5,16 @@
5
5
  v-if="shown"
6
6
  :style="style"
7
7
  :class="[
8
- 'absolute transition duration-200 ease-out m-4 pointer-events-auto',
8
+ 'pointer-events-auto absolute m-4 transition duration-200 ease-out',
9
9
  position.includes('center') ? '-translate-x-1/2' : '',
10
10
  ]"
11
11
  >
12
12
  <div
13
- class="p-4 bg-white border rounded-lg shadow-md min-w-[15rem] max-w-[40rem]"
13
+ class="min-w-[15rem] max-w-[40rem] rounded-lg border bg-white p-4 shadow-md"
14
14
  >
15
15
  <div class="flex items-start">
16
- <div v-if="icon" class="grid w-5 h-5 mr-3 place-items-center">
17
- <FeatherIcon :name="icon" :class="['w-5 h-5', iconClasses]" />
16
+ <div v-if="icon" class="mr-3 grid h-5 w-5 place-items-center">
17
+ <FeatherIcon :name="icon" :class="['h-5 w-5', iconClasses]" />
18
18
  </div>
19
19
  <div>
20
20
  <slot>
@@ -30,13 +30,13 @@
30
30
  </p>
31
31
  </slot>
32
32
  </div>
33
- <div class="pl-2 ml-auto">
33
+ <div class="ml-auto pl-2">
34
34
  <slot name="actions">
35
35
  <button
36
- class="grid w-5 h-5 rounded hover:bg-gray-100 place-items-center"
36
+ class="grid h-5 w-5 place-items-center rounded hover:bg-gray-100"
37
37
  @click="shown = false"
38
38
  >
39
- <FeatherIcon name="x" class="w-4 h-4 text-gray-700" />
39
+ <FeatherIcon name="x" class="h-4 w-4 text-gray-700" />
40
40
  </button>
41
41
  </slot>
42
42
  </div>
@@ -6,7 +6,7 @@
6
6
  <template #body>
7
7
  <slot name="body">
8
8
  <div
9
- class="px-2 py-1 text-xs text-white bg-gray-800 border border-gray-100 rounded-lg shadow-xl"
9
+ class="rounded-lg border border-gray-100 bg-gray-800 px-2 py-1 text-xs text-white shadow-xl"
10
10
  >
11
11
  {{ text }}
12
12
  </div>
package/src/style.css CHANGED
@@ -6,10 +6,10 @@
6
6
  .form-input,
7
7
  .form-textarea,
8
8
  .form-select {
9
- @apply py-1 text-base leading-5 placeholder-gray-700 bg-gray-100 border-0 rounded-md focus:ring-0 focus:bg-gray-200 focus:shadow-none;
9
+ @apply rounded-md border-0 bg-gray-100 py-1 text-base leading-5 placeholder-gray-700 focus:bg-gray-200 focus:shadow-none focus:ring-0;
10
10
  }
11
11
 
12
12
  .form-checkbox {
13
- @apply text-blue-500 rounded-md;
13
+ @apply rounded-md text-blue-500;
14
14
  }
15
15
  }
@@ -320,6 +320,8 @@ export function createListResource(options, vm, getResource) {
320
320
  order_by: options.order_by,
321
321
  start: options.start || 0,
322
322
  limit: options.limit || 20,
323
+ parent: options.parent,
324
+ debug: options.debug || 0,
323
325
  originalData: null,
324
326
  data: null,
325
327
  next,
@@ -336,6 +338,8 @@ export function createListResource(options, vm, getResource) {
336
338
  order_by: out.order_by,
337
339
  limit_start: out.start,
338
340
  limit_page_length: out.limit,
341
+ parent: out.parent,
342
+ debug: out.debug,
339
343
  }
340
344
  },
341
345
  onSuccess(data) {