Skip to content

Commit

Permalink
chore: build, cl, version
Browse files Browse the repository at this point in the history
  • Loading branch information
adamberecz committed Mar 14, 2023
1 parent c44f3c8 commit b192b63
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 15 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## v2.6.1

> `2023-03-14`
### 🐞 Bug Fixes
- Use `.mjs` for `import`.

## v2.6.0

> `2023-03-11`
Expand Down
2 changes: 1 addition & 1 deletion dist/multiselect.global.js

Large diffs are not rendered by default.

22 changes: 18 additions & 4 deletions dist/multiselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ function useOptions (props, context, dep)
let groups = [...eg.value].map(g => ({...g}));

if (createdOption.value.length) {
if (groups[0]?.__CREATE__) {
if (groups[0] && groups[0].__CREATE__) {
groups[0][groupOptions.value] = [...createdOption.value, ...groups[0][groupOptions.value]];
} else {
groups = [{
Expand Down Expand Up @@ -2221,9 +2221,23 @@ function useI18n (props, context, dep)
// =============== METHODS ==============

const localize = (target) => {
return target && typeof target === 'object'
? target?.[locale.value] || target?.[locale.value?.toUpperCase()] || target?.[fallbackLocale.value] || target?.[fallbackLocale.value?.toUpperCase()] || target?.[Object.keys(target)[0]]
: target
if (!target || typeof target !== 'object') {
return target
}

if (target && target[locale.value]) {
return target[locale.value]
} else if (target && locale.value && target[locale.value.toUpperCase()]) {
return target[locale.value.toUpperCase()]
} else if (target && target[fallbackLocale.value]) {
return target[fallbackLocale.value]
} else if (target && fallbackLocale.value && target[fallbackLocale.value.toUpperCase()]) {
return target[fallbackLocale.value.toUpperCase()]
} else if (target && Object.keys(target)[0]) {
return target[Object.keys(target)[0]]
} else {
return ''
}
};

return {
Expand Down
22 changes: 18 additions & 4 deletions dist/multiselect.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ function useOptions (props, context, dep)
let groups = [...eg.value].map(g => ({...g}));

if (createdOption.value.length) {
if (groups[0]?.__CREATE__) {
if (groups[0] && groups[0].__CREATE__) {
groups[0][groupOptions.value] = [...createdOption.value, ...groups[0][groupOptions.value]];
} else {
groups = [{
Expand Down Expand Up @@ -2221,9 +2221,23 @@ function useI18n (props, context, dep)
// =============== METHODS ==============

const localize = (target) => {
return target && typeof target === 'object'
? target?.[locale.value] || target?.[locale.value?.toUpperCase()] || target?.[fallbackLocale.value] || target?.[fallbackLocale.value?.toUpperCase()] || target?.[Object.keys(target)[0]]
: target
if (!target || typeof target !== 'object') {
return target
}

if (target && target[locale.value]) {
return target[locale.value]
} else if (target && locale.value && target[locale.value.toUpperCase()]) {
return target[locale.value.toUpperCase()]
} else if (target && target[fallbackLocale.value]) {
return target[fallbackLocale.value]
} else if (target && fallbackLocale.value && target[fallbackLocale.value.toUpperCase()]) {
return target[fallbackLocale.value.toUpperCase()]
} else if (target && Object.keys(target)[0]) {
return target[Object.keys(target)[0]]
} else {
return ''
}
};

return {
Expand Down
2 changes: 1 addition & 1 deletion dist/multiselect.vue2.global.js

Large diffs are not rendered by default.

22 changes: 18 additions & 4 deletions dist/multiselect.vue2.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ function useOptions (props, context, dep)
let groups = [...eg.value].map(g => ({...g}));

if (createdOption.value.length) {
if (groups[0]?.__CREATE__) {
if (groups[0] && groups[0].__CREATE__) {
groups[0][groupOptions.value] = [...createdOption.value, ...groups[0][groupOptions.value]];
} else {
groups = [{
Expand Down Expand Up @@ -2221,9 +2221,23 @@ function useI18n (props, context, dep)
// =============== METHODS ==============

const localize = (target) => {
return target && typeof target === 'object'
? target?.[locale.value] || target?.[locale.value?.toUpperCase()] || target?.[fallbackLocale.value] || target?.[fallbackLocale.value?.toUpperCase()] || target?.[Object.keys(target)[0]]
: target
if (!target || typeof target !== 'object') {
return target
}

if (target && target[locale.value]) {
return target[locale.value]
} else if (target && locale.value && target[locale.value.toUpperCase()]) {
return target[locale.value.toUpperCase()]
} else if (target && target[fallbackLocale.value]) {
return target[fallbackLocale.value]
} else if (target && fallbackLocale.value && target[fallbackLocale.value.toUpperCase()]) {
return target[fallbackLocale.value.toUpperCase()]
} else if (target && Object.keys(target)[0]) {
return target[Object.keys(target)[0]]
} else {
return ''
}
};

return {
Expand Down
27 changes: 26 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vueform/multiselect",
"version": "2.6.0",
"version": "2.6.1",
"private": false,
"description": "Vue 3 multiselect component with single select, multiselect and tagging options.",
"license": "MIT",
Expand All @@ -9,7 +9,32 @@
"types": "./src/index.d.ts",
"module": "./dist/multiselect.mjs",
"unpkg": "./dist/multiselect.global.js",
"jsdelivr": "./dist/multiselect.global.js",
"style": "./themes/default.css",
"exports": {
".": {
"types": "./src/index.d.ts",
"node": {
"import": {
"production": "./dist/multiselect.mjs",
"development": "./dist/multiselect.mjs",
"default": "./dist/multiselect.mjs"
},
"require": {
"production": "./dist/multiselect.js",
"development": "./dist/multiselect.js",
"default": "./dist/multiselect.js"
}
},
"import": "./dist/multiselect.mjs",
"require": "./dist/multiselect.js"
},
"./src/*": "./src/*",
"./dist/*": "./dist/*",
"./themes/*": "./themes/*",
"./package.json": "./package.json"
},
"sideEffects": false,
"repository": {
"type": "git",
"url": "git+https://github.com/vueform/multiselect.git"
Expand Down

0 comments on commit b192b63

Please sign in to comment.