@policystudio/policy-studio-ui-vue 1.1.90-beta.4 → 1.1.90-beta.41

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 (158) hide show
  1. package/.eslintrc.js +2 -8
  2. package/.github/workflows/deploy-storybook.yml +4 -4
  3. package/.nvmrc +1 -0
  4. package/dist/css/psui_styles_output.css +6607 -0
  5. package/dist/index.d.ts +51 -0
  6. package/dist/index.js +106 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/util/GeneralFunctions.d.ts +3 -0
  9. package/dist/util/GeneralFunctions.js +35 -0
  10. package/dist/util/GeneralFunctions.js.map +1 -0
  11. package/dist/util/directives.d.ts +1 -0
  12. package/dist/util/directives.js +22 -0
  13. package/dist/util/directives.js.map +1 -0
  14. package/dist/util/imageLoader.d.ts +6 -0
  15. package/dist/util/imageLoader.js +52 -0
  16. package/dist/util/imageLoader.js.map +1 -0
  17. package/doc/.nvmrc +1 -0
  18. package/{.storybook → doc/.storybook}/main.ts +8 -2
  19. package/{.storybook → doc/.storybook}/preview.ts +2 -3
  20. package/doc/package-lock.json +22653 -0
  21. package/doc/package.json +71 -0
  22. package/{src → doc}/shims-vue.d.ts +0 -5
  23. package/{src → doc/src}/stories/Accordion.stories.ts +2 -3
  24. package/{src → doc/src}/stories/BadgeWithIcon.stories.ts +1 -1
  25. package/{src → doc/src}/stories/BarChart.stories.ts +1 -1
  26. package/{src → doc/src}/stories/Breadcrumb.stories.ts +1 -1
  27. package/doc/src/stories/Button.stories.ts +130 -0
  28. package/{src → doc/src}/stories/CardInfos.stories.ts +1 -1
  29. package/{src → doc/src}/stories/ChartLegend.stories.ts +1 -1
  30. package/{src → doc/src}/stories/Checkbox.stories.ts +1 -1
  31. package/{src → doc/src}/stories/CheckboxSimple.stories.ts +1 -1
  32. package/{src → doc/src}/stories/Chips.stories.ts +1 -4
  33. package/{src → doc/src}/stories/ClimateZoneBadge.stories.ts +2 -1
  34. package/doc/src/stories/Collapse.stories.ts +46 -0
  35. package/{src → doc/src}/stories/CostEffectBar.stories.ts +2 -1
  36. package/{src → doc/src}/stories/Datatable.stories.ts +5 -2
  37. package/{src → doc/src}/stories/DateCardInfo.stories.ts +1 -1
  38. package/{src → doc/src}/stories/Dialog.stories.ts +2 -2
  39. package/{src → doc/src}/stories/Draggable.stories.ts +3 -2
  40. package/{src → doc/src}/stories/Dropdown.stories.ts +4 -3
  41. package/{src → doc/src}/stories/DropdownList.stories.ts +4 -2
  42. package/{src → doc/src}/stories/HighlightRippleDot.stories.ts +3 -2
  43. package/{src → doc/src}/stories/Icon.stories.ts +3 -1
  44. package/{src → doc/src}/stories/InlineSelector.stories.ts +1 -1
  45. package/{src → doc/src}/stories/Input.stories.ts +7 -4
  46. package/{src → doc/src}/stories/InputSelect.stories.ts +3 -2
  47. package/{src → doc/src}/stories/InputTextArea.stories.ts +1 -1
  48. package/{src → doc/src}/stories/MiniTag.stories.ts +9 -2
  49. package/{src → doc/src}/stories/ProgressBar.stories.ts +3 -2
  50. package/{src → doc/src}/stories/RadioButton.stories.ts +2 -2
  51. package/{src → doc/src}/stories/RadioButtonSimple.stories.ts +1 -1
  52. package/{src → doc/src}/stories/SimpleAlert.stories.ts +3 -2
  53. package/{src → doc/src}/stories/Slider.stories.ts +6 -2
  54. package/{src → doc/src}/stories/Switch.stories.ts +2 -2
  55. package/{src → doc/src}/stories/TabHeader.stories.ts +6 -1
  56. package/{src → doc/src}/stories/TableResults.stories.ts +11 -7
  57. package/{src → doc/src}/stories/TagScope.stories.ts +3 -2
  58. package/{src → doc/src}/stories/TestimonialCard.stories.ts +3 -3
  59. package/{src → doc/src}/stories/Toast.stories.ts +2 -2
  60. package/{src → doc/src}/stories/Toggle.stories.ts +6 -3
  61. package/{src → doc/src}/stories/Tooltip.stories.ts +3 -3
  62. package/doc/tsconfig.json +17 -0
  63. package/package.json +13 -28
  64. package/scripts/gulp.js +11 -0
  65. package/src/assets/scss/base.scss +3 -34
  66. package/src/assets/scss/components/PsAccordion.scss +1 -1
  67. package/src/assets/scss/components/PsCollapse.scss +74 -0
  68. package/src/assets/scss/components/PsDataTable.scss +1 -1
  69. package/src/assets/scss/components/PsDropdownList.scss +1 -1
  70. package/src/assets/scss/components/PsTooltip.scss +2 -1
  71. package/src/components/accordion/PsAccordionItem.vue +88 -74
  72. package/src/components/badges-and-tags/PsBadgeWithIcon.vue +31 -34
  73. package/src/components/badges-and-tags/PsCardInfos.vue +39 -41
  74. package/src/components/badges-and-tags/PsChartLegend.vue +46 -51
  75. package/src/components/badges-and-tags/PsClimateZoneBadge.vue +13 -19
  76. package/src/components/badges-and-tags/PsCostEffectBar.vue +24 -56
  77. package/src/components/badges-and-tags/PsDateCardInfo.vue +17 -18
  78. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +3 -2
  79. package/src/components/badges-and-tags/PsMiniTag.vue +39 -41
  80. package/src/components/badges-and-tags/PsProgressBar.vue +72 -68
  81. package/src/components/badges-and-tags/PsTagScope.vue +17 -22
  82. package/src/components/badges-and-tags/PsTestimonialCard.vue +19 -26
  83. package/src/components/buttons/PsButton.vue +61 -62
  84. package/src/components/chips/PsChips.vue +98 -101
  85. package/src/components/collapse/PsCollapse.vue +124 -0
  86. package/src/components/controls/PsCheckbox.vue +84 -84
  87. package/src/components/controls/PsCheckboxSimple.vue +95 -95
  88. package/src/components/controls/PsDraggable.vue +53 -55
  89. package/src/components/controls/PsInlineSelector.vue +98 -99
  90. package/src/components/controls/PsRadioButton.vue +65 -58
  91. package/src/components/controls/PsRadioButtonSimple.vue +79 -75
  92. package/src/components/controls/PsSlider.vue +185 -176
  93. package/src/components/controls/PsSwitch.vue +51 -52
  94. package/src/components/controls/PsToggle.vue +52 -50
  95. package/src/components/data-graphics/PsBarChart.vue +18 -21
  96. package/src/components/datatable/PsDataTable.vue +56 -60
  97. package/src/components/datatable/PsDataTableItem.vue +13 -28
  98. package/src/components/forms/PsDropdown.vue +166 -162
  99. package/src/components/forms/PsDropdownList.vue +133 -130
  100. package/src/components/forms/PsInput.vue +154 -153
  101. package/src/components/forms/PsInputSelect.vue +91 -92
  102. package/src/components/forms/PsInputTextArea.vue +70 -71
  103. package/src/components/navigations/PsBreadcrumb.vue +25 -34
  104. package/src/components/notifications/PsDialog.vue +57 -56
  105. package/src/components/notifications/PsSimpleAlert.vue +27 -29
  106. package/src/components/notifications/PsToast.vue +40 -39
  107. package/src/components/table-results/PsTableResults.vue +461 -468
  108. package/src/components/table-results/PsTableResultsBody.vue +66 -67
  109. package/src/components/table-results/PsTableResultsHead.vue +67 -61
  110. package/src/components/table-results/PsTableResultsHeadComparison.vue +62 -56
  111. package/src/components/table-results/PsTableResultsHeadFlexible.vue +68 -61
  112. package/src/components/table-results/PsTableResultsRow.vue +55 -56
  113. package/src/components/tabs/PsTabHeader.vue +106 -100
  114. package/src/components/tooltip/PsDialogTooltip.vue +96 -101
  115. package/src/components/tooltip/PsRichTooltip.vue +41 -45
  116. package/src/components/tooltip/PsTooltip.vue +111 -116
  117. package/src/components/ui/PsDotLoader.vue +1 -5
  118. package/src/components/ui/PsIcon.vue +128 -129
  119. package/src/index.ts +60 -67
  120. package/src/tsconfig.json +12 -0
  121. package/src/types/index.d.ts +6 -0
  122. package/src/util/{GeneralFunctions.ts → GeneralFunctions.js} +12 -3
  123. package/src/util/directives.ts +24 -0
  124. package/src/util/{imageLoader.ts → imageLoader.js} +7 -0
  125. package/tailwind.config.js +1 -1
  126. package/tsconfig.json +18 -13
  127. package/.storybook/eventBus.ts +0 -26
  128. package/babel.config.js +0 -17
  129. package/dist/css/psui_styles.css +0 -4647
  130. package/postcss.config.js +0 -8
  131. package/src/components/playground/PsScrollBar.vue +0 -320
  132. package/src/stories/Button.stories.ts +0 -48
  133. package/src/stories/Button.vue +0 -59
  134. package/src/stories/Header.stories.ts +0 -41
  135. package/src/stories/Header.vue +0 -77
  136. package/src/stories/Playground.stories.ts +0 -16
  137. package/src/stories/button.css +0 -30
  138. package/src/stories/header.css +0 -32
  139. package/webpack.config.js +0 -22
  140. /package/{.storybook → doc/.storybook}/PolicyStudio.ts +0 -0
  141. /package/{.storybook → doc/.storybook}/manager.ts +0 -0
  142. /package/{src → doc/src}/assets/images/multifamily-units.svg +0 -0
  143. /package/{src → doc/src}/assets/images/policy-studio.svg +0 -0
  144. /package/{src → doc/src}/contents/ComparisonData.ts +0 -0
  145. /package/{src → doc/src}/contents/FlexibleData.ts +0 -0
  146. /package/{src → doc/src}/contents/ResultsData.ts +0 -0
  147. /package/{src → doc/src}/stories/Colors.mdx +0 -0
  148. /package/{src → doc/src}/stories/ElevationSystem.mdx +0 -0
  149. /package/{src → doc/src}/stories/Introduction.mdx +0 -0
  150. /package/{src → doc/src}/stories/Typography.mdx +0 -0
  151. /package/{src → doc/src}/stories/assets/code-brackets.svg +0 -0
  152. /package/{src → doc/src}/stories/assets/colors.svg +0 -0
  153. /package/{src → doc/src}/stories/assets/comments.svg +0 -0
  154. /package/{src → doc/src}/stories/assets/direction.svg +0 -0
  155. /package/{src → doc/src}/stories/assets/flow.svg +0 -0
  156. /package/{src → doc/src}/stories/assets/plugin.svg +0 -0
  157. /package/{src → doc/src}/stories/assets/repo.svg +0 -0
  158. /package/{src → doc/src}/stories/assets/stackalt.svg +0 -0
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <div
3
- class="psui-el-chips"
2
+ <div
3
+ class="psui-el-chips"
4
4
  :class="[getComponentClass, `layout-${layout}`, `type-${type}`]"
