@fishawack/lab-velocity 2.0.0-beta.1 → 2.0.0-beta.10

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.
Files changed (90) hide show
  1. package/README.md +160 -38
  2. package/_Build/vue/components/Icon.vue +33 -0
  3. package/_Build/vue/components/Svg.vue +45 -0
  4. package/_Build/vue/components/basic/Button.vue +109 -0
  5. package/_Build/vue/components/basic/link.vue +64 -0
  6. package/_Build/vue/components/form/Cascader.vue +85 -0
  7. package/_Build/vue/components/form/Checkbox.vue +39 -0
  8. package/_Build/vue/components/form/CheckboxGroup.vue +91 -0
  9. package/_Build/vue/components/form/DatePicker.vue +116 -0
  10. package/_Build/vue/components/form/InputNumber.vue +89 -0
  11. package/_Build/vue/components/form/Select.vue +109 -0
  12. package/_Build/vue/components/form/Spinner.vue +5 -0
  13. package/_Build/vue/components/form/Switch.vue +63 -0
  14. package/_Build/vue/components/form/Upload.vue +101 -0
  15. package/_Build/vue/components/form/Wysiwyg.vue +127 -0
  16. package/_Build/vue/components/form/Wysiwyg2.vue +577 -0
  17. package/_Build/vue/components/form/basic.vue +106 -0
  18. package/_Build/vue/components/form/color.vue +22 -0
  19. package/_Build/vue/components/form/file.vue +89 -0
  20. package/_Build/vue/components/form/input.js +79 -0
  21. package/_Build/vue/components/form/input.vue +105 -0
  22. package/_Build/vue/components/layout/Alert.vue +38 -0
  23. package/_Build/vue/components/layout/Footer.vue +50 -0
  24. package/_Build/vue/components/layout/Header.vue +13 -0
  25. package/_Build/vue/components/layout/Loader.vue +59 -0
  26. package/_Build/vue/components/layout/Tooltip.vue +46 -0
  27. package/_Build/vue/components/layout/pageTitle.vue +18 -0
  28. package/_Build/vue/components/layout/sideBar.vue +25 -0
  29. package/_Build/vue/components/navigation/Breadcrumbs.vue +37 -0
  30. package/_Build/vue/components/navigation/BreadcrumbsItem.vue +19 -0
  31. package/_Build/vue/components/navigation/Menu.vue +14 -0
  32. package/_Build/vue/components/navigation/MenuItem.vue +20 -0
  33. package/_Build/vue/components/navigation/MenuItemGroup.vue +20 -0
  34. package/_Build/vue/components/navigation/SubMenu.vue +20 -0
  35. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/Upload/upload.vue +259 -0
  36. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/create.vue +62 -0
  37. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/edit.vue +98 -0
  38. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/index.vue +90 -0
  39. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/partials/form.vue +181 -0
  40. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/show.vue +267 -0
  41. package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/parent.vue +36 -0
  42. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/create.vue +113 -0
  43. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/edit.vue +101 -0
  44. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/index.vue +112 -0
  45. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/partials/form.vue +174 -0
  46. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/show.vue +123 -0
  47. package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/parent.vue +36 -0
  48. package/_Build/vue/modules/AuthModule/components/AuthModal.vue +105 -0
  49. package/_Build/vue/modules/AuthModule/components/Chip.vue +70 -0
  50. package/_Build/vue/modules/AuthModule/components/Chips.vue +26 -0
  51. package/_Build/vue/modules/AuthModule/components/FormRole.vue +117 -0
  52. package/_Build/vue/modules/AuthModule/components/VBreadcrumbs.vue +33 -0
  53. package/_Build/vue/modules/AuthModule/components/VFormFooter.vue +52 -0
  54. package/_Build/vue/modules/AuthModule/components/VPageHeader.vue +38 -0
  55. package/_Build/vue/modules/AuthModule/components/VPasswordValidation.vue +106 -0
  56. package/_Build/vue/modules/AuthModule/components/VRoleLegend.vue +43 -0
  57. package/_Build/vue/modules/AuthModule/components/VTable.vue +136 -0
  58. package/_Build/vue/modules/AuthModule/components/VTableSorter.vue +252 -0
  59. package/_Build/vue/modules/AuthModule/js/FakeAPI.js +78 -0
  60. package/_Build/vue/modules/AuthModule/js/axios.js +81 -0
  61. package/_Build/vue/modules/AuthModule/js/router.js +295 -0
  62. package/_Build/vue/modules/AuthModule/js/store.js +62 -0
  63. package/_Build/vue/modules/AuthModule/routes/account-exists.vue +33 -0
  64. package/_Build/vue/modules/AuthModule/routes/change-password.vue +163 -0
  65. package/_Build/vue/modules/AuthModule/routes/container.vue +34 -0
  66. package/_Build/vue/modules/AuthModule/routes/expired-reset.vue +78 -0
  67. package/_Build/vue/modules/AuthModule/routes/expired-verification.vue +101 -0
  68. package/_Build/vue/modules/AuthModule/routes/force-reset.vue +147 -0
  69. package/_Build/vue/modules/AuthModule/routes/forgot.vue +91 -0
  70. package/_Build/vue/modules/AuthModule/routes/login.vue +139 -0
  71. package/_Build/vue/modules/AuthModule/routes/logincallback.vue +39 -0
  72. package/_Build/vue/modules/AuthModule/routes/loginheadless.vue +21 -0
  73. package/_Build/vue/modules/AuthModule/routes/loginsso.vue +132 -0
  74. package/_Build/vue/modules/AuthModule/routes/logout.vue +19 -0
  75. package/_Build/vue/modules/AuthModule/routes/logoutheadless.vue +25 -0
  76. package/_Build/vue/modules/AuthModule/routes/register.vue +171 -0
  77. package/_Build/vue/modules/AuthModule/routes/reset.vue +133 -0
  78. package/_Build/vue/modules/AuthModule/routes/success-forgot.vue +120 -0
  79. package/_Build/vue/modules/AuthModule/routes/success-reset.vue +35 -0
  80. package/_Build/vue/modules/AuthModule/routes/success-verify.vue +30 -0
  81. package/_Build/vue/modules/AuthModule/routes/verify.vue +110 -0
  82. package/_base.scss +0 -1
  83. package/_defaults.scss +2 -13
  84. package/_variables.scss +9 -4
  85. package/{modules/_AuthModule.scss → components/_auth.scss} +19 -68
  86. package/package.json +3 -8
  87. package/vendor.scss +0 -1
  88. package/components/_input.scss +0 -0
  89. package/modules/_AuthVariables.scss +0 -7
  90. /package/{modules → components}/_modal.scss +0 -0
