@enso-ui/services 5.0.0 → 5.2.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/LICENSE +1 -1
- package/README.md +2 -27
- package/package.json +8 -21
- package/src/bulma/pages/services/Create.vue +1 -1
- package/src/bulma/pages/services/Edit.vue +23 -7
- package/src/bulma/pages/services/Index.vue +34 -9
- package/src/bulma/pages/services/components/Supplier.vue +113 -0
- package/src/bulma/routes/services.js +1 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# services
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-

|
|
5
|
-

|
|
6
|
-

|
|
7
|
-

|
|
8
|
-
|
|
9
|
-
## Usage
|
|
10
|
-
The component cannot be used outside of the Enso ecosystem.
|
|
11
|
-
|
|
12
|
-
### Demo
|
|
13
|
-
|
|
14
|
-
For live examples and demos, you may visit [laravel-enso.com](https://www.laravel-enso.com)
|
|
15
|
-
|
|
16
|
-
### Installation, Configuration & Usage
|
|
17
|
-
|
|
18
|
-
Be sure to check out the full documentation for this package available at [docs.laravel-enso.com](https://docs.laravel-enso.com/frontend/services.html)
|
|
19
|
-
|
|
20
|
-
## Contributions
|
|
21
|
-
|
|
22
|
-
are welcome. Pull requests are great, but issues are good too.
|
|
23
|
-
|
|
24
|
-
Thank you to all the people who already contributed to Enso!
|
|
25
|
-
|
|
26
|
-
## License
|
|
27
|
-
|
|
28
|
-
[ISC](https://opensource.org/licenses/ISC)
|
|
3
|
+
See LICENSE.
|
package/package.json
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enso-ui/services",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "Basic services package",
|
|
5
5
|
"main": "src/bulma/pages/administration/services/Index.vue",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
-
},
|
|
9
6
|
"repository": {
|
|
10
7
|
"type": "git",
|
|
11
8
|
"url": "git+https://github.com/enso-ui/services.git"
|
|
@@ -15,28 +12,18 @@
|
|
|
15
12
|
"vue"
|
|
16
13
|
],
|
|
17
14
|
"author": "Adrian Ocneanu <aocneanu@gmail.com>",
|
|
18
|
-
"license": "
|
|
15
|
+
"license": "MIT",
|
|
19
16
|
"bugs": {
|
|
20
17
|
"url": "https://github.com/enso-ui/services/issues"
|
|
21
18
|
},
|
|
22
19
|
"homepage": "https://github.com/enso-ui/services#readme",
|
|
23
20
|
"dependencies": {
|
|
24
|
-
"@enso-ui/
|
|
25
|
-
"@enso-ui/
|
|
26
|
-
"@enso-ui/
|
|
27
|
-
"@
|
|
28
|
-
"@fortawesome/
|
|
21
|
+
"@enso-ui/filters": "^3.2.0",
|
|
22
|
+
"@enso-ui/forms": "^4.0.0",
|
|
23
|
+
"@enso-ui/tables": "^4.0.0",
|
|
24
|
+
"@enso-ui/ui": "^7.0.0",
|
|
25
|
+
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
|
26
|
+
"@fortawesome/free-solid-svg-icons": "^7.2.0",
|
|
29
27
|
"vue": "^3.0"
|
|
30
|
-
},
|
|
31
|
-
"devDependencies": {
|
|
32
|
-
"@vue/cli-plugin-babel": "5.0.0-beta.6",
|
|
33
|
-
"@vue/cli-plugin-eslint": "5.0.0-beta.6",
|
|
34
|
-
"@vue/eslint-config-airbnb": "^5.0.0",
|
|
35
|
-
"autoprefixer": "^9.6.1",
|
|
36
|
-
"babel-eslint": "^10.0.1",
|
|
37
|
-
"cross-env": "^6.0.0",
|
|
38
|
-
"eslint": "^7.0.0",
|
|
39
|
-
"eslint-import-resolver-alias": "^1.1.2",
|
|
40
|
-
"eslint-plugin-vue": "^8.0.3"
|
|
41
28
|
}
|
|
42
29
|
}
|
|
@@ -1,17 +1,33 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="columns is-centered">
|
|
3
3
|
<div class="column is-three-quarters-desktop is-full-touch">
|
|
4
|
-
<enso-form class="box form-box
|
|
4
|
+
<enso-form class="box form-box"
|
|
5
|
+
@ready="form = $event.form">
|
|
6
|
+
<template #suppliers>
|
|
7
|
+
<div class="wrapper is-block">
|
|
8
|
+
<div class="columns">
|
|
9
|
+
<div class="column is-6-tablet">
|
|
10
|
+
<form-field :field="form.field('suppliers')"
|
|
11
|
+
:custom-params="$route.params"/>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<supplier v-for="supplier in form.field('suppliers').value"
|
|
15
|
+
:key="supplier.id"
|
|
16
|
+
:supplier="supplier"
|
|
17
|
+
:errors="form.errors"
|
|
18
|
+
@acquisition-price-updated="supplier.cost.acquisitionPrice = $event"/>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
</enso-form>
|
|
5
22
|
</div>
|
|
6
23
|
</div>
|
|
7
24
|
</template>
|
|
8
25
|
|
|
9
|
-
<script>
|
|
10
|
-
import { EnsoForm } from '@enso-ui/forms/bulma';
|
|
26
|
+
<script setup>
|
|
27
|
+
import { EnsoForm, FormField } from '@enso-ui/forms/bulma';
|
|
28
|
+
import { ref } from 'vue';
|
|
29
|
+
import Supplier from './components/Supplier.vue';
|
|
11
30
|
|
|
12
|
-
|
|
13
|
-
name: 'Edit',
|
|
31
|
+
const form = ref(null);
|
|
14
32
|
|
|
15
|
-
components: { EnsoForm },
|
|
16
|
-
};
|
|
17
33
|
</script>
|
|
@@ -1,15 +1,40 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
2
|
+
<div class="wrapper">
|
|
3
|
+
<div class="columns is-centered is-multiline">
|
|
4
|
+
<div class="column is-narrow">
|
|
5
|
+
<boolean-filter class="box"
|
|
6
|
+
:name="i18n('Active')"
|
|
7
|
+
v-model="filters.services.is_active"/>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="column is-narrow">
|
|
10
|
+
<boolean-filter class="box"
|
|
11
|
+
:name="i18n('Additional')"
|
|
12
|
+
v-model="filters.services.is_additional"/>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="column is-narrow">
|
|
15
|
+
<boolean-filter class="box"
|
|
16
|
+
:name="i18n('Contractor Exclusive')"
|
|
17
|
+
v-model="filters.services.is_contractor_exclusive"/>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
<enso-table class="box p-0"
|
|
21
|
+
v-model:filters="filters"
|
|
22
|
+
:filter-version="1.1"
|
|
23
|
+
id="services"/>
|
|
24
|
+
</div>
|
|
4
25
|
</template>
|
|
5
26
|
|
|
6
|
-
<script>
|
|
7
|
-
|
|
27
|
+
<script setup>
|
|
28
|
+
import { ref, inject } from 'vue';
|
|
29
|
+
import { BooleanFilter } from '@enso-ui/filters/bulma';
|
|
8
30
|
import { EnsoTable } from '@enso-ui/tables/bulma';
|
|
9
31
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
32
|
+
const i18n = inject('i18n');
|
|
33
|
+
const filters = ref({
|
|
34
|
+
services: {
|
|
35
|
+
is_active: null,
|
|
36
|
+
is_additional: null,
|
|
37
|
+
is_contractor_exclusive: null,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
15
40
|
</script>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="columns supplier-wrapper">
|
|
3
|
+
<div class="column is-3">
|
|
4
|
+
<div class="field">
|
|
5
|
+
<label class="label">
|
|
6
|
+
{{ i18n('Supplier') }}
|
|
7
|
+
</label>
|
|
8
|
+
<div class="control">
|
|
9
|
+
<input class="input"
|
|
10
|
+
:value="supplier.name"
|
|
11
|
+
readonly>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="column">
|
|
16
|
+
<div class="field">
|
|
17
|
+
<label class="label">
|
|
18
|
+
{{ i18n('Acquisition Price') }}
|
|
19
|
+
</label>
|
|
20
|
+
<div class="control">
|
|
21
|
+
<input class="input"
|
|
22
|
+
:value="supplier.cost.acquisitionPrice"
|
|
23
|
+
v-select-on-focus
|
|
24
|
+
@input="$emit('acquisition-price-updated', $event.target.value);
|
|
25
|
+
clearError('acquisitionPrice');">
|
|
26
|
+
</div>
|
|
27
|
+
<p class="help is-danger"
|
|
28
|
+
v-if="hasError('acquisitionPrice')">
|
|
29
|
+
{{ getError('acquisitionPrice') }}
|
|
30
|
+
</p>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="column is-narrow">
|
|
34
|
+
<div class="field">
|
|
35
|
+
<label class="label">
|
|
36
|
+
{{ i18n('Mapped At') }}
|
|
37
|
+
</label>
|
|
38
|
+
<div class="control">
|
|
39
|
+
<input class="input timestamp"
|
|
40
|
+
:value="supplier.cost.createdAt"
|
|
41
|
+
readonly>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="column is-narrow">
|
|
46
|
+
<div class="field">
|
|
47
|
+
<label class="label">
|
|
48
|
+
{{ i18n('Updated At') }}
|
|
49
|
+
</label>
|
|
50
|
+
<div class="control">
|
|
51
|
+
<input class="input timestamp"
|
|
52
|
+
:value="supplier.cost.updatedAt"
|
|
53
|
+
readonly>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script>
|
|
61
|
+
import { focus, selectOnFocus } from '@enso-ui/directives';
|
|
62
|
+
import Errors from '@enso-ui/laravel-validation';
|
|
63
|
+
|
|
64
|
+
export default {
|
|
65
|
+
name: 'Supplier',
|
|
66
|
+
|
|
67
|
+
directives: { focus, selectOnFocus },
|
|
68
|
+
|
|
69
|
+
inject: ['i18n'],
|
|
70
|
+
|
|
71
|
+
props: {
|
|
72
|
+
errors: {
|
|
73
|
+
type: Errors,
|
|
74
|
+
required: true,
|
|
75
|
+
},
|
|
76
|
+
index: {
|
|
77
|
+
type: Number,
|
|
78
|
+
required: true,
|
|
79
|
+
},
|
|
80
|
+
supplier: {
|
|
81
|
+
type: Object,
|
|
82
|
+
required: true,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
emits: ['acquisition-price-updated', 'part-number-updated'],
|
|
87
|
+
|
|
88
|
+
methods: {
|
|
89
|
+
clearError(field) {
|
|
90
|
+
this.errors.clear(field);
|
|
91
|
+
},
|
|
92
|
+
errorKey(field) {
|
|
93
|
+
return `suppliers.${this.index}.cost.${field}`;
|
|
94
|
+
},
|
|
95
|
+
getError(field) {
|
|
96
|
+
const key = this.errorKey(field);
|
|
97
|
+
|
|
98
|
+
return this.errors.get(key)
|
|
99
|
+
.replace(key, 'field')
|
|
100
|
+
.replace('field field', 'field');
|
|
101
|
+
},
|
|
102
|
+
hasError(field) {
|
|
103
|
+
return this.errors.has(this.errorKey(field));
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
</script>
|
|
108
|
+
|
|
109
|
+
<style lang="scss">
|
|
110
|
+
.supplier-wrapper .timestamp {
|
|
111
|
+
width: 7em;
|
|
112
|
+
}
|
|
113
|
+
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import routeImporter from '@enso-ui/ui/src/modules/importers/routeImporter';
|
|
2
2
|
|
|
3
|
-
const routes = routeImporter(
|
|
3
|
+
const routes = routeImporter.fromGlob(import.meta.glob('./services/*.js', { eager: true }));
|
|
4
4
|
const RouterView = () => import('@enso-ui/ui/src/bulma/pages/Router.vue');
|
|
5
5
|
|
|
6
6
|
export default {
|