@energysage/es-ds-components 3.0.0-alpha.2 → 3.0.0-alpha.4
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/components/es-radio-button.vue +62 -0
- package/nuxt.config.ts +40 -1
- package/package.json +23 -13
- package/tsconfig.json +4 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="`custom-control custom-radio custom-control${inline ? '-inline' : ''}`">
|
|
3
|
+
<radio-button
|
|
4
|
+
class="custom-control-input"
|
|
5
|
+
input-class="custom-radio-input"
|
|
6
|
+
v-model="localValue"
|
|
7
|
+
:disabled="disabled"
|
|
8
|
+
:input-id="`${value}-${groupName}`"
|
|
9
|
+
:name="groupName"
|
|
10
|
+
:value="value" />
|
|
11
|
+
<label :for="`${value}-${groupName}`" class="custom-control-label">{{ displayName }}</label>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script setup lang="ts">
|
|
16
|
+
import { ref, watch } from 'vue';
|
|
17
|
+
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
disabled: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false,
|
|
22
|
+
},
|
|
23
|
+
displayName: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: true,
|
|
26
|
+
default: "",
|
|
27
|
+
},
|
|
28
|
+
groupName: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: false,
|
|
31
|
+
default: "",
|
|
32
|
+
},
|
|
33
|
+
inline: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false,
|
|
36
|
+
},
|
|
37
|
+
modelValue: {
|
|
38
|
+
type: String,
|
|
39
|
+
required: true,
|
|
40
|
+
default: "",
|
|
41
|
+
},
|
|
42
|
+
value: {
|
|
43
|
+
type: String,
|
|
44
|
+
required: true,
|
|
45
|
+
default: "",
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const emit = defineEmits(['update:modelValue']);
|
|
50
|
+
const localValue = ref(props.modelValue);
|
|
51
|
+
|
|
52
|
+
// Watch for changes to the local value and emit them
|
|
53
|
+
watch(localValue, (newValue) => {
|
|
54
|
+
emit('update:modelValue', newValue);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// Watch for prop changes and update the local value
|
|
58
|
+
watch(() => props.modelValue, (newValue) => {
|
|
59
|
+
localValue.value = newValue;
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
</script>
|
package/nuxt.config.ts
CHANGED
|
@@ -1,2 +1,41 @@
|
|
|
1
1
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
2
|
-
export default defineNuxtConfig({
|
|
2
|
+
export default defineNuxtConfig({
|
|
3
|
+
|
|
4
|
+
compatibilityDate: '2024-04-03',
|
|
5
|
+
|
|
6
|
+
// https://nuxt.com/docs/getting-started/styling#the-css-property
|
|
7
|
+
css: [
|
|
8
|
+
'@energysage/es-ds-styles/scss/bootstrap.scss',
|
|
9
|
+
],
|
|
10
|
+
|
|
11
|
+
// https://google-fonts.nuxtjs.org/options
|
|
12
|
+
googleFonts: {
|
|
13
|
+
preload: true,
|
|
14
|
+
download: false,
|
|
15
|
+
display: 'swap',
|
|
16
|
+
families: {
|
|
17
|
+
'Plus+Jakarta+Sans': {
|
|
18
|
+
wght: '200..800',
|
|
19
|
+
ital: '200..800',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
modules: [
|
|
25
|
+
// https://google-fonts.nuxtjs.org/getting-started/setup
|
|
26
|
+
'@nuxtjs/google-fonts',
|
|
27
|
+
// https://v3.primevue.org/nuxt
|
|
28
|
+
'nuxt-primevue'
|
|
29
|
+
],
|
|
30
|
+
|
|
31
|
+
primevue: {
|
|
32
|
+
options: {
|
|
33
|
+
unstyled: true
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
sourcemap: {
|
|
38
|
+
server: true,
|
|
39
|
+
client: true
|
|
40
|
+
},
|
|
41
|
+
})
|
package/package.json
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
2
|
+
"name": "@energysage/es-ds-components",
|
|
3
|
+
"version": "3.0.0-alpha.4",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "An EnergySage Vue component library",
|
|
7
|
+
"main": "./nuxt.config.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
10
|
+
},
|
|
11
|
+
"author": "EnergySage",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@energysage/es-ds-styles": "^3.0.0-alpha.3",
|
|
15
|
+
"@nuxtjs/google-fonts": "^3.2.0",
|
|
16
|
+
"nuxt": "^3.12.4",
|
|
17
|
+
"primevue": "^3.53.0",
|
|
18
|
+
"prismjs": "^1.29.0",
|
|
19
|
+
"vue": "^3.4.34"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"nuxt-primevue": "^3.0.0",
|
|
23
|
+
"sass": "^1.77.8"
|
|
24
|
+
}
|
|
15
25
|
}
|
package/tsconfig.json
ADDED