comand-component-library 3.1.70 → 3.1.71

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.
@@ -144,19 +144,19 @@
144
144
 
145
145
  <!-- begin searchfield -->
146
146
  <template v-else-if="element === 'input' && $attrs.type === 'search'">
147
- <div class="search-field-wrapper flex-container no-gap">
147
+ <span class="search-field-wrapper flex-container no-gap">
148
148
  <input
149
149
  v-bind="elementAttributes"
150
150
  :id="labelId"
151
151
  @input="onInput"
152
- :maxlength="$attrs.maxlength > 0 ? $attrs.maxlength : 255"
152
+ :maxlength="getMaxLength()"
153
153
  :value="modelValue"
154
154
  />
155
155
  <a v-if="showSearchButton" href="#" class="button no-flex" :title="iconSearch.tooltip" @click.prevent="executeSearch">
156
156
  <span :class="iconSearch.iconClass"></span>
157
157
  </a>
158
158
  <a v-if="iconDelete.show" href="#" @click.prevent="$emit('update:modelValue', '')" :class="iconDelete.iconClass" :title="iconDelete.tooltip"></a>
159
- </div>
159
+ </span>
160
160
  </template>
161
161
  </label>
162
162
  <!-- end searchfield -->
@@ -218,7 +218,7 @@ import {createUuid} from "../utils/common.js"
218
218
 
219
219
  // import mixins
220
220
  import I18n from "../mixins/I18n"
221
- import DefaultMessageProperties from "../mixins/CmdBox/DefaultMessageProperties"
221
+ import DefaultMessageProperties from "../mixins/CmdFormElement/DefaultMessageProperties"
222
222
  import FieldValidation from "../mixins/FieldValidation.js"
223
223
  import Tooltip from "../mixins/Tooltip.js"
224
224
 
@@ -548,14 +548,33 @@ export default {
548
548
  }
549
549
  }
550
550
  },
