@indielayer/ui 1.12.0 → 1.13.0

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.
Files changed (44) hide show
  1. package/docs/pages/component/datepicker/usage.vue +1 -0
  2. package/docs/pages/component/select/multiple.vue +4 -2
  3. package/docs/pages/component/select/usage.vue +1 -0
  4. package/docs/pages/component/table/usage.vue +1 -1
  5. package/docs/pages/component/tabs/usage.vue +1 -0
  6. package/docs/pages/component/upload/usage.vue +28 -18
  7. package/lib/components/datepicker/Datepicker.vue.d.ts +12 -12
  8. package/lib/components/datepicker/Datepicker.vue.js +6 -6
  9. package/lib/components/modal/Modal.vue.js +1 -4
  10. package/lib/components/select/Select.vue.d.ts +5 -1
  11. package/lib/components/select/Select.vue.js +261 -244
  12. package/lib/components/select/theme/Select.base.theme.js +11 -10
  13. package/lib/components/tab/theme/Tab.base.theme.js +2 -2
  14. package/lib/components/tab/theme/TabGroup.base.theme.js +1 -1
  15. package/lib/components/table/Table.vue.d.ts +1 -0
  16. package/lib/components/table/Table.vue.js +51 -50
  17. package/lib/components/table/TableHeader.vue.d.ts +3 -0
  18. package/lib/components/table/TableHeader.vue.js +58 -49
  19. package/lib/components/table/theme/TableHead.base.theme.js +1 -1
  20. package/lib/components/table/theme/TableHeader.base.theme.js +3 -3
  21. package/lib/components/table/theme/TableRow.base.theme.js +1 -1
  22. package/lib/components/upload/Upload.vue.d.ts +13 -0
  23. package/lib/components/upload/Upload.vue.js +100 -94
  24. package/lib/index.js +1 -1
  25. package/lib/index.umd.js +4 -4
  26. package/lib/node_modules/.pnpm/@vuepic_vue-datepicker@11.0.2_vue@3.5.10_typescript@5.2.2_/node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js +5210 -0
  27. package/lib/version.d.ts +1 -1
  28. package/lib/version.js +1 -1
  29. package/package.json +2 -2
  30. package/src/components/datepicker/Datepicker.vue +1 -1
  31. package/src/components/modal/Modal.vue +2 -0
  32. package/src/components/select/Select.vue +26 -7
  33. package/src/components/select/theme/Select.base.theme.ts +17 -6
  34. package/src/components/tab/theme/Tab.base.theme.ts +3 -2
  35. package/src/components/tab/theme/TabGroup.base.theme.ts +1 -1
  36. package/src/components/table/Table.vue +2 -0
  37. package/src/components/table/TableHeader.vue +36 -28
  38. package/src/components/table/theme/TableHead.base.theme.ts +1 -1
  39. package/src/components/table/theme/TableHeader.base.theme.ts +1 -1
  40. package/src/components/table/theme/TableRow.base.theme.ts +1 -1
  41. package/src/components/upload/Upload.vue +15 -6
  42. package/src/version.ts +1 -1
  43. package/lib/node_modules/.pnpm/@vuepic_vue-datepicker@11.0.1_vue@3.5.10_typescript@5.2.2_/node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js +0 -5199
  44. /package/lib/node_modules/.pnpm/{@vuepic_vue-datepicker@11.0.1_vue@3.5.10_typescript@5.2.2_ → @vuepic_vue-datepicker@11.0.2_vue@3.5.10_typescript@5.2.2_}/node_modules/@vuepic/vue-datepicker/dist/main.css.js +0 -0
@@ -13,6 +13,7 @@ date.value = [startDate, endDate]
13
13
  v-model="date"
14
14
  label="Date"
15
15
  tooltip="Use it to pick a date"
16
+ clearable
16
17
  text-input
17
18
  multi-calendars
18
19
  time-picker-inline
