@inriver/inri 1.28.0 → 1.30.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.
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@inriver/inri": minor
3
+ ---
4
+
5
+ Add correct class to the c-btn component
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@inriver/inri": patch
3
+ ---
4
+
5
+ Add support for showing tooltips when hovering over CSelect and options. Add disable support and styling. Fix required validation to work with empty arrays.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # @inriver/inri
2
2
 
3
+ ## 1.30.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Update documentation
8
+ - Add correct class to the c-btn component
9
+ - Wallop font is now included in the package
10
+ - Updating README and exporting tailwing config
11
+
12
+ ### Patch Changes
13
+
14
+ - Fix CSelect placeholder color. Modularize Sass imports. Include inri typings when bundling
15
+ - Fix Sass warnings and errors by removing usage of @apply and updating Quasar + sass dependencies
16
+ - Add support for showing tooltips when hovering over CSelect and options. Add disable support and styling. Fix required validation to work with empty arrays.
17
+ - Add support for hiding the sidebars in CLayoutWithSidebars. Add support for entering a custom title in CLayoutWithSidebars
18
+ - Add support for showing placeholder ()in CSelect eoutside of use-input mode
19
+ - Fix error when CSelect is passed object options with falsy values
20
+
21
+ ## 1.29.0
22
+
23
+ ### Minor Changes
24
+
25
+ - Update documentation
26
+ - Wallop font is now included in the package
27
+ - Updating README and exporting tailwing config
28
+
29
+ ### Patch Changes
30
+
31
+ - Fix CSelect placeholder color. Modularize Sass imports. Include inri typings when bundling
32
+ - Fix Sass warnings and errors by removing usage of @apply and updating Quasar + sass dependencies
33
+ - Add support for showing tooltips when hovering over CSelect and options. Add disable support and styling. Fix required validation to work with empty arrays.
34
+ - Add support for hiding the sidebars in CLayoutWithSidebars. Add support for entering a custom title in CLayoutWithSidebars
35
+ - Add support for showing placeholder ()in CSelect eoutside of use-input mode
36
+ - Fix error when CSelect is passed object options with falsy values
37
+
3
38
  ## 1.28.0
4
39
 
5
40
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inriver/inri",
3
- "version": "1.28.0",
3
+ "version": "1.30.0",
4
4
  "main": "index.ts",
5
5
  "types": "main.d.ts",
6
6
  "peerDependencies": {
@@ -5,6 +5,7 @@
5
5
  :model-value="modelValue"
6
6
  v-bind="dense ? $inri.inputDense : $inri.input"
7
7
  :options="internalOptions"
8
+ :disable="disable"
8
9
  :multiple="multiple"
9
10
  :use-input="dense || useInput"
10
11
  :placeholder="selectedPlaceholder"
@@ -18,14 +19,24 @@
18
19
  @update:model-value="onModelUpdate"
19
20
  >
20
21
  <template
21
- v-if="!useInput && (modelValue === undefined || modelValue === null)"
22
+ v-if="!useInput && (modelValue === undefined || modelValue === null || (Array.isArray(modelValue) && !modelValue.length))"
22
23
  #selected
23
24
  >
24
- <slot name="placeholder">
25
- <div class="text-grey">
26
- {{ selectedPlaceholder }}
27
- </div>
28
- </slot>
25
+ <div
26
+ class="text-grey"
27
+ :class="{
28
+ 'w-full': placeholderFullWidth,
29
+ 'pointer-events-auto cursor-not-allowed': disable
30
+ }"
31
+ >
32
+ {{ selectedPlaceholder }}
33
+ <c-tooltip
34
+ v-if="placeholderTooltip"
35
+ :offset="[24, 24]"
36
+ >
37
+ {{ placeholderTooltip }}
38
+ </c-tooltip>
39
+ </div>
29
40
  </template>
30
41
 
31
42
  <template #no-option>
@@ -60,6 +71,7 @@
60
71
  <q-item
61
72
  v-if="multiple"
62
73
  v-bind="itemProps"
74
+ :class="!itemProps.disable || 'pointer-events-auto cursor-not-allowed'"
63
75
  >
64
76
  <q-item-section>
65
77
  <q-checkbox
@@ -70,16 +82,25 @@
70
82
  @click="toggleOption(opt)"
71
83
  />
72
84
  </q-item-section>
85
+
86
+ <c-tooltip v-if="opt?.tooltip">
87
+ {{ opt.tooltip }}
88
+ </c-tooltip>
73
89
  </q-item>
74
90
 
75
91
  <!-- single -->
76
92
  <q-item
77
93
  v-else
78
94
  v-bind="itemProps"
95
+ :class="!itemProps.disable || 'pointer-events-auto cursor-not-allowed'"
79
96
  >
80
97
  <q-item-section>
81
98
  {{ getOptionLabel(opt) }}
82
99
  </q-item-section>
100
+
101
+ <c-tooltip v-if="opt?.tooltip">
102
+ {{ opt.tooltip }}
103
+ </c-tooltip>
83
104
  </q-item>
84
105
  </template>
85
106
  </q-select>
@@ -106,6 +127,7 @@ const props = defineProps({
106
127
  type: Array,
107
128
  default: () => [],
108
129
  },
130
+ disable: Boolean,
109
131
  multiple: Boolean,
110
132
  dense: Boolean,
111
133
  useInput: Boolean,
@@ -122,6 +144,11 @@ const props = defineProps({
122
144
  type: String,
123
145
  default: undefined,
124
146
  },
147
+ placeholderFullWidth: Boolean,
148
+ placeholderTooltip: {
149
+ type: String,
150
+ default: undefined,
151
+ },
125
152
  })
126
153
 
127
154
  // State etc.
@@ -28,7 +28,7 @@ export const radio = {
28
28
  } as const
29
29
 
30
30
  export const button = {
31
- class: 'c-btn',
31
+ class: 'c-inri-btn',
32
32
  rounded: true,
33
33
  unelevated: true,
34
34
  noCaps: true,
@@ -8,7 +8,7 @@ const $t = i18n.global.t
8
8
  */
9
9
  export function required (msg?: string) {
10
10
  return (value): true | string => {
11
- return !!value || msg || $t('inri.validation.required')
11
+ return (Array.isArray(value) ? value.length > 0 : !!value) || msg || $t('inri.validation.required')
12
12
  }
13
13
  }
14
14