5
5
  >
6
6
  <input
@@ -14,16 +14,16 @@
14
14
  <label
15
15
  :disabled="disabled"
16
16
  :for="getInputId"
17
- :class="{'checked':checked && type === 'button'}"
17
+ :class="{'checked': checked && type === 'button' }"
18
18
  >
19
19
  <i
20
20
  v-if="icon"
21
21
  class="psui-el-chips-icon psui-el-chips-icon-prepend"
22
22
  >{{ icon }}</i>
23
23
  {{ label }}
24
- <button
25
- @click="onClose"
26
- v-if="layout === 'rich'"
24
+ <button
25
+ @click="onClose"
26
+ v-if="layout === 'rich'"
27
27
  class="psui-el-chips-close"
28
28
  >
29
29
  <span class="psui-el-chips-icon">close</span>
@@ -32,105 +32,102 @@
32
32
  </div>
33
33
  </template>
34
34
 
35
- <script>
36
- export const type = ['radio', 'checkbox', 'button']
37
- import { randomString } from '../../util/GeneralFunctions'
35
+ <script setup>
36
+ import { computed, useAttrs } from 'vue'
38
37
 
39
- export default {
40
- name: 'PsChips',
41
- props: {
42
- /**
43
- * It sets the label of the chips button.
44
- */
45
- label: {
46
- type: String,
47
- default: '',
48
- },
49
- /**
50
- * It sets the type of the chips button. eg: radio, checkbox, button.
51
- */
52
- type: {
53
- type: String,
54
- required: true,
55
- default: 'button',
56
- validator: (type) => ['radio', 'checkbox', 'button'].includes(type)
57
- },
58
- /**
59
- * It sets the layout of the chipsbutton. eg: simple, with-icon, rich.
60
- */
61
- layout: {
62
- type: String,
63
- default: 'simple',
64
- validator: (value) => ['simple', 'with-icon', 'rich'].includes(value)
65
- },
66
- /**
67
- * It sets the text key which will retrieve a icon from Google Fonts. Make sure to get the right description of your icon on https://fonts.google.com/.
68
- */
69
- icon: {
70
- type: String,
71
- default: '',
72
- },
73
- /**
74
- * It sets if the button was checked or not checked.
75
- */
76
- checked: {
77
- type: Boolean,
78
- default: false
79
- },
80
- /**
81
- * It disables the chips button.
82
- */
83
- disabled: {
84
- type: Boolean,
85
- default: false
86
- },
87
- /**
88
- * It sets if the button is active or not.
89
- */
90
- active: {
91
- type: Boolean,
92
- default: false
93
- },
94
- /**
95
- * Add html attributes to the element input
96
- */
97
- inputAttrs: {
98
- type: Object,
99
- default: () => ({})
100
- },
38
+ import { randomString } from '../../util/GeneralFunctions.js'
39
+
40
+ const emit = defineEmits(['click', 'change', 'update:checked', 'close'])
41
+
42
+ const attrs = useAttrs()
43
+
44
+ const props = defineProps({
45
+ /**
46
+ * It sets the label of the chips button.
47
+ */
48
+ label: {
49
+ type: String,
50
+ default: '',
51
+ },
52
+ type: {
53
+ type: String,
54
+ required: true,
55
+ default: 'button',
56
+ validator: (type) => ['radio', 'checkbox', 'button'].includes(type),
57
+ },
58
+ /**
59
+ * It sets the layout of the chipsbutton. eg: simple, with-icon, rich.
60
+ */
61
+ layout: {
62
+ type: String,
63
+ default: 'simple',
64
+ validator: (value) => ['simple', 'with-icon', 'rich'].includes(value),
65
+ },
66
+ /**
67
+ * It sets the text key which will retrieve a icon from Google Fonts. Make sure to get the right description of your icon on https://fonts.google.com/.
68
+ */
69
+ icon: {
70
+ type: String,
71
+ default: '',
72
+ },
73
+ /**
74
+ * It sets if the button was checked or not checked.
75
+ */
76
+ checked: {
77
+ type: Boolean,
78
+ default: false,
101
79
  },
102
- emits: ['click', 'change'],
103
- computed: {
104
- getComponentClass() {
105
- if (this.disabled) {
106
- return 'status-disabled'
107
- } else {
108
- return 'status-resting'
109
- }
110
- },
111
- getInputId() {
112
- if (this?.inputAttrs?.id) {
113
- return this.inputAttrs.id
114
- } else if (this?.$attrs?.id) {
115
- return this.$attrs.id
116
- } else {
117
- return randomString(16)
118
- }
119
- },
80
+ /**
81
+ * It disables the chips button.
82
+ */
83
+ disabled: {
84
+ type: Boolean,
85
+ default: false,
120
86
  },
121
- methods: {
122
- onClick() {
123
- this.$emit('click')
124
- },
125
- onChange(event) {
126
- this.$emit('update:checked', event.target.checked)
127
- this.$emit('change', event)
128
- },
129
- onClose() {
130
- this.$emit('close')
131
- },
87
+ /**
88
+ * It sets if the button is active or not.
89
+ */
90
+ active: {
91
+ type: Boolean,
92
+ default: false,
132
93
  },
94
+ /**
95
+ * Add html attributes to the element input
96
+ */
97
+ inputAttrs: {
98
+ type: Object,
99
+ default: () => ({}),
100
+ },
101
+ })
102
+
103
+ const getComponentClass = computed(() => {
104
+ if (props.disabled) {
105
+ return 'status-disabled'
106
+ } else {
107
+ return 'status-resting'
108
+ }
109
+ })
110
+
111
+ const getInputId = computed(() => {
112
+ if (props?.inputAttrs?.id) {
113
+ return props.inputAttrs.id
114
+ } else if (attrs?.id) {
115
+ return attrs.id
116
+ } else {
117
+ return randomString(16)
118
+ }
119
+ })
120
+
121
+ const onChange = (event) => {
122
+ emit('update:checked', event.target.checked)
123
+ emit('change', event)
124
+ }
125
+
126
+ const onClose = () => {
127
+ emit('close')
133
128
  }
134
129
  </script>
135
130
 
136
- <style> /* Please, use the file src/assets/scss/components/PsChips.scss */</style>
131
+ <style>
132
+ /* Please, use the file src/assets/scss/components/PsChips.scss */
133
+ </style>
@@ -0,0 +1,124 @@
1
+ <template>
2
+ <div
3
+ class="psui-el-collapse"
4
+ :class="{ 'status-opened': isOpen, 'disabled': disabled }"
5
+ >
6
+ <div
7
+ class="psui-el-collapse-item-header"
8
+ @click="toggle"
9
+ >
10
+ <i
11
+ class="psui-el-collapse-item-icon psui-icon"
12
+ :class="{'psui-rotate-90':isOpen}"
13
+ >chevron_right</i>
14
+ <slot
15
+ name="header"
16
+ :is-open="isOpen"
17
+ >
18
+ <div
19
+ class="psui-el-collapse-item-header-wrapper"
20
+
21
+ v-if="!hasCustomHeader"
22
+ >
23
+ <span
24
+ v-if="title"
25
+ :class="[
26
+ { 'disabled': disabled },
27
+ { 'psui-el-collapse-item-title': !disabled },
28
+ ]"
29
+ >
30
+ {{ title }}
31
+ </span>
32
+ <div class="psui-el-collapse-item-header-action">
33
+ <slot name="header-action" />
34
+ </div>
35
+ </div>
36
+ </slot>
37
+ </div>
38
+ <transition
39
+ name="collapse-fade"
40
+ @enter="start"
41
+ @after-enter="end"
42
+ @before-leave="start"
43
+ @after-leave="end"
44
+ >
45
+ <div
46
+ v-if="isOpen"
47
+ class="psui-el-collapse-item-content"
48
+ >
49
+ <slot name="content" />
50
+ </div>
51
+ </transition>
52
+ </div>
53
+ </template>
54
+
55
+ <script setup>
56
+ import { ref, computed } from 'vue'
57
+
58
+ const localOpened = ref(null)
59
+
60
+ const props = defineProps({
61
+ /**
62
+ * It sets the title of the accordion item.
63
+ */
64
+ title: {
65
+ type: String,
66
+ default: '',
67
+ },
68
+ /**
69
+ * It sets the status of the accordion item when mounted.
70
+ */
71
+ opened: {
72
+ type: [Boolean],
73
+ default: false,
74
+ },
75
+ /**
76
+ * It sets the text key to get the svg icon in Google Fonts. Make sure to get the correct description of your icon on https://fonts.google.com/.
77
+ */
78
+ icon: {
79
+ type: String,
80
+ default: '',
81
+ },
82
+ /**
83
+ * It sets if it has a custom header.
84
+ */
85
+ hasCustomHeader: {
86
+ type: Boolean,
87
+ default: false,
88
+ },
89
+ /**
90
+ * It sets the disabled status.
91
+ */
92
+ disabled: {
93
+ type: Boolean,
94
+ default: false,
95
+ },
96
+ })
97
+
98
+ const isOpen = computed(() => {
99
+ return localOpened.value !== null ? localOpened.value : props.opened
100
+ })
101
+
102
+ const toggle = () => {
103
+ if (localOpened.value === null) {
104
+ localOpened.value = !props.opened
105
+ } else {
106
+ localOpened.value = !localOpened.value
107
+ }
108
+ }
109
+ const start = (el) => {
110
+ el.style.height = el.scrollHeight + 'px'
111
+ el.style.padding = el.srcollPaddingBottom + 'px'
112
+ }
113
+ const end = (el) => {
114
+ el.style.height = ''
115
+ el.style.padding = ''
116
+ }
117
+ </script>
118
+
119
+ <style>
120
+ /* Please, use the file src/assets/scss/components/PsCollapse.scss */
121
+ </style>
122
+
123
+
124
+
@@ -1,100 +1,100 @@
1
1
  <template>
2
- <div
3
- class="psui-el-checkbox"
4
- :class="[getComponentClass, {'disabled':disabled}]"
2
+ <div
3
+ class="psui-el-checkbox"
4
+ :class="[getComponentClass, { disabled: disabled }]"
5
5
  >
6
- <input
7
- :id="getInputId"
8
- type="checkbox"
6
+ <input
7
+ :id="getInputId"
8
+ type="checkbox"
9
9
  :value="inputValue"
10
10
  v-model="model"
11
- :disabled="disabled"
11
+ :disabled="disabled"
12
12
  >
13
- <label
14
- :for="getInputId"
13
+ <label
14
+ :for="getInputId"
15
15
  class="psui-el-checkmark"
16
16
  :class="[labelClasses, 'psui-el-checkmark']"
17
17
  >
18
18
  <span>{{ label }}</span>
19
- </label>
19
+ </label>
20
20
  </div>
21
21
  </template>
22
22
 
23
- <script>
24
- //FIGMA CONTROLS & SELECTORS https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=1768%3A64852
25
- import { randomString } from '../../util/GeneralFunctions'
23
+ <script setup>
24
+ import { computed } from 'vue'
25
+ import { randomString } from '../../util/GeneralFunctions.js'
26
26
 
27
- export default {
28
- name: 'PsCheckbox',
29
- props: {
30
- /**
31
- * It sets the label of the checkbox input.
32
- */
33
- label: {
34
- type: String,
35
- default: '',
36
- },
37
- /**
38
- * It sets the label classes.
39
- */
40
- labelClasses: {
41
- type: String,
42
- default: ''
43
- },
44
- /**
45
- * It sets the value which should be monitored.
46
- */
47
- inputValue: {
48
- type: [String, Boolean],
49
- },
50
- value:{
51
- type: [Array, Boolean]
52
- },
53
- /**
54
- * It disables the checkbox input.
55
- */
56
- disabled: {
57
- type: Boolean,
58
- default: false,
59
- },
60
- /**
61
- * It set the of the checkbox input. eg: big and small.
62
- */
63
- size: {
64
- type: String,
65
- default: 'big',
66
- validator: (value)=> ['big', 'small'].includes(value)
67
- },
68
- /**
69
- * It set the layout of the checkbox input. eg: default and mixed.
70
- */
71
- layout:{
72
- type: String,
73
- default: 'default',
74
- validator: (value)=> ['default','mixed'].includes(value)
75
- }
27
+ const props = defineProps({
28
+ /**
29
+ * It sets the label of the checkbox input.
30
+ */
31
+ label: {
32
+ type: String,
33
+ default: '',
76
34
  },
77
- computed:{
78
- getComponentClass(){
79
- return `size-${this.size} layout-${this.layout}`
80
- },
81
- getInputId() {
82
- if (this?.inputAttrs?.id) {
83
- return this.inputAttrs.id
84
- } else if (this?.$attrs?.id) {
85
- return this.$attrs.id
86
- } else {
87
- return randomString(16)
88
- }
89
- },
90
- model: {
91
- get(){
92
- return this.value
93
- },
94
- set(value){
95
- this.$emit('input', value)
96
- }
97
- }
35
+ /**
36
+ * It sets the label classes.
37
+ */
38
+ labelClasses: {
39
+ type: String,
40
+ default: '',
98
41
  },
99
- }
42
+ /**
43
+ * It sets the value which should be monitored.
44
+ */
45
+ inputValue: {
46
+ type: [String, Boolean],
47
+ default: '',
48
+ },
49
+ value: {
50
+ type: [Array, Boolean],
51
+ default: false,
52
+ },
53
+ /**
54
+ * It disables the checkbox input.
55
+ */
56
+ disabled: {
57
+ type: Boolean,
58
+ default: false,
59
+ },
60
+ /**
61
+ * It set the of the checkbox input. eg: big and small.
62
+ */
63
+ size: {
64
+ type: String,
65
+ default: 'big',
66
+ validator: (value) => ['big', 'small'].includes(value),
67
+ },
68
+ /**
69
+ * It set the layout of the checkbox input. eg: default and mixed.
70
+ */
71
+ layout: {
72
+ type: String,
73
+ default: 'default',
74
+ validator: (value) => ['default', 'mixed'].includes(value),
75
+ },
76
+ })
77
+
78
+ const emit = defineEmits(['input'])
79
+
80
+ const getInputId = computed(() => {
81
+ if (props.inputAttrs?.id) {
82
+ return props.inputAttrs.id
83
+ } else if (props.$attrs?.id) {
84
+ return props.$attrs.id
85
+ } else {
86
+ return randomString(16)
87
+ }
88
+ })
89
+
90
+ const getComponentClass = computed(() => `size-${props.size} layout-${props.layout}`)
91
+
92
+ const model = computed({
93
+ get() {
94
+ return props.value
95
+ },
96
+ set(newValue) {
97
+ emit('input', newValue)
98
+ },
99
+ })
100
100
  </script>