Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stonecrop] use new v-model API #114

Merged
merged 2 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
666 changes: 329 additions & 337 deletions aform/dist/aform.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aform/dist/aform.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aform/dist/aform.umd.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aform/dist/aform.umd.cjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aform/dist/style.css

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions aform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,26 @@
"@stonecrop/themes": "workspace:*",
"@stonecrop/utilities": "workspace:*",
"uuid": "^9.0.0",
"vue": "^3.2.47"
"vue": "^3.4.23"
},
"devDependencies": {
"@histoire/plugin-vue": "^0.16.1",
"@histoire/plugin-vue": "^0.17.17",
"@stonecrop/atable": "workspace:*",
"@types/uuid": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
"@vitejs/plugin-vue": "^4.2.1",
"@vitejs/plugin-vue": "^5.0.4",
"@vitest/coverage-v8": "^1.5.0",
"@vitest/ui": "^1.5.0",
"@vue/test-utils": "^2.3.2",
"cypress": "^12.11.0",
"eslint": "^8.40.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-vue": "^9.11.1",
"histoire": "^0.16.1",
"histoire": "^0.17.17",
"jsdom": "^22.0.0",
"typescript": "^5.0.4",
"vite": "^4.3.5",
"vite": "^5.2.9",
"vitest": "^1.5.0",
"vue-router": "^4"
},
Expand Down
1 change: 0 additions & 1 deletion aform/src/components/AForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ const childModels = computed({
},
set: newValue => {
// Find the component in modelValue and update it
// eslint-disable-next-line vue/no-mutating-props
props.modelValue[i].value = newValue
emit('update:modelValue', props.modelValue)
},
Expand Down
18 changes: 3 additions & 15 deletions aform/src/components/form/ACheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
</template>

<script setup lang="ts">
import { computed, InputHTMLAttributes } from 'vue'
import { InputHTMLAttributes } from 'vue'

const props = withDefaults(
withDefaults(
defineProps<{
label?: string
value?: InputHTMLAttributes['checked']
required?: boolean
readOnly?: boolean
uuid?: string
Expand All @@ -26,18 +25,7 @@ const props = withDefaults(
}
)

const emit = defineEmits<{
(e: 'update:value', value: InputHTMLAttributes['checked']): void
}>()

const checkbox = computed({
get() {
return props.value
},
set(value) {
emit('update:value', value)
},
})
const checkbox = defineModel<InputHTMLAttributes['checked']>()
</script>

<style scoped>
Expand Down
16 changes: 3 additions & 13 deletions aform/src/components/form/ANumericInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@
</template>

<script setup lang="ts">
import { computed } from 'vue'

const props = withDefaults(
withDefaults(
defineProps<{
label: string
modelValue: any
required?: boolean
readonly?: boolean
uuid?: string
Expand All @@ -22,15 +19,8 @@ const props = withDefaults(
validation: () => ({ errorMessage: '&nbsp;' }),
}
)
const emit = defineEmits(['update:modelValue'])
const inputNumber = computed({
get: () => {
return props.modelValue
},
set: newValue => {
emit('update:modelValue', newValue)
},
})

const inputNumber = defineModel<number>()
</script>

<style scoped>
Expand Down
2 changes: 1 addition & 1 deletion aform/tests/checkbox.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('checkbox component', () => {
await wrapper.find('input').setValue(true)
await wrapper.find('input').setValue(false)

const updateEvents = wrapper.emitted('update:value')
const updateEvents = wrapper.emitted('update:modelValue')
expect(updateEvents).toHaveLength(2)
expect(updateEvents![0]).toEqual([true])
expect(updateEvents![1]).toEqual([false])
Expand Down
10 changes: 5 additions & 5 deletions atable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,26 @@
"@stonecrop/themes": "workspace:*",
"@stonecrop/utilities": "workspace:*",
"uuid": "^9.0.0",
"vue": "^3.2.47"
"vue": "^3.4.23"
},
"devDependencies": {
"@histoire/plugin-vue": "^0.16.1",
"@histoire/plugin-vue": "^0.17.17",
"@stonecrop/aform": "workspace:*",
"@types/uuid": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
"@vitejs/plugin-vue": "^4.2.1",
"@vitejs/plugin-vue": "^5.0.4",
"@vitest/coverage-v8": "^1.5.0",
"@vitest/ui": "^1.5.0",
"@vue/test-utils": "^2.3.2",
"cypress": "^12.11.0",
"eslint": "^8.40.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-vue": "^9.11.1",
"histoire": "^0.16.1",
"histoire": "^0.17.17",
"jsdom": "^22.0.0",
"typescript": "^5.0.4",
"vite": "^4.3.5",
"vite": "^5.2.9",
"vitest": "^1.5.0",
"vue-router": "^4"
},
Expand Down
4 changes: 2 additions & 2 deletions beam/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions beam/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
},
"dependencies": {
"portal-vue": "~3.0.0-beta.0",
"vue": "^3.2.47"
"vue": "^3.4.23"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.0.0",
"cypress": "^12.2.0",
"portal-vue": "^3.0.0",
"vite": "^4.3.5",
"vite": "^5.2.9",
"vue-router": "^4"
},
"engines": {
Expand Down
1 change: 1 addition & 0 deletions beam/src/ItemCheck.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default {
},
}
</script>

<style scoped>
.container {
display: block;
Expand Down
10 changes: 5 additions & 5 deletions code_editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@
"@stonecrop/utilities": "workspace:*",
"@monaco-editor/loader": "~1.3.2",
"monaco-editor": "~0.34.1",
"vue": "^3.2.47"
"vue": "^3.4.23"
},
"devDependencies": {
"@stonecrop/atable": "workspace:*",
"@histoire/plugin-vue": "^0.16.1",
"@histoire/plugin-vue": "^0.17.17",
"@types/uuid": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
"@vitejs/plugin-vue": "^4.2.1",
"@vitejs/plugin-vue": "^5.0.4",
"cypress": "^12.11.0",
"eslint": "^8.40.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-vue": "^9.11.1",
"histoire": "^0.16.1",
"histoire": "^0.17.17",
"typescript": "^5.0.4",
"vite": "^4.3.5",
"vite": "^5.2.9",
"vue-router": "^4"
},
"engines": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@stonecrop/aform",
"comment": "Use new v-model API",
"type": "none"
}
],
"packageName": "@stonecrop/aform"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@stonecrop/atable",
"comment": "Version bump",
"type": "none"
}
],
"packageName": "@stonecrop/atable"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@stonecrop/code-editor",
"comment": "Version bump",
"type": "none"
}
],
"packageName": "@stonecrop/code-editor"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@stonecrop/desktop",
"comment": "Version bump",
"type": "none"
}
],
"packageName": "@stonecrop/desktop"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@stonecrop/graphql-client",
"comment": "Version bump",
"type": "none"
}
],
"packageName": "@stonecrop/graphql-client"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@stonecrop/node-editor",
"comment": "Version bump",
"type": "none"
}
],
"packageName": "@stonecrop/node-editor"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@stonecrop/stonecrop",
"comment": "Version bump",
"type": "none"
}
],
"packageName": "@stonecrop/stonecrop"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@stonecrop/themes",
"comment": "Version bump",
"type": "none"
}
],
"packageName": "@stonecrop/themes"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@stonecrop/utilities",
"comment": "Version bump",
"type": "none"
}
],
"packageName": "@stonecrop/utilities"
}
Loading
Loading