package/README.md CHANGED
@@ -10,65 +10,187 @@ Prevent code repetition.
10
10
 
11
11
  ## Getting started
12
12
 
13
+ ### Requirements
14
+
15
+ ```json
16
+ "vue": "^3.3.4",
17
+ "vue-router": "^4.2.4",
18
+ "vuex": "^4.1.0",
19
+ "vuex-persistedstate": "^4.1.0"
20
+ "vue-loader": "^17.2.2"
21
+ ```
22
+
13
23
  ### Install
14
24
 
15
25
  ```bash
16
26
  npm install @fishawack/lab-velocity
17
27
  ```
18
28
 
19
- ### Auth Module
29
+ ## Hydrate Views
30
+
31
+ Frontend & Admin files to work with the Hydrate Module including routes, store, axios and components.
32
+
33
+ ### Installation
34
+
35
+ ### Configure axios
36
+
37
+ ##### script.js
38
+
39
+ ```js
40
+ import { Auth } from "@fishawack/lab-velocity";
41
+
42
+ // Call in your boot method
43
+ Auth.Axios.setAxiosDefaults(process.env.APP_URL, router);
44
+ ```
45
+
46
+ ### Configure router
47
+
48
+ ##### router.js
49
+
50
+ ```js
51
+ import { Auth } from "@fishawack/lab-velocity";
52
+ import store from "./store.js";
53
+
54
+ // ... initialize router
55
+
56
+ Auth.Router.beforeEach(router, store);
57
+ ```
58
+
59
+ ### Configure routes
60
+
61
+ There are two different set of routes for the admin and the frontend.
62
+
63
+ ##### routes.js
64
+
65
+ ```js
66
+ import { Auth } from "@fishawack/lab-velocity";
67
+
68
+ [
69
+ // ... other routes
70
+
71
+ // End user routes for login, register, chang password etc
72
+ ...Auth.Router.routes(node),
73
+
74
+ // Admin routes for headless login & managing users & companies
75
+ ...Auth.Router.adminRoutes(node),
76
+
77
+ // ... wildcard 404 routes etc
78
+ ];
79
+ ```
80
+
81
+ ### Configure store
82
+
83
+ ##### store.js
84
+
85
+ ```js
86
+ import { Auth } from "@fishawack/lab-velocity";
87
+
88
+ // Call in store
89
+ {
90
+ plugins: [
91
+ VuexPersistedState({
92
+ // ...
93
+ paths: ["auth.user"],
94
+ }),
95
+ ],
96
+
97
+ modules: {
98
+ auth: Auth.Store,
99
+ },
100
+
101
+ // ...
102
+ }
103
+ ```
104
+
105
+ ### Base Styles
106
+
107
+ @fishawack/lab-velocity extends @fishawack/lab-ui, for this reason you should replace the two references to variables & defaults with @fishawack/lab-velocity ones.
20
108
 
