ivue 0.0.33 → 0.1.1
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/.babelrc.json +14 -0
- package/.eslintrc.cjs +24 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/compiler.xml +7 -0
- package/.idea/infinite-vue.iml +10 -0
- package/.idea/inspectionProfiles/Project_Default.xml +11 -0
- package/.idea/modules.xml +8 -0
- package/.idea/php.xml +20 -0
- package/.idea/vcs.xml +6 -0
- package/.vscode/extensions.json +3 -0
- package/LICENSE +19 -0
- package/README.md +31 -0
- package/demo/App.vue +72 -0
- package/demo/components/IVueTest.vue +298 -0
- package/demo/components/PreComponent.vue +13 -0
- package/demo/components/SubComponent2.vue +45 -0
- package/demo/components/TraitsComponent.vue +120 -0
- package/demo/components/useIVueTest.vue +136 -0
- package/demo/main.ts +21 -0
- package/demo/router/index.ts +14 -0
- package/demo/tests/IVueTests.ts +255 -0
- package/demo/tests/Mouse.ts +79 -0
- package/demo/tests/ParentIVueTests.ts +36 -0
- package/demo/tests/TApp.ts +15 -0
- package/demo/tests/TAuth.ts +23 -0
- package/demo/tests/TField.ts +84 -0
- package/demo/tests/TMessage.ts +52 -0
- package/demo/tests/TRouter.ts +18 -0
- package/demo/tests/TUser.ts +19 -0
- package/demo/tests/Test.ts +86 -0
- package/demo/tests/useField.ts +82 -0
- package/demo/tests/useIVueTests.ts +57 -0
- package/demo/vite.config.ts +13 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.es.js +516 -0
- package/dist/index.umd.js +1 -0
- package/dist/src/behavior.d.ts +72 -0
- package/dist/src/config.d.ts +6 -0
- package/dist/src/index.d.ts +21 -0
- package/dist/src/ivue.d.ts +35 -0
- package/dist/src/kernel.d.ts +182 -0
- package/dist/src/traits/UseCapsule.d.ts +9 -0
- package/dist/src/traits/UseEmit.d.ts +3 -0
- package/dist/src/traits/UseInstance.d.ts +6 -0
- package/dist/src/traits/UseMounting.d.ts +11 -0
- package/dist/src/traits/UseRefs.d.ts +8 -0
- package/dist/src/traits/UseRoute.d.ts +3 -0
- package/dist/src/traits/UseRouter.d.ts +3 -0
- package/dist/src/traits/UseRouting.d.ts +6 -0
- package/dist/src/traits/UseTick.d.ts +4 -0
- package/dist/src/traits/UseVue.d.ts +13 -0
- package/dist/src/types/core.d.ts +46 -0
- package/dist/src/utils/dispose-garbage.d.ts +12 -0
- package/dist/src/utils/extend.d.ts +12 -0
- package/dist/src/utils/getters.d.ts +21 -0
- package/dist/src/utils/index.d.ts +7 -0
- package/dist/src/utils/is.d.ts +14 -0
- package/dist/src/utils/pre.d.ts +9 -0
- package/dist/src/utils/raw.d.ts +12 -0
- package/dist/src/utils/safe-class-name.d.ts +7 -0
- package/dist/src/utils/traits.d.ts +41 -0
- package/env.d.ts +1 -0
- package/index.html +13 -0
- package/package-lock.json +14305 -0
- package/package.json +89 -10
- package/public/favicon.ico +0 -0
- package/src/App/App.ts +27 -0
- package/src/App/Auth/Auth.ts +105 -0
- package/src/App/Auth/Auth.vue +98 -0
- package/src/App/Auth/Logout.vue +14 -0
- package/src/App/Auth/User.ts +6 -0
- package/src/App/BlackBox.ts +75 -0
- package/src/App/Config.ts +6 -0
- package/src/App/Generators/generators.ts +47 -0
- package/src/App/Home/Home.vue +16 -0
- package/src/App/Services/Http/FakeHttp.ts +8 -0
- package/src/App/Services/Http/Http.ts +51 -0
- package/src/App/Services/Message/Message.ts +49 -0
- package/src/App/Services/Message/Message.vue +15 -0
- package/src/App/Services/Navigation/Navigation.ts +83 -0
- package/src/App/Services/Navigation/Navigation.vue +59 -0
- package/src/App/Services/Routing/FakeRouter.ts +7 -0
- package/src/App/Services/Routing/NotFoundRoute.vue +13 -0
- package/src/App/Services/Routing/Router.ts +262 -0
- package/src/App/Services/Routing/Routes.ts +49 -0
- package/src/App/Stubs/SingleBookResultStub.ts +13 -0
- package/src/App/Traits/UseApp.ts +6 -0
- package/src/App/Traits/UseBlackline.ts +0 -0
- package/src/App/Traits/UseQuasar.ts +8 -0
- package/src/behavior.ts +269 -0
- package/src/config.ts +15 -0
- package/src/dev/dev-utils.ts +78 -0
- package/src/index.ts +83 -0
- package/src/ivue.ts +296 -0
- package/src/kernel.ts +811 -0
- package/src/tests/auth.spec.ts +48 -0
- package/src/traits/UseCapsule.ts +28 -0
- package/src/traits/UseEmit.ts +3 -0
- package/src/traits/UseInstance.ts +17 -0
- package/src/traits/UseMounting.ts +23 -0
- package/src/traits/UseRefs.ts +17 -0
- package/src/traits/UseRoute.ts +6 -0
- package/src/traits/UseRouter.ts +5 -0
- package/src/traits/UseRouting.ts +7 -0
- package/src/traits/UseTick.ts +5 -0
- package/src/traits/UseVue.ts +38 -0
- package/src/types/core.ts +64 -0
- package/src/utils/dispose-garbage.ts +34 -0
- package/src/utils/extend.ts +85 -0
- package/src/utils/getters.ts +62 -0
- package/src/utils/index.ts +16 -0
- package/src/utils/is.ts +22 -0
- package/src/utils/pre.ts +29 -0
- package/src/utils/raw.ts +19 -0
- package/src/utils/safe-class-name.ts +15 -0
- package/src/utils/traits.ts +121 -0
- package/tsconfig.app.json +47 -0
- package/tsconfig.json +14 -0
- package/tsconfig.node.json +14 -0
- package/tsconfig.vitest.json +9 -0
- package/vite.config.ts +55 -0
- package/vitest.config.ts +18 -0
- package/dist/index.js +0 -218
- package/docs/index.html +0 -195
- package/docs/index.json +0 -3
- package/docs/input.html +0 -41
- package/docs/items.html +0 -42
- package/gulpfile.js +0 -5
- package/src/components/checkbox.js +0 -47
- package/src/components/data.js +0 -6
- package/src/components/file.js +0 -40
- package/src/components/form.js +0 -7
- package/src/components/index.js +0 -15
- package/src/components/input.js +0 -80
- package/src/components/items.js +0 -65
- package/src/components/modal.js +0 -42
- package/src/components/paginate-old.js +0 -88
- package/src/components/paginate.js +0 -35
- package/src/components/select-search.js +0 -152
- package/src/components/select.js +0 -62
- package/src/components/submit.js +0 -10
- package/src/components/textarea.js +0 -72
- package/src/components/upload.js +0 -49
- package/src/directives/href.js +0 -10
- package/src/directives/index.js +0 -1
- package/src/filters/date.js +0 -3
- package/src/filters/datetime.js +0 -3
- package/src/filters/index.js +0 -4
- package/src/filters/json.js +0 -3
- package/src/filters/money.js +0 -3
- package/src/index.js +0 -4
- package/src/mixins/data.js +0 -13
- package/src/mixins/form.js +0 -85
- package/src/mixins/resource.js +0 -31
- package/src/services/client.js +0 -32
- package/src/services/flash.js +0 -17
- package/src/services/index.js +0 -2
package/.babelrc.json
ADDED
package/.eslintrc.cjs
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
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>
|
|
@@ -0,0 +1,11 @@
|
|
|
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>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/../infinite-vue/.idea/infinite-vue.iml" filepath="$PROJECT_DIR$/../infinite-vue/.idea/infinite-vue.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
package/.idea/php.xml
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
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
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2023 - ∞ Evgeny Kalashnikov
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# ivue – Infinite Vue
|
|
2
|
+
|
|
3
|
+
Advanced State Management & Class Architecture for Vue 3+.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
yarn add infinite-vue
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Run Dev Server
|
|
12
|
+
```
|
|
13
|
+
yarn dev
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Files to look at:
|
|
17
|
+
|
|
18
|
+
Main logic for ivue:
|
|
19
|
+
https://github.com/infinite-system/infinite-vue/blob/main/src/ivue.ts
|
|
20
|
+
|
|
21
|
+
Utils:
|
|
22
|
+
https://github.com/infinite-system/infinite-vue/blob/main/src/utils.ts
|
|
23
|
+
|
|
24
|
+
Inversion of Control Container:
|
|
25
|
+
https://github.com/infinite-system/infinite-vue/blob/main/src/kernel.ts
|
|
26
|
+
|
|
27
|
+
App.vue:
|
|
28
|
+
https://github.com/infinite-system/infinite-vue/blob/main/demo/App.vue
|
|
29
|
+
|
|
30
|
+
Main class used for playground in App.vue:
|
|
31
|
+
https://github.com/infinite-system/infinite-vue/blob/main/demo/tests/IVueTests.ts
|
package/demo/App.vue
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { use } from '@/index'
|
|
3
|
+
// import { Mouse } from './tests/Mouse';
|
|
4
|
+
// import { IVueTests } from "./tests/IVueTests";
|
|
5
|
+
import { TApp } from './tests/TApp';
|
|
6
|
+
const app = use(TApp)
|
|
7
|
+
</script>
|
|
8
|
+
<template>
|
|
9
|
+
<vue-dd v-model="app" name="app" open-level="1" />
|
|
10
|
+
<router-view />
|
|
11
|
+
</template>
|
|
12
|
+
<style>
|
|
13
|
+
@import 'https://fonts.googleapis.com/css?family=Montserrat:400,700,400italic,700italic';
|
|
14
|
+
@import 'https://www.w3schools.com/w3css/4/w3.css';
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
body {
|
|
19
|
+
font-family: 'Montserrat';
|
|
20
|
+
margin: 40px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.navigation-container {
|
|
24
|
+
width: 150px;
|
|
25
|
+
float: left;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.navigation-item-header {
|
|
29
|
+
color: 'white';
|
|
30
|
+
padding: 10px;
|
|
31
|
+
margin-left: 3px;
|
|
32
|
+
margin-top: 3px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.navigation-item {
|
|
36
|
+
color: 'white';
|
|
37
|
+
padding: 10px;
|
|
38
|
+
margin-left: 3px;
|
|
39
|
+
margin-top: 3px;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
text-align: left;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.validation-message {
|
|
45
|
+
padding: 13;
|
|
46
|
+
color: 'black';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.logo {
|
|
50
|
+
padding-bottom: 20px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.container input[type='text'] {
|
|
54
|
+
width: 140px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.container {
|
|
58
|
+
width: 650px;
|
|
59
|
+
margin: auto;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.container .lr-submit {
|
|
63
|
+
padding-left: 20px;
|
|
64
|
+
padding-right: 20px;
|
|
65
|
+
padding-top: 7px;
|
|
66
|
+
padding-bottom: 7px;
|
|
67
|
+
border: none;
|
|
68
|
+
background-color: #5bca06;
|
|
69
|
+
color: #ffffff;
|
|
70
|
+
width: 100px;
|
|
71
|
+
}
|
|
72
|
+
</style>
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, provide, onUnmounted, onBeforeUnmount, getCurrentInstance, onMounted } 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
|
+
let vm: IVueTests = use(IVueTests)
|
|
11
|
+
provide('mouse', ivue(Mouse))
|
|
12
|
+
const localComputedValue = computed(() => {
|
|
13
|
+
return vm.computedVariable?.[0]?.test + ' + local append'
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const hugeId = 2646049
|
|
17
|
+
|
|
18
|
+
function hey () {
|
|
19
|
+
console.log('yo')
|
|
20
|
+
}
|
|
21
|
+
// onMounted(() => console.log('kernel.instances.get(IVueTests)', kernel.instances.get(IVueTests)))
|
|
22
|
+
// onBeforeUnmount(() => {
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
// })
|
|
26
|
+
// onUnmounted(() => console.log('kernel.instances.get(IVueTests)', kernel.instances.get(IVueTests)))
|
|
27
|
+
</script>
|
|
28
|
+
<template>
|
|
29
|
+
|
|
30
|
+
<h2>Sub Component Test</h2>
|
|
31
|
+
<router-view @testEmit="hey"></router-view>
|
|
32
|
+
<div style="width:900px; margin:0 auto;">
|
|
33
|
+
|
|
34
|
+
<h1>ivue - Infinite Vue - Implementation Tests</h1>
|
|
35
|
+
<!-- <vue-dd v-model="vm" get-all-properties/> -->
|
|
36
|
+
|
|
37
|
+
<h2>Class Inheritance Tests</h2>
|
|
38
|
+
|
|
39
|
+
vm.parentValue: <input v-model="vm.parentValue" /><br />
|
|
40
|
+
<button @click="vm.parentValueAlert()">vm.parentValueAlert()</button>
|
|
41
|
+
|
|
42
|
+
<h2>Computed Resolution Tests</h2>
|
|
43
|
+
<hr />
|
|
44
|
+
<h3>Primitive Computed Tests</h3>
|
|
45
|
+
<table>
|
|
46
|
+
<tr>
|
|
47
|
+
<td class="label"><strong>vm.computedPrimitive</strong></td>
|
|
48
|
+
<td class="value">{{ vm.computedPrimitive }}
|
|
49
|
+
<button @click="vm.primitive++">Change Primitive</button>
|
|
50
|
+
</td>
|
|
51
|
+
</tr>
|
|
52
|
+
<tr>
|
|
53
|
+
<td class="label"><strong>localComputedValue</strong> (refers to vm.computedVariable.[0].test):</td>
|
|
54
|
+
<td class="value">{{ localComputedValue }}</td>
|
|
55
|
+
</tr>
|
|
56
|
+
<tr>
|
|
57
|
+
<td class="label"><strong>vm.auth.user.email:</strong></td>
|
|
58
|
+
<td class="value"><input
|
|
59
|
+
type="text"
|
|
60
|
+
style="width:250px;"
|
|
61
|
+
v-model="vm.auth.user.email"
|
|
62
|
+
/></td>
|
|
63
|
+
</tr>
|
|
64
|
+
<tr>
|
|
65
|
+
<td class="label"><strong>vm.auth.user.upperCaseEmail:</strong></td>
|
|
66
|
+
<td class="value">{{ vm.auth.user.upperCaseEmail }}</td>
|
|
67
|
+
</tr>
|
|
68
|
+
<tr>
|
|
69
|
+
<td class="label">vm.auth.user.dashedUppercaseEmail</td>
|
|
70
|
+
<td class="value">
|
|
71
|
+
<span v-for="i in vm.auth.user.dashedUppercaseEmail">
|
|
72
|
+
<span>{{ i }}</span>-
|
|
73
|
+
</span>
|
|
74
|
+
</td>
|
|
75
|
+
</tr>
|
|
76
|
+
<tr>
|
|
77
|
+
<td class="label">vm.auth.user.dashedUppercaseEmail (colored):</td>
|
|
78
|
+
<td class="value">
|
|
79
|
+
<span v-for="i in vm.auth.user.dashedUppercaseEmail">
|
|
80
|
+
<span style="color:green">{{ i }}</span>-
|
|
81
|
+
</span>
|
|
82
|
+
</td>
|
|
83
|
+
</tr>
|
|
84
|
+
<tr>
|
|
85
|
+
<td class="label">Deep circular resolution test of vm.deepEmail:</td>
|
|
86
|
+
<td class="value">{{ vm.deepEmail }}</td>
|
|
87
|
+
</tr>
|
|
88
|
+
</table>
|
|
89
|
+
|
|
90
|
+
<h3>Complex (Objects/Arrays from other stores) Computed Tests</h3>
|
|
91
|
+
<button @click="vm.pushToOriginalVariableInAuthRepo()">vm.pushToOriginalVariableInAuthRepo()</button>
|
|
92
|
+
<br />
|
|
93
|
+
<button @click="vm.computedVariable = [{
|
|
94
|
+
test: 'set 1', test2: 'set 2'
|
|
95
|
+
}]">Setter on a computed vm.computedVariable (resets vm.auth.originalVariable)
|
|
96
|
+
</button>
|
|
97
|
+
<br />
|
|
98
|
+
<strong>vm.auth.originalVariable:</strong><br />
|
|
99
|
+
|
|
100
|
+
<div v-for="el in vm.auth.originalVariable">
|
|
101
|
+
test:<input v-model="el.test" /> test2: <input v-model="el.test2" />
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<br />
|
|
105
|
+
<strong>vm.computedVariable:</strong>
|
|
106
|
+
<div v-for="el in vm.computedVariable">
|
|
107
|
+
test:<input v-model="el.test" /> test2: <input v-model="el.test2" />
|
|
108
|
+
</div>
|
|
109
|
+
<br />
|
|
110
|
+
<strong>vm.computedUponComputedVariable:</strong>
|
|
111
|
+
<div v-for="el in vm.computedUponComputedVariable">
|
|
112
|
+
test:<input v-model="el.test" /> test2: <input v-model="el.test2" />
|
|
113
|
+
</div>
|
|
114
|
+
<br />
|
|
115
|
+
<h2>Async Function Test</h2>
|
|
116
|
+
<hr />
|
|
117
|
+
<span>Loader: <span v-if="vm.loading">loading...</span></span><br />
|
|
118
|
+
<span>Result: {{ vm.result }}</span><br />
|
|
119
|
+
<button @click="vm.runAsyncFunction">runAsyncFunction() (wait for 2 seconds)</button>
|
|
120
|
+
<h2>Huge Data Test</h2>
|
|
121
|
+
<hr />
|
|
122
|
+
<input v-model="vm.numberOfRecords" />
|
|
123
|
+
<button @click="vm.loadHugeData(vm.numberOfRecords)">Load Huge Data
|
|
124
|
+
({{ vm.numberOfRecords.toLocaleString("en-US") }} records)
|
|
125
|
+
</button>
|
|
126
|
+
<br /> Loader: <strong>{{
|
|
127
|
+
vm.loadingHugeData ?
|
|
128
|
+
'loading ' + vm.numberOfRecords.toLocaleString("en-US") + ' records ...'
|
|
129
|
+
: ''
|
|
130
|
+
}}</strong>
|
|
131
|
+
<div
|
|
132
|
+
style="color:green"
|
|
133
|
+
v-if="vm.timeTaken"
|
|
134
|
+
>Loaded in {{ vm.msToTime(vm.timeTaken) }}.</div>
|
|
135
|
+
|
|
136
|
+
<div v-if="hugeId in vm.hugeArray">
|
|
137
|
+
<h3>Editing Record #{{ hugeId.toLocaleString("en-US") }}</h3>
|
|
138
|
+
user: <input v-model="vm.hugeArray[hugeId].struct.user" /><br />
|
|
139
|
+
text: <input v-model="vm.hugeArray[hugeId].struct.text" />
|
|
140
|
+
<pre style="font-size:10px; line-height:10px;">{{ vm.hugeArray[hugeId] }}</pre>
|
|
141
|
+
</div>
|
|
142
|
+
<h2>markRaw Tests</h2>
|
|
143
|
+
<div>nonReactiveProp is disabled:</div>
|
|
144
|
+
<vue-dd
|
|
145
|
+
name="nonReactiveProp"
|
|
146
|
+
v-model="vm.nonReactiveProp"
|
|
147
|
+
:preview="0"
|
|
148
|
+
:dark="false"
|
|
149
|
+
:open-level="2"
|
|
150
|
+
/>
|
|
151
|
+
<div v-if="vm.transientFields?.[0]">
|
|
152
|
+
Email: {{ vm.transientFields?.[0]?.email }}<br /> {{ vm.transientFields[10].x }}
|
|
153
|
+
</div>
|
|
154
|
+
<input type="text" v-model="vm.app.user.email" />
|
|
155
|
+
<h2>Private prop test</h2>
|
|
156
|
+
<div>vm.x: {{ vm.x }}
|
|
157
|
+
<button @click="vm.x++">Increase</button>
|
|
158
|
+
</div>
|
|
159
|
+
<br />
|
|
160
|
+
|
|
161
|
+
<h2>Transients Test</h2>
|
|
162
|
+
<div>vm.transientField1.prop: {{ vm.transientField1.prop }}
|
|
163
|
+
<button @click="vm.transientField1.prop++">Increase++</button>
|
|
164
|
+
</div>
|
|
165
|
+
<div>vm.transientField2.prop: {{ vm.transientField2.prop }}
|
|
166
|
+
<button @click="vm.transientField2.prop++">Increase++</button>
|
|
167
|
+
</div>
|
|
168
|
+
<div>Computed vm.propTransient: {{ vm.propTransient }}</div>
|
|
169
|
+
<h2>Intercepts Test</h2>
|
|
170
|
+
<div>vm.transientField2.runWithIntercept(): {{ vm.transientField2.runWithInterceptResult }}
|
|
171
|
+
<button @click="vm.transientField2.runWithInterceptResult = vm.transientField2.runWithIntercept('test')">
|
|
172
|
+
vm.transientField2.runWithIntercept()
|
|
173
|
+
</button>
|
|
174
|
+
</div>
|
|
175
|
+
<br />
|
|
176
|
+
<br />
|
|
177
|
+
<br />
|
|
178
|
+
<TraitsComponent />
|
|
179
|
+
<br />
|
|
180
|
+
<br />
|
|
181
|
+
<br />
|
|
182
|
+
<br />
|
|
183
|
+
</div>
|
|
184
|
+
</template>
|
|
185
|
+
<style>
|
|
186
|
+
.rendererParent {
|
|
187
|
+
width: 100%;
|
|
188
|
+
height: 580px;
|
|
189
|
+
border: 1px solid black;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
h1,
|
|
193
|
+
h2,
|
|
194
|
+
h3,
|
|
195
|
+
h4 {
|
|
196
|
+
font-family: Arial;
|
|
197
|
+
margin: 10px 0;
|
|
198
|
+
padding: 0;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
h1 {
|
|
202
|
+
font-size: 24px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
h2 {
|
|
206
|
+
font-size: 18px;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
h3 {
|
|
210
|
+
font-size: 16px;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
h4 {
|
|
214
|
+
font-size: 14px;
|
|
215
|
+
margin: 0 5px;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
body {
|
|
219
|
+
font-family: Arial;
|
|
220
|
+
font-size: 14px;
|
|
221
|
+
line-height: 200%;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.body {
|
|
225
|
+
max-width: 1000px;
|
|
226
|
+
margin: 0 auto;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.section {
|
|
230
|
+
padding: 5px 0;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.section-alt {
|
|
234
|
+
padding: 15px;
|
|
235
|
+
background: #edf1f6;
|
|
236
|
+
border-radius: 10px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
button {
|
|
240
|
+
color: #eee;
|
|
241
|
+
border-radius: 5px;
|
|
242
|
+
border: 0;
|
|
243
|
+
font-size: 16px;
|
|
244
|
+
background: #0075d3;
|
|
245
|
+
margin: 1px 3px;
|
|
246
|
+
padding: 4px 7px;
|
|
247
|
+
display: inline-block;
|
|
248
|
+
cursor: pointer;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
button:hover {
|
|
252
|
+
background: #08277a;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
button.pass:hover {
|
|
256
|
+
background: green;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
button.fail:hover {
|
|
260
|
+
background: red;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
button:active {
|
|
264
|
+
background: #294dab;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
input {
|
|
268
|
+
color: #333;
|
|
269
|
+
border-radius: 5px;
|
|
270
|
+
border: 0;
|
|
271
|
+
width: 250px;
|
|
272
|
+
font-size: 16px;
|
|
273
|
+
background: #eee;
|
|
274
|
+
border: 1px solid #0075d3;
|
|
275
|
+
margin: 1px 3px;
|
|
276
|
+
padding: 4px 7px;
|
|
277
|
+
display: inline-block;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.mr-10 {
|
|
281
|
+
margin-right: 10px;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.pass {
|
|
285
|
+
background: #00c200;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.fail {
|
|
289
|
+
background: #c00606
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
td.label {
|
|
293
|
+
text-align: right;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
td.value {
|
|
297
|
+
padding-left: 20px;
|
|
298
|
+
}</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
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>
|
|
@@ -0,0 +1,45 @@
|
|
|
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>
|