ivue 0.1.11 → 1.0.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.
- package/.editorconfig +9 -0
- package/.eslintignore +7 -0
- package/.eslintrc copy.js +120 -0
- package/.eslintrc.js +120 -0
- package/.github/workflows/ci.yml +68 -0
- package/.prettierrc +5 -0
- package/LICENSE +2 -2
- package/README.md +20 -28
- package/demo/App.vue +113 -56
- package/demo/main.ts +5 -19
- package/demo/vite.config.ts +8 -1
- package/docs/.editorconfig +9 -0
- package/docs/.env +1 -0
- package/docs/.eslintignore +7 -0
- package/docs/.eslintrc.js +120 -0
- package/docs/.prettierrc +5 -0
- package/docs/docs/.vitepress/config.ts +56 -0
- package/docs/docs/api/propsWithDefaults.md +0 -0
- package/docs/docs/components/Button.vue +13 -0
- package/docs/docs/components/Component.vue +20 -0
- package/docs/docs/components/examples/Counter.vue +17 -0
- package/docs/docs/index.md +32 -0
- package/docs/docs/pages/getting-started.md +14 -0
- package/docs/docs/pages/how-it-works.md +0 -0
- package/docs/docs/pages/introduction.md +45 -0
- package/docs/docs/pages/usage.md +16 -0
- package/docs/package.json +35 -0
- package/docs/scripts/gh-pages-deploy.js +34 -0
- package/docs/vite-env.d.ts +7 -0
- package/docs/vite.config.ts +20 -0
- package/index.html +5 -4
- package/package.json +46 -61
- package/src/__tests__/ivue.vitest.spec.ts +426 -0
- package/src/index.ts +460 -80
- package/tsconfig.json +21 -11
- package/vite-env.d.ts +7 -0
- package/vite.config.ts +26 -26
- package/vitest.config.ts +13 -12
- package/.babelrc.json +0 -14
- package/.eslintrc.cjs +0 -24
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/compiler.xml +0 -7
- package/.idea/inspectionProfiles/Project_Default.xml +0 -11
- package/.idea/ivue.iml +0 -10
- package/.idea/modules.xml +0 -8
- package/.idea/php.xml +0 -20
- package/.idea/vcs.xml +0 -6
- package/.vscode/extensions.json +0 -3
- package/PLAN.md +0 -39
- package/demo/components/IVueTest.vue +0 -301
- package/demo/components/PreComponent.vue +0 -13
- package/demo/components/SubComponent2.vue +0 -45
- package/demo/components/TraitsComponent.vue +0 -120
- package/demo/components/useIVueTest.vue +0 -136
- package/demo/router/index.ts +0 -14
- package/demo/tests/IVueTests.ts +0 -265
- package/demo/tests/Mouse.ts +0 -79
- package/demo/tests/ParentIVueTests.ts +0 -36
- package/demo/tests/TApp.ts +0 -15
- package/demo/tests/TAuth.ts +0 -23
- package/demo/tests/TField.ts +0 -84
- package/demo/tests/TMessage.ts +0 -52
- package/demo/tests/TRouter.ts +0 -18
- package/demo/tests/TUser.ts +0 -19
- package/demo/tests/Test.ts +0 -86
- package/demo/tests/useField.ts +0 -82
- package/demo/tests/useIVueTests.ts +0 -57
- package/dist/favicon.ico +0 -0
- package/dist/index.es.js +0 -516
- package/dist/index.umd.js +0 -1
- package/dist/src/behavior.d.ts +0 -72
- package/dist/src/config.d.ts +0 -6
- package/dist/src/index.d.ts +0 -21
- package/dist/src/ivue.d.ts +0 -36
- package/dist/src/kernel.d.ts +0 -182
- package/dist/src/traits/UseCapsule.d.ts +0 -9
- package/dist/src/traits/UseEmit.d.ts +0 -3
- package/dist/src/traits/UseInstance.d.ts +0 -6
- package/dist/src/traits/UseMounting.d.ts +0 -11
- package/dist/src/traits/UseRefs.d.ts +0 -8
- package/dist/src/traits/UseRoute.d.ts +0 -3
- package/dist/src/traits/UseRouter.d.ts +0 -3
- package/dist/src/traits/UseRouting.d.ts +0 -6
- package/dist/src/traits/UseTick.d.ts +0 -4
- package/dist/src/traits/UseVue.d.ts +0 -13
- package/dist/src/types/core.d.ts +0 -46
- package/dist/src/utils/dispose-garbage.d.ts +0 -12
- package/dist/src/utils/extend.d.ts +0 -12
- package/dist/src/utils/getters.d.ts +0 -21
- package/dist/src/utils/index.d.ts +0 -7
- package/dist/src/utils/is.d.ts +0 -14
- package/dist/src/utils/pre.d.ts +0 -9
- package/dist/src/utils/raw.d.ts +0 -12
- package/dist/src/utils/safe-class-name.d.ts +0 -7
- package/dist/src/utils/traits.d.ts +0 -41
- package/env.d.ts +0 -1
- package/package-lock.json +0 -14305
- package/public/favicon.ico +0 -0
- package/src/App/App.ts +0 -30
- package/src/App/Auth/Auth.ts +0 -105
- package/src/App/Auth/Auth.vue +0 -98
- package/src/App/Auth/Logout.vue +0 -14
- package/src/App/Auth/User.ts +0 -6
- package/src/App/BlackBox.ts +0 -82
- package/src/App/Config.ts +0 -6
- package/src/App/Generators/generators.ts +0 -47
- package/src/App/Home/Home.vue +0 -16
- package/src/App/Services/Http/FakeHttp.ts +0 -8
- package/src/App/Services/Http/Http.ts +0 -51
- package/src/App/Services/Message/Message.ts +0 -49
- package/src/App/Services/Message/Message.vue +0 -15
- package/src/App/Services/Navigation/Navigation.ts +0 -83
- package/src/App/Services/Navigation/Navigation.vue +0 -59
- package/src/App/Services/Routing/FakeRouter.ts +0 -7
- package/src/App/Services/Routing/NotFoundRoute.vue +0 -13
- package/src/App/Services/Routing/Router.ts +0 -263
- package/src/App/Services/Routing/Routes.ts +0 -49
- package/src/App/Stubs/SingleBookResultStub.ts +0 -13
- package/src/App/Traits/UseApp.ts +0 -6
- package/src/App/Traits/UseQuasar.ts +0 -8
- package/src/behavior.ts +0 -269
- package/src/config.ts +0 -15
- package/src/dev/dev-utils.ts +0 -78
- package/src/ivue.ts +0 -299
- package/src/kernel.ts +0 -815
- package/src/tests/auth.spec.ts +0 -87
- package/src/traits/UseCapsule.ts +0 -28
- package/src/traits/UseEmit.ts +0 -3
- package/src/traits/UseInstance.ts +0 -17
- package/src/traits/UseMounting.ts +0 -23
- package/src/traits/UseRefs.ts +0 -17
- package/src/traits/UseRoute.ts +0 -6
- package/src/traits/UseRouter.ts +0 -5
- package/src/traits/UseRouting.ts +0 -7
- package/src/traits/UseTick.ts +0 -5
- package/src/traits/UseVue.ts +0 -38
- package/src/types/core.ts +0 -66
- package/src/utils/dispose-garbage.ts +0 -34
- package/src/utils/extend.ts +0 -86
- package/src/utils/getters.ts +0 -59
- package/src/utils/index.ts +0 -16
- package/src/utils/is.ts +0 -22
- package/src/utils/pre.ts +0 -29
- package/src/utils/raw.ts +0 -19
- package/src/utils/safe-class-name.ts +0 -15
- package/src/utils/traits.ts +0 -121
- package/tsconfig.app.json +0 -47
- package/tsconfig.node.json +0 -14
- package/tsconfig.vitest.json +0 -9
- /package/{src/App/Traits/UseBlackline.ts → docs/docs/api/ivue.md} +0 -0
package/vitest.config.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { fileURLToPath } from
|
|
2
|
-
import { mergeConfig } from
|
|
3
|
-
import { configDefaults, defineConfig } from
|
|
4
|
-
import viteConfig from
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
import { mergeConfig } from "vite";
|
|
3
|
+
import { configDefaults, defineConfig } from "vitest/config";
|
|
4
|
+
import viteConfig from "./vite.config";
|
|
5
5
|
|
|
6
6
|
export default mergeConfig(
|
|
7
7
|
viteConfig,
|
|
8
8
|
defineConfig({
|
|
9
9
|
test: {
|
|
10
|
-
environment:
|
|
11
|
-
exclude: [...configDefaults.exclude,
|
|
12
|
-
root: fileURLToPath(new URL(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
environment: "jsdom",
|
|
11
|
+
exclude: [...configDefaults.exclude, "e2e/*", "**/demo/**"],
|
|
12
|
+
root: fileURLToPath(new URL("./", import.meta.url)),
|
|
13
|
+
reporters: ["default", "html", "verbose"],
|
|
14
|
+
coverage: {
|
|
15
|
+
include: ['src/**']
|
|
16
|
+
}
|
|
17
|
+
},
|
|
17
18
|
})
|
|
18
|
-
)
|
|
19
|
+
);
|
package/.babelrc.json
DELETED
package/.eslintrc.cjs
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/* eslint-env node */
|
|
2
|
-
require('@rushstack/eslint-patch/modern-module-resolution')
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
root: true,
|
|
6
|
-
'extends': [
|
|
7
|
-
'plugin:vue/vue3-essential',
|
|
8
|
-
'eslint:recommended',
|
|
9
|
-
'@vue/eslint-config-typescript'
|
|
10
|
-
],
|
|
11
|
-
parserOptions: {
|
|
12
|
-
ecmaVersion: 'latest',
|
|
13
|
-
"ecmaFeatures": {
|
|
14
|
-
"jsx": true,
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"env": {
|
|
18
|
-
"browser": true,
|
|
19
|
-
"node": true,
|
|
20
|
-
"jasmine": true,
|
|
21
|
-
"jest": true,
|
|
22
|
-
"es6": true
|
|
23
|
-
}
|
|
24
|
-
}
|
package/.idea/compiler.xml
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<component name="InspectionProjectProfileManager">
|
|
2
|
-
<profile version="1.0">
|
|
3
|
-
<option name="myName" value="Project Default" />
|
|
4
|
-
<inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
|
5
|
-
<Languages>
|
|
6
|
-
<language minSize="46" name="TypeScript" />
|
|
7
|
-
</Languages>
|
|
8
|
-
</inspection_tool>
|
|
9
|
-
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
|
10
|
-
</profile>
|
|
11
|
-
</component>
|
package/.idea/ivue.iml
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="WEB_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager">
|
|
4
|
-
<content url="file://$MODULE_DIR$">
|
|
5
|
-
<excludeFolder url="file://$MODULE_DIR$/node_modules" />
|
|
6
|
-
</content>
|
|
7
|
-
<orderEntry type="inheritedJdk" />
|
|
8
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
9
|
-
</component>
|
|
10
|
-
</module>
|
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/../ivue/.idea/ivue.iml" filepath="$PROJECT_DIR$/../ivue/.idea/ivue.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
package/.idea/php.xml
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="MessDetectorOptionsConfiguration">
|
|
4
|
-
<option name="transferred" value="true" />
|
|
5
|
-
</component>
|
|
6
|
-
<component name="PHPCSFixerOptionsConfiguration">
|
|
7
|
-
<option name="transferred" value="true" />
|
|
8
|
-
</component>
|
|
9
|
-
<component name="PHPCodeSnifferOptionsConfiguration">
|
|
10
|
-
<option name="highlightLevel" value="WARNING" />
|
|
11
|
-
<option name="transferred" value="true" />
|
|
12
|
-
</component>
|
|
13
|
-
<component name="PhpProjectSharedConfiguration" php_language_level="8.2" />
|
|
14
|
-
<component name="PhpStanOptionsConfiguration">
|
|
15
|
-
<option name="transferred" value="true" />
|
|
16
|
-
</component>
|
|
17
|
-
<component name="PsalmOptionsConfiguration">
|
|
18
|
-
<option name="transferred" value="true" />
|
|
19
|
-
</component>
|
|
20
|
-
</project>
|
package/.idea/vcs.xml
DELETED
package/.vscode/extensions.json
DELETED
package/PLAN.md
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
## Test ivue
|
|
2
|
-
|
|
3
|
-
### Test basic reactivity
|
|
4
|
-
- make sure basic reactivity works
|
|
5
|
-
- primitives, objects, arrays
|
|
6
|
-
|
|
7
|
-
### Test nested component instantiation and unloading reactivity
|
|
8
|
-
- ☑ tested now to 2 levels deep
|
|
9
|
-
- test it to 3-4 levels deep
|
|
10
|
-
- if components using use(ClassName) function are mounted/unmounted properly
|
|
11
|
-
|
|
12
|
-
### Test traits
|
|
13
|
-
- convert existing inside component tests to real automated tests
|
|
14
|
-
|
|
15
|
-
### Test getter computeds
|
|
16
|
-
- test getter computeds to at least 3 levels deep
|
|
17
|
-
|
|
18
|
-
### Test getters with use() and init() inside
|
|
19
|
-
- the variables instantiated within init() method should not cause a recompute
|
|
20
|
-
|
|
21
|
-
### Test behaviors
|
|
22
|
-
- class initialization before/after
|
|
23
|
-
- method call before/after
|
|
24
|
-
- test conditional before/after class/method substitution
|
|
25
|
-
|
|
26
|
-
### Test Kernel
|
|
27
|
-
- test bind() points to bound object
|
|
28
|
-
- use() should instantiate a singleton
|
|
29
|
-
- init() should instantiate a transient
|
|
30
|
-
- get() should instantiate non-reactive js singleton
|
|
31
|
-
- make() should instantiate non-reactive js transient
|
|
32
|
-
|
|
33
|
-
### Test ivue utils
|
|
34
|
-
- test extend function as props assignment
|
|
35
|
-
- test extend with .props as a property
|
|
36
|
-
- or when extend, extends the base class properties
|
|
37
|
-
- which approach is better (the second one becomes closer to vue 2 options api)
|
|
38
|
-
- extend function should have 'extendClasses' option
|
|
39
|
-
- so we can enable extension of class based objects as well, by default we only extend simple objects not class objects
|
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, provide, onUnmounted, onBeforeUnmount, getCurrentInstance, onMounted, markRaw } from 'vue';
|
|
3
|
-
import { IVueTests } from "../tests/IVueTests";
|
|
4
|
-
import { bind, ivue, use, init, pre, kernel } from '@/index'
|
|
5
|
-
import SubComponent2 from './SubComponent2.vue'
|
|
6
|
-
import TraitsComponent from './TraitsComponent.vue'
|
|
7
|
-
import { Mouse } from '../tests/Mouse';
|
|
8
|
-
import { getPrototypeGetters } from '../../src/utils/getters';
|
|
9
|
-
|
|
10
|
-
console.log('loaded')
|
|
11
|
-
let vm: IVueTests = use(IVueTests)
|
|
12
|
-
provide('mouse', ivue(Mouse))
|
|
13
|
-
const localComputedValue = computed(() => {
|
|
14
|
-
return vm.computedVariable?.[0]?.test + ' + local append'
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
vm.setTest('yes')
|
|
18
|
-
console.log(vm.test)
|
|
19
|
-
const hugeId = 2646049
|
|
20
|
-
|
|
21
|
-
function hey () {
|
|
22
|
-
console.log('yo')
|
|
23
|
-
}
|
|
24
|
-
// onMounted(() => console.log('kernel.instances.get(IVueTests)', kernel.instances.get(IVueTests)))
|
|
25
|
-
// onBeforeUnmount(() => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
// })
|
|
29
|
-
// onUnmounted(() => console.log('kernel.instances.get(IVueTests)', kernel.instances.get(IVueTests)))
|
|
30
|
-
</script>
|
|
31
|
-
<template>
|
|
32
|
-
|
|
33
|
-
<h2>Sub Component Test</h2>
|
|
34
|
-
<router-view @testEmit="hey"></router-view>
|
|
35
|
-
<div style="width:900px; margin:0 auto;">
|
|
36
|
-
|
|
37
|
-
<h1>ivue - Infinite Vue - Implementation Tests</h1>
|
|
38
|
-
<!-- <vue-dd v-model="vm" get-all-properties/> -->
|
|
39
|
-
|
|
40
|
-
<h2>Class Inheritance Tests</h2>
|
|
41
|
-
|
|
42
|
-
vm.parentValue: <input v-model="vm.parentValue" /><br />
|
|
43
|
-
<button @click="vm.parentValueAlert()">vm.parentValueAlert()</button>
|
|
44
|
-
|
|
45
|
-
<h2>Computed Resolution Tests</h2>
|
|
46
|
-
<hr />
|
|
47
|
-
<h3>Primitive Computed Tests</h3>
|
|
48
|
-
<table>
|
|
49
|
-
<tr>
|
|
50
|
-
<td class="label"><strong>vm.computedPrimitive</strong></td>
|
|
51
|
-
<td class="value">{{ vm.computedPrimitive }}
|
|
52
|
-
<button @click="vm.primitive++">Change Primitive</button>
|
|
53
|
-
</td>
|
|
54
|
-
</tr>
|
|
55
|
-
<tr>
|
|
56
|
-
<td class="label"><strong>localComputedValue</strong> (refers to vm.computedVariable.[0].test):</td>
|
|
57
|
-
<td class="value">{{ localComputedValue }}</td>
|
|
58
|
-
</tr>
|
|
59
|
-
<tr>
|
|
60
|
-
<td class="label"><strong>vm.auth.user.email:</strong></td>
|
|
61
|
-
<td class="value"><input
|
|
62
|
-
type="text"
|
|
63
|
-
style="width:250px;"
|
|
64
|
-
v-model="vm.auth.user.email"
|
|
65
|
-
/></td>
|
|
66
|
-
</tr>
|
|
67
|
-
<tr>
|
|
68
|
-
<td class="label"><strong>vm.auth.user.upperCaseEmail:</strong></td>
|
|
69
|
-
<td class="value">{{ vm.auth.user.upperCaseEmail }}</td>
|
|
70
|
-
</tr>
|
|
71
|
-
<tr>
|
|
72
|
-
<td class="label">vm.auth.user.dashedUppercaseEmail</td>
|
|
73
|
-
<td class="value">
|
|
74
|
-
<span v-for="i in vm.auth.user.dashedUppercaseEmail">
|
|
75
|
-
<span>{{ i }}</span>-
|
|
76
|
-
</span>
|
|
77
|
-
</td>
|
|
78
|
-
</tr>
|
|
79
|
-
<tr>
|
|
80
|
-
<td class="label">vm.auth.user.dashedUppercaseEmail (colored):</td>
|
|
81
|
-
<td class="value">
|
|
82
|
-
<span v-for="i in vm.auth.user.dashedUppercaseEmail">
|
|
83
|
-
<span style="color:green">{{ i }}</span>-
|
|
84
|
-
</span>
|
|
85
|
-
</td>
|
|
86
|
-
</tr>
|
|
87
|
-
<tr>
|
|
88
|
-
<td class="label">Deep circular resolution test of vm.deepEmail:</td>
|
|
89
|
-
<td class="value">{{ vm.deepEmail }}</td>
|
|
90
|
-
</tr>
|
|
91
|
-
</table>
|
|
92
|
-
|
|
93
|
-
<h3>Complex (Objects/Arrays from other stores) Computed Tests</h3>
|
|
94
|
-
<button @click="vm.pushToOriginalVariableInAuthRepo()">vm.pushToOriginalVariableInAuthRepo()</button>
|
|
95
|
-
<br />
|
|
96
|
-
<button @click="vm.computedVariable = [{
|
|
97
|
-
test: 'set 1', test2: 'set 2'
|
|
98
|
-
}]">Setter on a computed vm.computedVariable (resets vm.auth.originalVariable)
|
|
99
|
-
</button>
|
|
100
|
-
<br />
|
|
101
|
-
<strong>vm.auth.originalVariable:</strong><br />
|
|
102
|
-
|
|
103
|
-
<div v-for="el in vm.auth.originalVariable">
|
|
104
|
-
test:<input v-model="el.test" /> test2: <input v-model="el.test2" />
|
|
105
|
-
</div>
|
|
106
|
-
|
|
107
|
-
<br />
|
|
108
|
-
<strong>vm.computedVariable:</strong>
|
|
109
|
-
<div v-for="el in vm.computedVariable">
|
|
110
|
-
test:<input v-model="el.test" /> test2: <input v-model="el.test2" />
|
|
111
|
-
</div>
|
|
112
|
-
<br />
|
|
113
|
-
<strong>vm.computedUponComputedVariable:</strong>
|
|
114
|
-
<div v-for="el in vm.computedUponComputedVariable">
|
|
115
|
-
test:<input v-model="el.test" /> test2: <input v-model="el.test2" />
|
|
116
|
-
</div>
|
|
117
|
-
<br />
|
|
118
|
-
<h2>Async Function Test</h2>
|
|
119
|
-
<hr />
|
|
120
|
-
<span>Loader: <span v-if="vm.loading">loading...</span></span><br />
|
|
121
|
-
<span>Result: {{ vm.result }}</span><br />
|
|
122
|
-
<button @click="vm.runAsyncFunction">runAsyncFunction() (wait for 2 seconds)</button>
|
|
123
|
-
<h2>Huge Data Test</h2>
|
|
124
|
-
<hr />
|
|
125
|
-
<input v-model="vm.numberOfRecords" />
|
|
126
|
-
<button @click="vm.loadHugeData(vm.numberOfRecords)">Load Huge Data
|
|
127
|
-
({{ vm.numberOfRecords.toLocaleString("en-US") }} records)
|
|
128
|
-
</button>
|
|
129
|
-
<br /> Loader: <strong>{{
|
|
130
|
-
vm.loadingHugeData ?
|
|
131
|
-
'loading ' + vm.numberOfRecords.toLocaleString("en-US") + ' records ...'
|
|
132
|
-
: ''
|
|
133
|
-
}}</strong>
|
|
134
|
-
<div
|
|
135
|
-
style="color:green"
|
|
136
|
-
v-if="vm.timeTaken"
|
|
137
|
-
>Loaded in {{ vm.msToTime(vm.timeTaken) }}.</div>
|
|
138
|
-
|
|
139
|
-
<div v-if="hugeId in vm.hugeArray">
|
|
140
|
-
<h3>Editing Record #{{ hugeId.toLocaleString("en-US") }}</h3>
|
|
141
|
-
user: <input v-model="vm.hugeArray[hugeId].struct.user" /><br />
|
|
142
|
-
text: <input v-model="vm.hugeArray[hugeId].struct.text" />
|
|
143
|
-
<pre style="font-size:10px; line-height:10px;">{{ vm.hugeArray[hugeId] }}</pre>
|
|
144
|
-
</div>
|
|
145
|
-
<h2>markRaw Tests</h2>
|
|
146
|
-
<div>nonReactiveProp is disabled:</div>
|
|
147
|
-
<vue-dd
|
|
148
|
-
name="nonReactiveProp"
|
|
149
|
-
v-model="vm.nonReactiveProp"
|
|
150
|
-
:preview="0"
|
|
151
|
-
:dark="false"
|
|
152
|
-
:open-level="2"
|
|
153
|
-
/>
|
|
154
|
-
<div v-if="vm.transientFields?.[0]">
|
|
155
|
-
Email: {{ vm.transientFields?.[0]?.email }}<br /> {{ vm.transientFields[10].x }}
|
|
156
|
-
</div>
|
|
157
|
-
<input type="text" v-model="vm.app.user.email" />
|
|
158
|
-
<h2>Private prop test</h2>
|
|
159
|
-
<div>vm.x: {{ vm.x }}
|
|
160
|
-
<button @click="vm.x++">Increase</button>
|
|
161
|
-
</div>
|
|
162
|
-
<br />
|
|
163
|
-
|
|
164
|
-
<h2>Transients Test</h2>
|
|
165
|
-
<div>vm.transientField1.prop: {{ vm.transientField1.prop }}
|
|
166
|
-
<button @click="vm.transientField1.prop++">Increase++</button>
|
|
167
|
-
</div>
|
|
168
|
-
<div>vm.transientField2.prop: {{ vm.transientField2.prop }}
|
|
169
|
-
<button @click="vm.transientField2.prop++">Increase++</button>
|
|
170
|
-
</div>
|
|
171
|
-
<div>Computed vm.propTransient: {{ vm.propTransient }}</div>
|
|
172
|
-
<h2>Intercepts Test</h2>
|
|
173
|
-
<div>vm.transientField2.runWithIntercept(): {{ vm.transientField2.runWithInterceptResult }}
|
|
174
|
-
<button @click="vm.transientField2.runWithInterceptResult = vm.transientField2.runWithIntercept('test')">
|
|
175
|
-
vm.transientField2.runWithIntercept()
|
|
176
|
-
</button>
|
|
177
|
-
</div>
|
|
178
|
-
<br />
|
|
179
|
-
<br />
|
|
180
|
-
<br />
|
|
181
|
-
<TraitsComponent />
|
|
182
|
-
<br />
|
|
183
|
-
<br />
|
|
184
|
-
<br />
|
|
185
|
-
<br />
|
|
186
|
-
</div>
|
|
187
|
-
</template>
|
|
188
|
-
<style>
|
|
189
|
-
.rendererParent {
|
|
190
|
-
width: 100%;
|
|
191
|
-
height: 580px;
|
|
192
|
-
border: 1px solid black;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
h1,
|
|
196
|
-
h2,
|
|
197
|
-
h3,
|
|
198
|
-
h4 {
|
|
199
|
-
font-family: Arial;
|
|
200
|
-
margin: 10px 0;
|
|
201
|
-
padding: 0;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
h1 {
|
|
205
|
-
font-size: 24px;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
h2 {
|
|
209
|
-
font-size: 18px;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
h3 {
|
|
213
|
-
font-size: 16px;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
h4 {
|
|
217
|
-
font-size: 14px;
|
|
218
|
-
margin: 0 5px;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
body {
|
|
222
|
-
font-family: Arial;
|
|
223
|
-
font-size: 14px;
|
|
224
|
-
line-height: 200%;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
.body {
|
|
228
|
-
max-width: 1000px;
|
|
229
|
-
margin: 0 auto;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
.section {
|
|
233
|
-
padding: 5px 0;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.section-alt {
|
|
237
|
-
padding: 15px;
|
|
238
|
-
background: #edf1f6;
|
|
239
|
-
border-radius: 10px;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
button {
|
|
243
|
-
color: #eee;
|
|
244
|
-
border-radius: 5px;
|
|
245
|
-
border: 0;
|
|
246
|
-
font-size: 16px;
|
|
247
|
-
background: #0075d3;
|
|
248
|
-
margin: 1px 3px;
|
|
249
|
-
padding: 4px 7px;
|
|
250
|
-
display: inline-block;
|
|
251
|
-
cursor: pointer;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
button:hover {
|
|
255
|
-
background: #08277a;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
button.pass:hover {
|
|
259
|
-
background: green;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
button.fail:hover {
|
|
263
|
-
background: red;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
button:active {
|
|
267
|
-
background: #294dab;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
input {
|
|
271
|
-
color: #333;
|
|
272
|
-
border-radius: 5px;
|
|
273
|
-
border: 0;
|
|
274
|
-
width: 250px;
|
|
275
|
-
font-size: 16px;
|
|
276
|
-
background: #eee;
|
|
277
|
-
border: 1px solid #0075d3;
|
|
278
|
-
margin: 1px 3px;
|
|
279
|
-
padding: 4px 7px;
|
|
280
|
-
display: inline-block;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
.mr-10 {
|
|
284
|
-
margin-right: 10px;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.pass {
|
|
288
|
-
background: #00c200;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
.fail {
|
|
292
|
-
background: #c00606
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
td.label {
|
|
296
|
-
text-align: right;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
td.value {
|
|
300
|
-
padding-left: 20px;
|
|
301
|
-
}</style>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { TUser } from '../tests/TUser';
|
|
3
|
-
import { iobj, use, pre } from '@/index';
|
|
4
|
-
|
|
5
|
-
const ctx = iobj({
|
|
6
|
-
test: 1,
|
|
7
|
-
get user () { return use(TUser) },
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
</script>
|
|
11
|
-
<template>
|
|
12
|
-
<pre style="font-size:10px;line-height:12px;">{{ pre(ctx) }}</pre>
|
|
13
|
-
</template>
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// use normal <script> to declare options
|
|
3
|
-
export default {
|
|
4
|
-
inheritAttrs: false,
|
|
5
|
-
};
|
|
6
|
-
</script>
|
|
7
|
-
<script setup lang="ts">
|
|
8
|
-
import { getCurrentScope } from 'vue'
|
|
9
|
-
import { init } from '@/index';
|
|
10
|
-
import { Test } from '../tests/Test'
|
|
11
|
-
import { Mouse } from '../tests/Mouse';
|
|
12
|
-
import { inject, reactive, toRaw } from 'vue'
|
|
13
|
-
import { ivue } from '../../src/ivue';
|
|
14
|
-
const emit = defineEmits<{
|
|
15
|
-
(event: 'testEmit'): void
|
|
16
|
-
}>()
|
|
17
|
-
// mouse.js
|
|
18
|
-
|
|
19
|
-
const mouse: Mouse = inject('mouse') as Mouse
|
|
20
|
-
|
|
21
|
-
console.log('getCurrentScope', getCurrentScope())
|
|
22
|
-
const v = ivue(Test, emit, 1)
|
|
23
|
-
const v2 = ivue(Test, emit, 2)
|
|
24
|
-
const v3 = ivue(Test, emit, 3)
|
|
25
|
-
const obj = { test: 1 }
|
|
26
|
-
const react = reactive(obj)
|
|
27
|
-
// setTimeout(() => {
|
|
28
|
-
// console.log('obj === react', obj === toRaw(react))
|
|
29
|
-
// },100)
|
|
30
|
-
</script>
|
|
31
|
-
<template>
|
|
32
|
-
<!-- {{ t.app.i }}-->
|
|
33
|
-
<div>
|
|
34
|
-
Injected mouse: {{ mouse }} <br />
|
|
35
|
-
|
|
36
|
-
<div>Sub Component: Hello:
|
|
37
|
-
Inner: {{ v.$.x }} {{ v.$.y }},<br />
|
|
38
|
-
Outer: {{ v.x }} {{ v.y }},
|
|
39
|
-
<br />
|
|
40
|
-
{{ v.email }}
|
|
41
|
-
</div>
|
|
42
|
-
<button @click="v.$emit('testEmit')">Emit</button>
|
|
43
|
-
<button @click="v.$.say(1)">Say</button>
|
|
44
|
-
</div>
|
|
45
|
-
</template>
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { Traits } from '@/index';
|
|
3
|
-
|
|
4
|
-
class Trait1 {
|
|
5
|
-
get prop () { return 1 }
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
class Trait2 {
|
|
9
|
-
get prop () { return 2 }
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
class Trait3 {
|
|
13
|
-
get prop () { return 3 }
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
class TestTraits {
|
|
17
|
-
prop = 0
|
|
18
|
-
}
|
|
19
|
-
Traits(TestTraits, [Trait3, Trait2, Trait1])
|
|
20
|
-
const t = new TestTraits()
|
|
21
|
-
console.log('traits t.prop is 0', t.prop === 0)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class TestTraits2 {}
|
|
25
|
-
Traits(TestTraits2, [Trait3, Trait2, Trait1])
|
|
26
|
-
const t2 = new TestTraits2()
|
|
27
|
-
console.log('traits t2.prop is 3', t2.prop, t2.prop === 3)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class TestTraits3 {
|
|
31
|
-
get prop () { return 0 }
|
|
32
|
-
}
|
|
33
|
-
Traits(TestTraits3, [Trait3, Trait2, Trait1])
|
|
34
|
-
const t3 = new TestTraits3()
|
|
35
|
-
console.log('traits t3.prop is 0', t3.prop, t3.prop === 0)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
class TestTraits4 {
|
|
39
|
-
set prop (v) { return v }
|
|
40
|
-
}
|
|
41
|
-
Traits(TestTraits4, [Trait3, Trait2, Trait1])
|
|
42
|
-
const t4 = new TestTraits4()
|
|
43
|
-
console.log('traits t4.prop is 3', t4.prop, t4.prop === 3)
|
|
44
|
-
|
|
45
|
-
{
|
|
46
|
-
|
|
47
|
-
class Trait1 {
|
|
48
|
-
_prop = 1
|
|
49
|
-
get prop () { return 1 }
|
|
50
|
-
set prop (v) { this._prop = v }
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
class Trait2 {
|
|
54
|
-
_prop = 2
|
|
55
|
-
get prop () { return this._prop }
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
class Trait3 {
|
|
59
|
-
_prop = 3
|
|
60
|
-
get prop () { return this._prop }
|
|
61
|
-
}
|
|
62
|
-
class TestTraits5 {}
|
|
63
|
-
Traits(TestTraits5, [Trait3, Trait2, Trait1])
|
|
64
|
-
const t5 = new TestTraits5()
|
|
65
|
-
t5.prop = 5
|
|
66
|
-
console.log('traits t5.prop is 5', t5.prop, t5.prop === 5)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
{
|
|
70
|
-
class Trait1 {
|
|
71
|
-
_prop = 1
|
|
72
|
-
get prop () { return 1 }
|
|
73
|
-
set prop (v) { this._prop = v }
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
class Trait2 {
|
|
77
|
-
_prop = 2
|
|
78
|
-
get prop () { return this._prop }
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
class Trait3 {
|
|
82
|
-
_prop = 3
|
|
83
|
-
get prop () { return this._prop }
|
|
84
|
-
}
|
|
85
|
-
class TestTraits6 {
|
|
86
|
-
set prop (v) { this._prop = 6 }
|
|
87
|
-
}
|
|
88
|
-
Traits(TestTraits6, [Trait3, Trait2, Trait1])
|
|
89
|
-
const t6 = new TestTraits6()
|
|
90
|
-
t6.prop = 5 // should not set to 5 but 6
|
|
91
|
-
console.log('traits t6.prop is 6', t6.prop, t6.prop === 6)
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
{
|
|
95
|
-
class Trait1 {
|
|
96
|
-
_prop = 1
|
|
97
|
-
get prop () { return 1 }
|
|
98
|
-
set prop (v) { this._prop = v }
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
class Trait2 {
|
|
102
|
-
_prop = 2
|
|
103
|
-
get prop () { return this._prop }
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
class Trait3 {
|
|
107
|
-
_prop = 3
|
|
108
|
-
get prop () { return this._prop }
|
|
109
|
-
set prop (v) { this._prop = 7 }
|
|
110
|
-
}
|
|
111
|
-
class TestTraits {}
|
|
112
|
-
Traits(TestTraits, [Trait3, Trait2, Trait1])
|
|
113
|
-
const t = new TestTraits()
|
|
114
|
-
t.prop = 5 // should not set to 5 but 7
|
|
115
|
-
console.log('traits t7.prop is 6', t.prop, t.prop === 7)
|
|
116
|
-
}
|
|
117
|
-
</script>
|
|
118
|
-
<template>
|
|
119
|
-
|
|
120
|
-
</template>
|