sprintify-ui 0.8.15 → 0.8.16

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.
@@ -32050,7 +32050,7 @@ const FI = ["onClick"], HI = { class: "px-2 flex items-center" }, qI = { class:
32050
32050
  props: {
32051
32051
  modelValue: {
32052
32052
  default: void 0,
32053
- type: [Array, null, void 0]
32053
+ type: [Array, String, Number, null, void 0]
32054
32054
  },
32055
32055
  url: {
32056
32056
  required: !0,
@@ -32118,26 +32118,27 @@ const FI = ["onClick"], HI = { class: "px-2 flex items-center" }, qI = { class:
32118
32118
  );
32119
32119
  }
32120
32120
  function d() {
32121
- if (!Array.isArray(r.modelValue)) {
32121
+ let f = r.modelValue;
32122
+ if ((typeof f == "string" || typeof f == "number") && (f = [f + ""]), !Array.isArray(f)) {
32122
32123
  a.value = [];
32123
32124
  return;
32124
32125
  }
32125
- if (r.modelValue.length == 0) {
32126
+ if (f.length == 0) {
32126
32127
  a.value = [];
32127
32128
  return;
32128
32129
  }
32129
- const f = r.modelValue.map((g) => g.toString());
32130
- a.value = a.value.filter((g) => f.includes(g[r.primaryKey] + ""));
32131
- const h = a.value.map((g) => g[r.primaryKey] + "");
32132
- let p = f.filter((g) => !h.includes(g));
32133
- p.length != 0 && (Array.isArray(r.currentModels) && p.forEach((g) => {
32134
- var v;
32135
- const m = (v = r.currentModels) == null ? void 0 : v.find((y) => y[r.primaryKey] == g);
32136
- m && (a.value.push(m), p = p.filter((y) => y != g));
32137
- }), p.length != 0 && r.showRouteUrl != null && i.get(r.showRouteUrl(p)).then((g) => {
32138
- const m = gg(g.data);
32139
- a.value = m.filter((v) => f.includes(v[r.primaryKey] + ""));
32140
- }).catch((g) => g));
32130
+ const h = f.map((m) => m.toString());
32131
+ a.value = a.value.filter((m) => h.includes(m[r.primaryKey] + ""));
32132
+ const p = a.value.map((m) => m[r.primaryKey] + "");
32133
+ let g = h.filter((m) => !p.includes(m));
32134
+ g.length != 0 && (Array.isArray(r.currentModels) && g.forEach((m) => {
32135
+ var y;
32136
+ const v = (y = r.currentModels) == null ? void 0 : y.find((b) => b[r.primaryKey] == m);
32137
+ v && (a.value.push(v), g = g.filter((b) => b != m));
32138
+ }), g.length != 0 && r.showRouteUrl != null && i.get(r.showRouteUrl(g)).then((m) => {
32139
+ const v = gg(m.data);
32140
+ a.value = v.filter((y) => h.includes(y[r.primaryKey] + ""));
32141
+ }).catch((m) => m));
32141
32142
  }
32142
32143
  return t({
32143
32144
  focus: () => {
@@ -3,7 +3,7 @@ import { PropType } from 'vue';
3
3
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
4
4
  modelValue: {
5
5
  default: undefined;
6
- type: PropType<string[] | null | undefined>;
6
+ type: PropType<string | number | string[] | null | undefined>;
7
7
  };
8
8
  url: {
9
9
  required: true;
@@ -60,7 +60,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
60
60
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
61
61
  modelValue: {
62
62
  default: undefined;
63
- type: PropType<string[] | null | undefined>;
63
+ type: PropType<string | number | string[] | null | undefined>;
64
64
  };
65
65
  url: {
66
66
  required: true;
@@ -110,7 +110,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
110
110
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
111
111
  }, {
112
112
  required: boolean;
113
- modelValue: string[] | null | undefined;
113
+ modelValue: string | number | string[] | null | undefined;
114
114
  placeholder: string;
115
115
  disabled: boolean;
116
116
  hasError: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.8.15",
3
+ "version": "0.8.16",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -30,10 +30,7 @@ const Template = (args) => {
30
30
  return {
31
31
  components: { BaseHasMany, ShowValue, BaseAppSnackbars },
32
32
  setup() {
33
- const value = ref([
34
- "4",
35
- "6",
36
- ]);
33
+ const value = ref(4);
37
34
  const currentModels = ref([
38
35
  { id: 4, name: 'Todo 4 (local)' },
39
36
  { id: 6, name: 'Todo 6 (local)' },
@@ -55,7 +55,7 @@ import { getItems } from '@/utils/getApiData';
55
55
  const props = defineProps({
56
56
  modelValue: {
57
57
  default: undefined,
58
- type: [Array, null, undefined] as PropType<string[] | null | undefined>,
58
+ type: [Array, String, Number, null, undefined] as PropType<string[] | string | number | null | undefined>,
59
59
  },
60
60
  url: {
61
61
  required: true,
@@ -141,19 +141,25 @@ function onUpdate(newModels: RawOption[]) {
141
141
 
142
142
  function ensureModelsAreFilled() {
143
143
 
144
- if (!Array.isArray(props.modelValue)) {
144
+ let modelValueInternal = props.modelValue;
145
+
146
+ if (typeof modelValueInternal == 'string' || typeof modelValueInternal == 'number') {
147
+ modelValueInternal = [modelValueInternal + ''];
148
+ }
149
+
150
+ if (!Array.isArray(modelValueInternal)) {
145
151
  models.value = [];
146
152
  return;
147
153
  }
148
154
 
149
- if (props.modelValue.length == 0) {
155
+ if (modelValueInternal.length == 0) {
150
156
  models.value = [];
151
157
  return;
152
158
  }
153
159
 
154
160
  // Remove incorrect models
155
161
 
156
- const ids = props.modelValue.map((id: number | string) => id.toString());
162
+ const ids = modelValueInternal.map((id: number | string) => id.toString());
157
163
 
158
164
  models.value = models.value.filter((m) => ids.includes(m[props.primaryKey] + ''));
159
165