21
- Frontend files to to work with the Hydrate Module.
109
+ #### \_variables.scss
22
110
 
23
- #### Installation
111
+ ```sass
112
+ @import "@fishawack/lab-velocity/variables";
113
+
114
+ // Set global variables here, e.g $color6: red;
115
+ ```
24
116
 
25
- ##### Import Axios File
117
+ #### \_defaults.scss
26
118
 
27
- import axios from "axios";
28
- import "@fishawack/lab-velocity/AuthModule/js/AuthAxios.js";
119
+ ```sass
120
+ @use "variables";
121
+ @import "@fishawack/lab-velocity/defaults";
29
122
 
30
- ##### Import Routes File
123
+ $colors: variables.dynamic("color", module-variables("variables"));
31
124
 
32
- Inside Router.js file
33
- import { authRoutes, configureRoutes } from "@fishawack/lab-velocity/AuthModule/js/AuthRoutes";
125
+ // Override lab-ui defaults here, e.g $button: $color6;
126
+ ```
34
127
 
35
- let routes = require("./routes.js")(null, store).concat(authRoutes(null,store,store.state.auth.authBase));
36
- Add routes to createRouter call
128
+ ### Route Styles
37
129
 
38
- add method call after createRouter
39
- configureRoutes(router);
130
+ There are two different set of sass imports for the admin and the frontend routes.
40
131
 
41
- ##### Import Store
132
+ #### Frontend
42
133
 
43
- import AuthStore from "@fishawack/lab-velocity/AuthModule/js/AuthStore.js";
44
- Inside createStore method add
45
- modules: {
46
- auth: AuthStore
47
- },
48
- Inside VuexPersistedState add
49
- paths:["auth"]
134
+ ```sass
135
+ // Vendor imports / Lab-ui imports
136
+ @import "@fishawack/lab-ui/typography";
137
+ @import "@fishawack/lab-ui/grid";
138
+ @import "@fishawack/lab-ui/utilities";
139
+ @import "@fishawack/lab-ui/icon";
50
140
 
51
- At bottom of file set
52
- window.store = store;
141
+ // Lab velocity
142
+ @import "@fishawack/lab-velocity/base";
143
+ @import "@fishawack/lab-velocity/components/basic";
144
+ @import "@fishawack/lab-velocity/components/button";
145
+ @import "@fishawack/lab-velocity/components/form";
146
+ @import "@fishawack/lab-velocity/components/auth";
147
+ ```
53
148
 
54
- ##### SVGS
149
+ #### Admin
150
+
151
+ ##### vendor.scss
152
+
153
+ ```sass
154
+ // Vendor imports / Lab-ui imports
155
+ @import "@fishawack/lab-ui/typography";
156
+ @import "@fishawack/lab-ui/grid";
157
+ @import "@fishawack/lab-ui/utilities";
158
+
159
+ // Lab velocity
160
+ @import "@fishawack/lab-velocity/base";
161
+ @import "@fishawack/lab-velocity/components/pageTitle";
162
+ @import "@fishawack/lab-velocity/components/breadcrumbs";
163
+ @import "@fishawack/lab-velocity/components/table";
164
+ @import "@fishawack/lab-velocity/components/icon";
165
+ @import "@fishawack/lab-velocity/components/basic";
166
+ @import "@fishawack/lab-velocity/components/button";
167
+ @import "@fishawack/lab-velocity/components/form";
168
+ @import "@fishawack/lab-velocity/components/checkbox";
169
+ @import "@fishawack/lab-velocity/components/select";
170
+ @import "@fishawack/lab-velocity/components/loader";
171
+ @import "@fishawack/lab-velocity/components/permissionLegend";
172
+ @import "@fishawack/lab-velocity/components/chip";
173
+ ```
55
174
 