551
- toggleSwitchUncheckedIconClass: {
552
- type: String,
553
- default: "icon-cancel-circle"
551
+ /**
552
+ * toggle if toggle-switch shows icons for checked/unchecked-status
553
+ */
554
+ useIconsForToggleSwitch: {
555
+ type: Boolean,
556
+ default: false
554
557
  },
558
+ /**
559
+ * icon for toggle-switch checked
560
+ *
561
+ * toggle-switch-property must be activated
562
+ * use-icons-for-toggle-switch-property must be activated
563
+ */
555
564
  toggleSwitchCheckedIconClass: {
556
565
  type: String,
557
566
  default: "icon-check-circle"
558
567
  },
568
+ /**
569
+ * icon for toggle-switch unchecked
570
+ *
571
+ * toggle-switch-property must be activated
572
+ * use-icons-for-toggle-switch-property must be activated
573
+ */
574
+ toggleSwitchUncheckedIconClass: {
575
+ type: String,
576
+ default: "icon-cancel-circle"
577
+ },
559
578
  /**
560
579
  * icon to toggle password-visibility
561
580
  *
@@ -622,8 +641,6 @@ export default {
622
641
  }
623
642
  },
624
643
  isChecked() {
625
- console.log("this.modelValue", this.modelValue)
626
- console.log("typeof this.modelValue", typeof this.modelValue)
627
644
  if (typeof this.modelValue === "boolean") {
628
645
  return this.modelValue
629
646
  }
@@ -669,8 +686,9 @@ export default {
669
686
  }
670
687
  return "label-" + createUuid()
671
688
  },
689
+ // toggle icons for toggle-switch
672
690
  toggleSwitchIconClass() {
673
- if(this.toggleSwitch && this.toggleSwitchUncheckedIconClass && this.toggleSwitchCheckedIconClass) {
691
+ if(this.toggleSwitch && this.useIconsForToggleSwitch && this.toggleSwitchUncheckedIconClass && this.toggleSwitchCheckedIconClass) {
674
692
  if(this.isChecked) {
675
693
  return this.toggleSwitchCheckedIconClass
676
694
  }
@@ -683,15 +701,15 @@ export default {
683
701
  getDomElement() {
684
702
  return this.$refs.label
685
703
  },
704
+ // define max-length for different input-types
686
705
  getMaxLength() {
687
706
  if (this.$attrs.element === 'textarea') {
688
707
  return this.$attrs.maxlength > 0 ? this.$attrs.maxlength : 5000
689
708
  }
690
709
 
691
- if (this.$attrs.type !== 'file') {
710
+ if (this.$attrs.type !== 'file' && this.$attrs.type !== 'number' && this.$attrs.type !== 'date') {
692
711
  return this.$attrs.maxlength > 0 ? this.$attrs.maxlength : 255
693
712
  }
694
-
695
713
  return null
696
714
  },
697
715
  onBlur(event) {
@@ -782,35 +800,14 @@ export default {
782
800
  </script>
783
801
 
784
802
  <style lang="scss">
803
+ /* begin cmd-form-element ------------------------------------------------------------------------------------------ */
785
804
  .cmd-form-element {
786
-
787
-
788
-
789
-
790
-
791
-
792
805
  input + .place-inside[class*="icon"] {
793
806
  left: auto;
794
807
  right: .5rem
795
808
  }
796
809
 
797
810
  &.has-state, & + .cmd-tooltip {
798
- &.error {
799
- --status-color: var(--error-color);
800
- }
801
-
802
- &.warning {
803
- --status-color: var(--warning-color);
804
- }
805
-
806
- &.success {
807
- --status-color: var(--success-color);
808
- }
809
-
810
- &.info {
811
- --status-color: var(--info-color);
812
- }
813
-
814
811
  ::placeholder {
815
812
  color: var(--status-color);
816
813
  }
@@ -824,13 +821,9 @@ export default {
824
821
  }
825
822
  }
826
823
 
827
- & + .cmd-tooltip {
828
- border-color: var(--status-color);
829
- }
830
-
831
824
  &.inline {
832
825
  & > span {
833
- & > a {
826
+ & > a:not(.button) {
834
827
  margin-left: calc(var(--default-margin) / 2);
835
828
  }
836
829
  }
@@ -856,7 +849,6 @@ export default {
856
849
 
857
850
  .place-inside {
858
851
  + .search-field-wrapper {
859
-
860
852
  input {
861
853
  padding-left: calc(var(--default-padding) * 3);
862
854
  }
@@ -902,6 +894,7 @@ export default {
902
894
  }
903
895
  }
904
896
  }
905
- /* end toggle-switch ------------------------------------------------------------------------------------------ */
897
+ /* end toggle-switch */
906
898
  }
899
+ /* end cmd-form-element------------------------------------------------------------------------------------------ */
907
900
  </style>
@@ -1,6 +1,8 @@
1
1
  <template>
2
- <div :class="['cmd-input-group', {inline: labelInline, 'multiple-switch': multipleSwitch}]">
3
- <span :class="['label', { hidden: !showLabel}]" :id="labelId" :aria-labelledby="labelId">{{ labelText }}</span>
2
+ <div :class="['cmd-input-group label', {inline: labelInline, 'multiple-switch': multipleSwitch}]">
3
+ <span :class="['label-text', { hidden: !showLabel}]" :id="labelId" :aria-labelledby="labelId">
4
+ <span>{{ labelText }}<sup v-if="$attrs.required">*</sup></span>
5
+ </span>
4
6
  <span v-if="!useSlot" :class="['flex-container', {'no-flex': !stretchHorizontally, 'no-gap': multipleSwitch}]">
5
7
  <label v-for="(inputElement, index) in inputElements" :key="index" :for="inputElement.id">
6
8
  <input :type="inputTypes"
@@ -8,6 +10,7 @@
8
10
  :name="inputElement.name"
9
11
  :value="inputElement.value"
10
12
  v-model="inputValue"
13
+ :class="{'replace-input-type': replaceInputType}"
11
14
  />
12
15
  <span v-if="multipleSwitch && inputElement.iconClass" :class="inputElement.iconClass"></span>
13
16
  <span v-if="inputElement.labelText">{{ inputElement.labelText }}</span>
@@ -58,6 +61,15 @@ export default {
58
61
  type: String,
59
62
  default: "radio"
60
63
  },
64
+ /**
65
+ * for replacing native checkboxes/radio-buttons by custom ones (based on frontend-framework)
66
+ *
67
+ * @affectsStyling: true
68
+ */
69
+ replaceInputType: {
70
+ type: Boolean,
71
+ default: false
72
+ },
61
73
  /**
62
74
  * activate if input-elements should be given by slot
63
75
  */
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <label class="cmd-progressbar" :for="id">
3
- <span :class="{hidden: !showLabel}">{{ labelText }}</span>
3
+ <span :class="['label-text', {hidden: !showLabel}]">{{ labelText }}</span>
4
4
  <span class="progressbar">
5
- <span v-if="showLoadingStatus">{{ loadingStatus }}%</span><!-- do not place inside progress-tag (will not be displayed then) -->
5
+ <span v-if="showLoadingStatus">{{ loadingStatus }} %</span><!-- do not place inside progress-tag (will not be displayed then) -->
6
6
  <progress v-bind="$attrs" :id="id" :value="loadingStatus"></progress>
7
7
  </span>
8
8
  </label>
@@ -133,7 +133,7 @@ export default {
133
133
  type: Object,
134
134
  default: function () {
135
135
  return {
136
- iconClass: "icon-table",
136
+ iconClass: "icon-toggle-table-width",
137
137
  tooltip: "Toggle table width"
138
138
  }
139
139
  }
package/src/index.js CHANGED
@@ -20,10 +20,10 @@ export { default as CmdFormFilters } from '@/components/CmdFormFilters'
20
20
  export { default as CmdGoogleMaps } from '@/components/CmdGoogleMaps'
21
21
  export { default as CmdImageGallery } from '@/components/CmdImageGallery'
22
22
  export { default as CmdImageZoom } from '@/components/CmdImageZoom'
23
+ export { default as CmdInputGroup } from '@/components/CmdInputGroup'
23
24
  export { default as CmdListOfLinks } from '@/components/CmdListOfLinks'
24
25
  export { default as CmdLoginForm } from '@/components/CmdLoginForm'
25
26
  export { default as CmdMainNavigation } from '@/components/CmdMainNavigation'
26
- export { default as CmdMultipleSwitch } from '@/components/CmdMultipleSwitch'
27
27
  export { default as CmdMultistepFormProgressBar } from '@/components/CmdMultistepFormProgressBar'
28
28
  export { default as CmdOpeningHours } from '@/components/CmdOpeningHours'
29
29
  export { default as CmdPager } from '@/components/CmdPager'
@@ -2,7 +2,7 @@ export default {
2
2
  data() {
3
3
  return {
4
4
  defaultMessageProperties: {
5
- "cmdformelement.headline.requirement_for_input": "Requirement for input",
5
+ "cmdformelement.headline.requirements_for_input": "Requirements for input",
6
6
  "cmdformelement.validationTooltip.an_error_occurred": "An error occurred!",
7
7
  "cmdformelement.validationTooltip.information_is_filled_correctly": "This information is filled correctly!",
8
8
  "cmdformelement.validationTooltip.caps_lock_is_activated": "Attention: Caps lock is activated!",
@@ -116,7 +116,7 @@ export default {
116
116
  type: Object,
117
117
  default() {
118
118
  return {
119
- iconClass: "icon-caps-lock"
119
+ iconClass: "icon-caps-lock-circle"
120
120
  }
121
121
  }
122
122
  },
@@ -1,9 +1,8 @@
1
1
  export default {
2
2
  data() {
3
3
  return {
4
- defaultMessageProperties: {
4
+ fieldValidationDefaultMessageProperties: {
5
5
  "cmdfieldvalidation.open_detailed_help": "Open detailed help!",
6
-
7
6
  "cmdfieldvalidation.information_not_filled_correctly": "This information is not filled correctly!",
8
7
  "cmdfieldvalidation.information_filled_correctly": "This information is filled correctly!",
9
8
  "cmdfieldvalidation.caps_lock_is_activated": "Attention: Caps lock is activated!",
@@ -42,15 +42,25 @@ export default {
42
42
  }
43
43
  let message =
44
44
  messages[key] ||
45
- (this.defaultMessageProperties && this.defaultMessageProperties[key]) ||
45
+ this.getDefaultMessageProperty(key) ||
46
46
  key
47
47
  if (typeof message === "function") {
48
- return message.call(this, params || [])
48
+ return message.call(this, params || []);
49
49
  }
50
50
  if (Array.isArray(params) && params.length) {
51
51
  params.forEach((param, index) => (message = message.replace("{" + index + "}", param)))
52
52
  }
53
53
  return message
54
+ },
55
+ getDefaultMessageProperty(key) {
56
+ if (this.defaultMessageProperties && this.defaultMessageProperties[key]) {
57
+ return this.defaultMessageProperties[key]
58
+ }
59
+ const propertyKey = Object.keys(this).find(p => p.slice(-24) === "DefaultMessageProperties")
60
+ if (propertyKey && this[propertyKey]?.[key]) {
61
+ return this[propertyKey][key]
62
+ }
63
+ return null
54
64
  }
55
65
  }
56
66
  }