@@ -4,7 +4,7 @@ import { ref } from 'vue'
4
4
  const selectedMultiple = ref<string[]>(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M'])
5
5
 
6
6
  const options = ref([
7
- { value: 'A', label: 'Option lorem ipsum', color: 'bg-red-500' },
7
+ { value: 'A', label: 'Option lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum', color: 'bg-red-500' },
8
8
  { value: 'B', label: 'Option B ipsum', color: 'bg-orange-500' },
9
9
  { value: 'C', label: 'Option C lorem ipsum', color: 'bg-amber-500' },
10
10
  { value: 'D', label: 'D', color: 'bg-yellow-500' },
@@ -44,6 +44,7 @@ const optionsWithColors = options.value.map((option) => {
44
44
  :options="options"
45
45
  multiple
46
46
  truncate
47
+ clearable
47
48
  />
48
49
  <x-select
49
50
  v-model="selectedMultiple"
@@ -60,12 +61,13 @@ const optionsWithColors = options.value.map((option) => {
60
61
  :options="optionsWithColors"
61
62
  multiple-checkbox
62
63
  filterable
64
+ clearable
63
65
  >
64
66
  <template #prefix="{ item }">
65
67
  <div class="w-2 h-2 rounded-full" :class="item.prefix"></div>
66
68
  </template>
67
69
  <template #tag-prefix="{ item }">
68
- <div class="w-2 h-2 rounded-full" :class="item.prefix"></div>
70
+ <div class="w-2 h-2 shrink-0 rounded-full" :class="item.prefix"></div>
69
71
  </template>
70
72
  </x-select>
71
73
  </div>
@@ -39,6 +39,7 @@ const options2 = ref(genOptions(1000))
39
39
  label="Filterable - virtual list"
40
40
  placeholder="Placeholder"
41
41
  filterable
42
+ clearable
42
43
  virtual-list
43
44
  :virtual-list-item-height="33"
44
45
  :options="options2"
@@ -8,7 +8,7 @@ const headers: TableHeader[] = [
8
8
  { text: '#', value: 'id', sortable: true, align: 'center' },
9
9
  { text: 'Title', value: 'title' },
10
10
  { text: 'Description', value: 'description', truncate: true, width: 400 },
11
- { text: 'Published', value: 'published', sortable: true },
11
+ { text: 'Published', value: 'published', sortable: true, tooltip: 'Published date' },
12
12
  { text: 'Status', value: 'status' },
13
13
  ]
14
14
 
@@ -111,6 +111,7 @@ const linkTab = ref(null)
111
111
  v-model="tab"
112
112
  class="pb-10"
113
113
  variant="block"
114
+ :full-width="false"
114
115
  ghost
115
116
  >
116
117
  <x-tab value="a" label="Tab A">
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { ref } from 'vue'
3
- import { useNotifications, type UploadFile } from '@indielayer/ui'
3
+ import { useNotifications, XUpload, type UploadFile } from '@indielayer/ui'
4
4
 
5
5
  const notifications = useNotifications()
6
6
 
@@ -72,29 +72,38 @@ function onSubmit(isValid: boolean) {
72
72
  notifications?.success('Valid! Submitted.')
73
73
  }
74
74
 
75
+ const uploadRef = ref<InstanceType<typeof XUpload>>()
76
+
77
+ function reset() {
78
+ uploadRef.value?.reset()
79
+ previewImg.value = undefined
80
+ }
81
+
75
82
  const action = 'https://run.mocky.io/v3/6904ae0b-3cfa-4ae1-bbf2-243a4dd32a3c'
76
83
  </script>
77
84
 
78
85
  <template>
79
86
  <div >
80
87
  <x-form @submit="onSubmit">
81
- <div class="grid md:grid-cols-2 gap-2">
82
- <x-upload
83
- v-model="imageFiles"
84
-
85
- :action="action"
86
- method="POST"
87
- :with-credentials="false"
88
- :rules="[rules.isValidUpload]"
89
-
90
- placeholder="Upload game title cover image"
91
- max-file-size="2000000"
92
- label="Cover Image"
93
- tooltip="Title cover image should be 16:9 aspect ratio and max 2MB"
94
- helper="Title cover image should be 16:9 aspect ratio and max 2MB"
95
- @upload="onUploadComplete"
96
- @change="onChangeImage"
97
- />
88
+ <div class="grid md:grid-cols-2 gap-2 mb-4">
89
+ <div>
90
+ <x-upload
91
+ ref="uploadRef"
92
+ v-model="imageFiles"
93
+ :action="action"
94
+ method="POST"
95
+ :with-credentials="false"
96
+ :rules="[rules.isValidUpload]"
97
+ placeholder="Upload game title cover image"
98
+ max-file-size="2000000"
99
+ label="Cover Image"
100
+ tooltip="Title cover image should be 16:9 aspect ratio and max 2MB"
101
+ helper="Title cover image should be 16:9 aspect ratio and max 2MB"
102
+ @upload="onUploadComplete"
103
+ @change="onChangeImage"
104
+ />
105
+ <x-button size="sm" outlined ghost @click="reset">Reset input</x-button>
106
+ </div>
98
107
  <x-upload
99
108
  v-model="jsonFile"
100
109
  placeholder="Upload your json file"
@@ -105,6 +114,7 @@ const action = 'https://run.mocky.io/v3/6904ae0b-3cfa-4ae1-bbf2-243a4dd32a3c'
105
114
  @change="onChangeJSON"
106
115
  />
107
116
  </div>
117
+ <x-divider class="my-4"/>
108
118
  <x-button type="submit">Submit</x-button>
109
119
  </x-form>
110
120
  <div v-if="previewImg">
@@ -87,9 +87,9 @@ declare const datepickerProps: {
87
87
  clearInput?: string | undefined;
88
88
  calendarIcon?: string | undefined;
89
89
  timePicker?: string | undefined;
90
- monthPicker: (overlay: boolean) => string;
91
- yearPicker: (overlay: boolean) => string;
92
- timeOverlay: (type: import("@vuepic/vue-datepicker").TimeType) => string;
90
+ monthPicker?: ((overlay: boolean) => string) | undefined;
91
+ yearPicker?: ((overlay: boolean) => string) | undefined;
92
+ timeOverlay?: ((type: import("@vuepic/vue-datepicker").TimeType) => string) | undefined;
93
93
  } | undefined>>;
94
94
  default: () => {};
95
95
  };
@@ -611,9 +611,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
611
611
  clearInput?: string | undefined;
612
612
  calendarIcon?: string | undefined;
613
613
  timePicker?: string | undefined;
614
- monthPicker: (overlay: boolean) => string;
615
- yearPicker: (overlay: boolean) => string;
616
- timeOverlay: (type: import("@vuepic/vue-datepicker").TimeType) => string;
614
+ monthPicker?: ((overlay: boolean) => string) | undefined;
615
+ yearPicker?: ((overlay: boolean) => string) | undefined;
616
+ timeOverlay?: ((type: import("@vuepic/vue-datepicker").TimeType) => string) | undefined;
617
617
  } | undefined>>;
618
618
  default: () => {};
619
619
  };
@@ -1134,9 +1134,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
1134
1134
  clearInput?: string | undefined;
1135
1135
  calendarIcon?: string | undefined;
1136
1136
  timePicker?: string | undefined;
1137
- monthPicker: (overlay: boolean) => string;
1138
- yearPicker: (overlay: boolean) => string;
1139
- timeOverlay: (type: import("@vuepic/vue-datepicker").TimeType) => string;
1137
+ monthPicker?: ((overlay: boolean) => string) | undefined;
1138
+ yearPicker?: ((overlay: boolean) => string) | undefined;
1139
+ timeOverlay?: ((type: import("@vuepic/vue-datepicker").TimeType) => string) | undefined;
1140
1140
  } | undefined>>;
1141
1141
  default: () => {};
1142
1142
  };
@@ -1627,9 +1627,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
1627
1627
  clearInput?: string | undefined;
1628
1628
  calendarIcon?: string | undefined;
1629
1629
  timePicker?: string | undefined;
1630
- monthPicker: (overlay: boolean) => string;
1631
- yearPicker: (overlay: boolean) => string;
1632
- timeOverlay: (type: import("@vuepic/vue-datepicker").TimeType) => string;
1630
+ monthPicker?: ((overlay: boolean) => string) | undefined;
1631
+ yearPicker?: ((overlay: boolean) => string) | undefined;
1632
+ timeOverlay?: ((type: import("@vuepic/vue-datepicker").TimeType) => string) | undefined;
1633
1633
  } | undefined>;
1634
1634
  timePicker: boolean;
1635
1635
  monthPicker: boolean;
@@ -3,10 +3,10 @@ import { useMutationObserver as L } from "../../node_modules/.pnpm/@vueuse_core@
3
3
  import { useCommon as R } from "../../composables/useCommon.js";
4
4
  import { useInputtable as m } from "../../composables/useInputtable.js";
5
5
  import { useInteractive as z } from "../../composables/useInteractive.js";
6
- import { useTheme as G } from "../../composables/useTheme.js";
7
- import V from "../input/Input.vue.js";
8
- import Y from "../../node_modules/.pnpm/@vuepic_vue-datepicker@11.0.1_vue@3.5.10_typescript@5.2.2_/node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js";
9
- import "../../node_modules/.pnpm/@vuepic_vue-datepicker@11.0.1_vue@3.5.10_typescript@5.2.2_/node_modules/@vuepic/vue-datepicker/dist/main.css.js";
6
+ import { useTheme as V } from "../../composables/useTheme.js";
7
+ import G from "../input/Input.vue.js";
8
+ import Y from "../../node_modules/.pnpm/@vuepic_vue-datepicker@11.0.2_vue@3.5.10_typescript@5.2.2_/node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js";
9
+ import "../../node_modules/.pnpm/@vuepic_vue-datepicker@11.0.2_vue@3.5.10_typescript@5.2.2_/node_modules/@vuepic/vue-datepicker/dist/main.css.js";
10
10
  const W = {
11
11
  multiCalendars: { type: [Boolean, Number, String, Object], default: void 0 },
12
12
  modelValue: { type: [String, Date, Array, Object, Number], default: null },
@@ -159,7 +159,7 @@ const W = {
159
159
  }, {
160
160
  attributes: !0
161
161
  }), c({ focus: v, blur: w, validate: r });
162
- const { styles: B, classes: S, className: O } = G("Datepicker", {}, b);
162
+ const { styles: B, classes: S, className: O } = V("Datepicker", {}, b);
163
163
  return (e, H) => (N(), I("div", {
164
164
  style: P(n(B)),
165
165
  class: j([
@@ -268,7 +268,7 @@ const W = {
268
268
  "onUpdate:modelValue": k
269
269
  }, C({
270
270
  "dp-input": p(({ value: s, onEnter: l, onTab: o }) => [
271
- d(V, {
271
+ d(G, {
272
272
  ref_key: "inputRef",
273
273
  ref: t,
274
274
  readonly: e.textInput === !1 || e.readonly,
@@ -78,10 +78,7 @@ const x = { key: 0 }, ee = ["xs", "sm", "md", "lg", "xl", "full"], oe = ["top",
78
78
  u.value = e, c.value = e, A(), document.body.style.paddingRight = "", document.body.style.overflow = "auto";
79
79
  }
80
80
  typeof window < "u" && G(document, "keydown", W);
81
- const R = (e) => [".v-popper__popper", ".x-datepicker"].some((n) => {
82
- if (typeof n == "string")
83
- return Array.from(window.document.querySelectorAll(n)).some((f) => f === e.target || e.composedPath().includes(f));
84
- });
81
+ const R = (e) => [".v-popper__popper", ".x-datepicker"].some((n) => typeof n == "string" ? Array.from(window.document.querySelectorAll(n)).some((f) => f === e.target || e.composedPath().includes(f)) : !1);
85
82
  function W(e) {
86
83
  e.key === "Escape" && !R(e) && c.value && !d.persistent && p();
87
84
  }
@@ -9,6 +9,7 @@ declare const selectProps: {
9
9
  flat: BooleanConstructor;
10
10
  native: BooleanConstructor;
11
11
  filterable: BooleanConstructor;
12
+ clearable: BooleanConstructor;
12
13
  filterPlaceholder: {
13
14
  type: StringConstructor;
14
15
  default: string;
@@ -74,7 +75,7 @@ export type SelectOption = {
74
75
  onClick?: () => void | undefined;
75
76
  };
76
77
  export type SelectProps = ExtractPublicPropTypes<typeof selectProps>;
77
- type InternalClasses = 'wrapper' | 'box' | 'truncateCounter' | 'content' | 'search' | 'contentBody' | 'iconWrapper' | 'icon';
78
+ type InternalClasses = 'wrapper' | 'box' | 'truncateCounter' | 'content' | 'search' | 'contentBody' | 'iconWrapper' | 'clearButton' | 'icon';
78
79
  type InternalExtraData = {
79
80
  errorInternal: Ref<boolean>;
80
81
  };
@@ -90,6 +91,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
90
91
  flat: BooleanConstructor;
91
92
  native: BooleanConstructor;
92
93
  filterable: BooleanConstructor;
94
+ clearable: BooleanConstructor;
93
95
  filterPlaceholder: {
94
96
  type: StringConstructor;
95
97
  default: string;
@@ -819,6 +821,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
819
821
  flat: BooleanConstructor;
820
822
  native: BooleanConstructor;
821
823
  filterable: BooleanConstructor;
824
+ clearable: BooleanConstructor;
822
825
  filterPlaceholder: {
823
826
  type: StringConstructor;
824
827
  default: string;
@@ -889,6 +892,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
889
892
  hideFooter: boolean;
890
893
  rules: unknown[];
891
894
  skipFormRegistry: boolean;
895
+ clearable: boolean;
892
896
  multiple: boolean;
893
897
  multipleCheckbox: boolean;
894
898
  truncate: boolean;