56
- Ensure Content has Velocity pulled in
57
- {
58
- "lftp": "ftp-fishawack.egnyte.com",
59
- "location": "Shared/FW/Knutsford/Digital/Auto-Content/Lab/Velocity"
60
- }
61
- Copy out the svg folder contents into the svg files within vue.
175
+ ### Icons
62
176
 
63
- ##### ENV VARS
177
+ Ensure Content has Velocity pulled in & copy out the svg folder contents into the svg files within vue.
64
178
 
65
- HYDRATE_LOGO=example-logo
179
+ ```json
180
+ {
181
+ "lftp": "ftp-fishawack.egnyte.com",
182
+ "location": "Shared/FW/Knutsford/Digital/Auto-Content/Lab/Velocity"
183
+ }
184
+ ```
66
185
 
67
- HYDRATE_LOGO=example-logo(No Default set, name of svg logo to display on page)
68
- HYDRATE_REDIRECT=(Default index if not configured)
69
- HYDRATE_CONTACT=(Default mailto:EP@avalerehealth, Email for contact us button)
186
+ ### ENV VARS (frontend)
70
187
 
71
- ##### Verify dependencies are installed
188
+ ```env
189
+ # Required
190
+ HYDRATE_LOGO=example-logo
72
191
 
73
- Axios
74
- form-backend-validation
192
+ # Descriptions
193
+ HYDRATE_LOGO Name of svg logo to display on page
194
+ HYDRATE_REDIRECT Default index if not configured
195
+ HYDRATE_CONTACT Default mailto:EP@avalerehealth, Email for contact us button
196
+ ```
@@ -0,0 +1,33 @@
1
+ <template>
2
+ <div class="vel-icon">
3
+ <VSvg v-bind="$props" />
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ import VSvg from "./Svg.vue";
9
+
10
+ export default {
11
+ props: {
12
+ name: {
13
+ type: String,
14
+ required: true,
15
+ },
16
+ embed: {
17
+ type: Boolean,
18
+ default: false,
19
+ },
20
+ asis: {
21
+ type: Boolean,
22
+ default: false,
23
+ },
24
+ artboard: {
25
+ type: Boolean,
26
+ default: false,
27
+ },
28
+ },
29
+ components: {
30
+ VSvg,
31
+ },
32
+ };
33
+ </script>
@@ -0,0 +1,45 @@
1
+ <template>
2
+ <div v-if="embed">
3
+ <component v-if="embed" :is="icon" class="vel-svg" />
4
+ </div>
5
+ <svg v-else class="vel-svg">
6
+ <use :xlink:href="'#' + name" />
7
+ </svg>
8
+ </template>
9
+
10
+ <script>
11
+ import { defineAsyncComponent } from "vue";
12
+ export default {
13
+ props: {
14
+ name: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ embed: {
19
+ type: Boolean,
20
+ default: false,
21
+ },
22
+ asis: {
23
+ type: Boolean,
24
+ default: false,
25
+ },
26
+ },
27
+ data() {
28
+ return {
29
+ icons: import.meta.glob(
30
+ `../../handlebars/generated/embed/**/*.svg`,
31
+ { query: "?component" },
32
+ ),
33
+ };
34
+ },
35
+ computed: {
36
+ icon() {
37
+ return defineAsyncComponent(() =>
38
+ this.icons[
39
+ `../../handlebars/generated/embed/svg${this.asis ? "--asis" : ""}--${this.name}.svg`
40
+ ](),
41
+ );
42
+ },
43
+ },
44
+ };
45
+ </script>
@@ -0,0 +1,109 @@
1
+ <template>
2
+ <el-button
3
+ :class="[`vel-button ${baseClass}__button`]"
4
+ :name="name"
5
+ :id="name"
6
+ :disabled="disabled"
7
+ :round="round"
8
+ :circle="circle"
9
+ :size="size"
10
+ :text="text"
11
+ :tag="tag"
12
+ :autofocus="autofocus"
13
+ :native-type="nativeType"
14
+ :type="type"
15
+ :link="link"
16
+ :plain="plain"
17
+ :loading="loading"
18
+ :customIcon="customIcon"
19
+ :href="href"
20
+ :target="target"
21
+ >
22
+ <slot />
23
+ </el-button>
24
+ </template>
25
+
26
+ <script>
27
+ import { ElButton } from "element-plus";
28
+
29
+ export default {
30
+ props: {
31
+ baseClass: {
32
+ type: String,
33
+ default: "vel-button",
34
+ },
35
+ type: {
36
+ type: String,
37
+ default: "default",
38
+ },
39
+ name: {
40
+ type: String,
41
+ default: null,
42
+ },
43
+ nativeType: {
44
+ type: String,
45
+ default: "button",
46
+ },
47
+ size: {
48
+ type: String,
49
+ default: "default",
50
+ },
51
+ round: {
52
+ type: Boolean,
53
+ default: false,
54
+ },
55
+ circle: {
56
+ type: Boolean,
57
+ default: false,
58
+ },
59
+ disabled: {
60
+ type: Boolean,
61
+ default: false,
62
+ },
63
+ autofocus: {
64
+ type: Boolean,
65
+ default: false,
66
+ },
67
+ text: {
68
+ type: Boolean,
69
+ default: false,
70
+ },
71
+ link: {
72
+ type: Boolean,
73
+ default: false,
74
+ },
75
+ plain: {
76
+ type: Boolean,
77
+ default: false,
78
+ },
79
+ tag: {
80
+ type: String,
81
+ default: "button",
82
+ },
83
+ loading: {
84
+ type: Boolean,
85
+ default: false,
86
+ },
87
+ customIcon: {
88
+ type: String,
89
+ default: null,
90
+ },
91
+ iconClasses: {
92
+ type: String,
93
+ default: "",
94
+ },
95
+ href: {
96
+ type: String,
97
+ default: null,
98
+ },
99
+ target: {
100
+ type: String,
101
+ default: null,
102
+ },
103
+ },
104
+
105
+ components: {
106
+ ElButton,
107
+ },
108
+ };
109
+ </script>
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <el-link
3
+ :class="[
4
+ `link ${baseClass} vel-link--${size} ${underline ? 'vel-link--underline' : ''}`,
5
+ ]"
6
+ :name="name"
7
+ :underline="underline"
8
+ :id="name"
9
+ :disabled="disabled"
10
+ :href="href"
11
+ :target="target"
12
+ >
13
+ <slot />
14
+ </el-link>
15
+ </template>
16
+
17
+ <script>
18
+ import { ElLink } from "element-plus";
19
+
20
+ export default {
21
+ props: {
22
+ baseClass: {
23
+ type: String,
24
+ default: "vel-link",
25
+ },
26
+ type: {
27
+ type: String,
28
+ default: null,
29
+ },
30
+ underline: {
31
+ type: Boolean,
32
+ default: true,
33
+ },
34
+ href: {
35
+ type: String,
36
+ default: null,
37
+ },
38
+ target: {
39
+ type: String,
40
+ default: null,
41
+ },
42
+ size: {
43
+ type: String,
44
+ default: "default",
45
+ },
46
+ name: {
47
+ type: String,
48
+ default: null,
49
+ },
50
+ disabled: {
51
+ type: Boolean,
52
+ default: false,
53
+ },
54
+ autofocus: {
55
+ type: Boolean,
56
+ default: false,
57
+ },
58
+ },
59
+
60
+ components: {
61
+ ElLink,
62
+ },
63
+ };
64
+ </script>
@@ -0,0 +1,85 @@
1
+ <template>
2
+ <XInput v-bind="$props">
3
+ <template #label>
4
+ <slot name="label" />
5
+ </template>
6
+ <el-cascader
7
+ class="block"
8
+ v-model="content"
9
+ :options="options"
10
+ :placeholder="placeholder"
11
+ :clearable="clearable"
12
+ :show-all-levels="showAllLevels"
13
+ :props="{
14
+ multiple: multiple,
15
+ checkStrictly: checkStrictly,
16
+ }"
17
+ />
18
+ </XInput>
19
+ </template>
20
+
21
+ <script>
22
+ import { ElCascader } from "element-plus";
23
+ import input from "./input.js";
24
+ import XInput from "./input.vue";
25
+
26
+ export default {
27
+ mixins: [input],
28
+ props: {
29
+ baseClass: {
30
+ type: String,
31
+ default: "vel-cascader",
32
+ },
33
+ multiple: {
34
+ type: Boolean,
35
+ default: false,
36
+ },
37
+ checkStrictly: {
38
+ type: Boolean,
39
+ default: false,
40
+ },
41
+ clearable: {
42
+ type: Boolean,
43
+ default: false,
44
+ },
45
+ showAllLevels: {
46
+ type: Boolean,
47
+ default: false,
48
+ },
49
+ options: {
50
+ type: Array,
51
+ default: [],
52
+ },
53
+ ...input.props,
54
+ },
55
+ components: {
56
+ XInput,
57
+ ElCascader,
58
+ },
59
+
60
+ emits: ["change", "clear", "blur"],
61
+ methods: {
62
+ castValue(value) {
63
+ if (
64
+ !_.isNull(value) &&
65
+ typeof value === "string" &&
66
+ !isNaN(Number(value))
67
+ ) {
68
+ return parseInt(value);
69
+ }
70
+ return value;
71
+ },
72
+ handleInput(value, $event) {
73
+ this.$emit("change", value);
74
+ },
75
+ },
76
+
77
+ data() {
78
+ return {
79
+ pr: {
80
+ multiple: true,
81
+ },
82
+ };
83
+ },
84
+ };
85
+ </script>
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <XInput v-bind="$props">
3
+ <el-checkbox
4
+ :class="[`${baseClass}__checkbox`]"
5
+ :id="name"
6
+ :disabled="disabled"
7
+ v-model="content"
8
+ :required="required"
9
+ @change="handleInput"
10
+ >
11
+ </el-checkbox>
12
+ </XInput>
13
+ </template>
14
+
15
+ <script>
16
+ import { ElCheckbox } from "element-plus";
17
+ import input from "./input.js";
18
+ import XInput from "./input.vue";
19
+
20
+ export default {
21
+ mixins: [input],
22
+ props: {
23
+ ...input.props,
24
+ modelValue: {
25
+ type: Boolean,
26
+ default: null,
27
+ },
28
+ baseClass: {
29
+ type: String,
30
+ default: "vel-checkbox",
31
+ },
32
+ },
33
+
34
+ components: {
35
+ XInput,
36
+ ElCheckbox,
37
+ },
38
+ };
39
+ </script>
@@ -0,0 +1,91 @@
1
+ <template>
2
+ <XInput v-bind="$props">
3
+ <el-checkbox-group
4
+ :class="[`${baseClass}__wrapper`]"
5
+ :id="name"
6
+ :disabled="disabled"
7
+ :size="size"
8
+ :min="min"
9
+ :max="max"
10
+ v-model="content"
11
+ :required="required"
12
+ @change="handleInput"
13
+ :checkboxButton="checkboxButton"
14
+ >
15
+ <el-checkbox
16
+ v-if="!checkboxButton"
17
+ :key="index"
18
+ v-for="({ label, value, disabled }, index) in options"
19
+ :label="label"
20
+ :value="value"
21
+ :disabled="disabled"
22
+ >
23
+ <slot name="label" :label="label" :value="value">
24
+ <span v-html="label"></span>
25
+ </slot>
26
+ </el-checkbox>
27
+ <el-checkbox-button
28
+ v-else
29
+ :key="indexB"
30
+ v-for="({ label, value, disabled }, indexB) in options"
31
+ :label="label"
32
+ :value="value"
33
+ :disabled="disabled"
34
+ >
35
+ <slot name="label" :label="label" :value="value">
36
+ <span v-html="label"></span>
37
+ </slot>
38
+ </el-checkbox-button>
39
+ </el-checkbox-group>
40
+ </XInput>
41
+ </template>
42
+
43
+ <script>
44
+ import { ElCheckbox } from "element-plus";
45
+ import { ElCheckboxButton } from "element-plus";
46
+ import { ElCheckboxGroup } from "element-plus";
47
+ import input from "./input.js";
48
+ import XInput from "./input.vue";
49
+
50
+ export default {
51
+ mixins: [input],
52
+ props: {
53
+ ...input.props,
54
+ modelValue: {
55
+ type: Array,
56
+ default: [],
57
+ },
58
+ baseClass: {
59
+ type: String,
60
+ default: "vel-checkbox-group",
61
+ },
62
+ checkboxButton: {
63
+ type: Boolean,
64
+ default: false,
65
+ },
66
+ size: {
67
+ type: String,
68
+ default: "default",
69
+ },
70
+ min: {
71
+ type: Number,
72
+ default: 0,
73
+ },
74
+ max: {
75
+ type: Number,
76
+ default: 100,
77
+ },
78
+ options: {
79
+ type: Array,
80
+ default: [],
81
+ },
82
+ },
83
+
84
+ components: {
85
+ XInput,
86
+ ElCheckbox,
87
+ ElCheckboxButton,
88
+ ElCheckboxGroup,
89
+ },
90
+ };
91
+ </script>