@citruslime/ui 2.0.0-beta.2 → 2.0.0-beta.20

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 (137) hide show
  1. package/README.md +5 -4
  2. package/dist/citrus-lime-ui.es.js +4446 -0
  3. package/dist/citrus-lime-ui.umd.js +2 -0
  4. package/dist/components/accordion/cl-ui-accordion.vue.d.ts +26 -0
  5. package/dist/components/accordion/index.d.ts +4 -0
  6. package/dist/components/accordion/item/cl-ui-accordion-item.vue.d.ts +35 -0
  7. package/dist/{@types/components/accordion/item.d.ts → components/accordion/types.d.ts} +0 -0
  8. package/dist/components/app/cl-ui-app.vue.d.ts +51 -0
  9. package/dist/components/app/index.d.ts +1 -0
  10. package/dist/components/button/cl-ui-button.vue.d.ts +51 -0
  11. package/dist/components/button/index.d.ts +2 -0
  12. package/dist/components/button/types.d.ts +4 -0
  13. package/dist/components/calendar/cl-ui-calendar.vue.d.ts +2 -0
  14. package/dist/components/calendar/index.d.ts +2 -0
  15. package/dist/components/calendar/types.d.ts +2 -0
  16. package/dist/components/calendar/utils.d.ts +38 -0
  17. package/dist/components/card/cl-ui-card.vue.d.ts +27 -0
  18. package/dist/components/card/index.d.ts +2 -0
  19. package/dist/components/card/types.d.ts +2 -0
  20. package/dist/components/combo-box/cl-ui-combo-box.vue.d.ts +583 -0
  21. package/dist/components/combo-box/index.d.ts +2 -0
  22. package/dist/components/combo-box/search-container/cl-ui-combo-box-search.vue.d.ts +276 -0
  23. package/dist/components/combo-box/search-container/header/cl-ui-combo-box-header.vue.d.ts +42 -0
  24. package/dist/components/combo-box/search-container/selectable/cl-ui-combo-box-selectable.vue.d.ts +81 -0
  25. package/dist/{@types/components/combo-box/item.d.ts → components/combo-box/types.d.ts} +0 -0
  26. package/dist/components/footer/index.d.ts +1 -0
  27. package/dist/components/grid/cell/cl-ui-grid-cell.vue.d.ts +72 -0
  28. package/dist/components/grid/cl-ui-grid.vue.d.ts +550 -0
  29. package/dist/components/grid/filter/cl-ui-grid-filter.vue.d.ts +72 -0
  30. package/dist/components/grid/filter/filter-methods.d.ts +5 -0
  31. package/dist/components/grid/footer/cl-ui-grid-footer.vue.d.ts +63 -0
  32. package/dist/components/grid/header/cl-ui-grid-header.vue.d.ts +207 -0
  33. package/dist/components/grid/index.d.ts +2 -0
  34. package/dist/components/grid/types.d.ts +92 -0
  35. package/dist/components/grid/view-manager/cl-ui-grid-view-manager.vue.d.ts +88 -0
  36. package/dist/components/header/index.d.ts +2 -0
  37. package/dist/components/header/menu/cl-ui-header-menu.vue.d.ts +40 -0
  38. package/dist/components/header/menu/index.d.ts +1 -0
  39. package/dist/components/index.d.ts +15 -17
  40. package/dist/components/input/cl-ui-input.vue.d.ts +2 -0
  41. package/dist/components/input/index.d.ts +2 -0
  42. package/dist/components/input/types.d.ts +6 -0
  43. package/dist/components/input/utils.d.ts +44 -0
  44. package/dist/components/language-switcher/cl-ui-language-switcher.vue.d.ts +37 -0
  45. package/dist/components/language-switcher/index.d.ts +2 -0
  46. package/dist/{@types/language.d.ts → components/language-switcher/types.d.ts} +0 -1
  47. package/dist/components/loading-spinner/index.d.ts +1 -0
  48. package/dist/components/login/cl-ui-login.vue.d.ts +106 -0
  49. package/dist/components/login/index.d.ts +2 -0
  50. package/dist/{@types/components/login/authentication.d.ts → components/login/types.d.ts} +0 -0
  51. package/dist/components/modal/cl-ui-modal.vue.d.ts +49 -0
  52. package/dist/components/modal/index.d.ts +2 -0
  53. package/dist/components/modal/types.d.ts +4 -0
  54. package/dist/components/navigation/cl-ui-navigation.vue.d.ts +11 -0
  55. package/dist/components/navigation/group/cl-ui-navigation-group.vue.d.ts +12 -0
  56. package/dist/components/navigation/icon/cl-ui-navigation-icon.vue.d.ts +20 -0
  57. package/dist/components/navigation/index.d.ts +5 -0
  58. package/dist/components/notification/cl-ui-notification.vue.d.ts +36 -0
  59. package/dist/components/notification/index.d.ts +1 -0
  60. package/dist/components/notification/types.d.ts +9 -0
  61. package/dist/components/slider/cl-ui-slider.vue.d.ts +114 -0
  62. package/dist/components/slider/index.d.ts +1 -0
  63. package/dist/composables/notification.d.ts +1 -1
  64. package/dist/main.d.ts +2 -4
  65. package/dist/style.css +1 -1
  66. package/dist/utils/i18n/config.d.ts +33 -0
  67. package/dist/utils/i18n/defaults.d.ts +4 -0
  68. package/dist/utils/i18n/index.d.ts +3 -0
  69. package/dist/utils/i18n/types.d.ts +97 -0
  70. package/dist/utils/index.d.ts +2 -6
  71. package/dist/utils/validation.d.ts +37 -0
  72. package/package.json +27 -14
  73. package/dist/.eslintrc.js +0 -453
  74. package/dist/.stylelintrc.js +0 -119
  75. package/dist/@types/appUser.d.ts +0 -11
  76. package/dist/@types/components/accordion/index.d.ts +0 -1
  77. package/dist/@types/components/combo-box/index.d.ts +0 -2
  78. package/dist/@types/components/combo-box/localisations.d.ts +0 -19
  79. package/dist/@types/components/grid/column.d.ts +0 -46
  80. package/dist/@types/components/grid/index.d.ts +0 -4
  81. package/dist/@types/components/grid/localisations.d.ts +0 -47
  82. package/dist/@types/components/grid/request.d.ts +0 -49
  83. package/dist/@types/components/grid/update.d.ts +0 -4
  84. package/dist/@types/components/header/index.d.ts +0 -1
  85. package/dist/@types/components/header/localisations.d.ts +0 -8
  86. package/dist/@types/components/login/index.d.ts +0 -2
  87. package/dist/@types/components/login/localisations.d.ts +0 -7
  88. package/dist/@types/components/navigation/index.d.ts +0 -18
  89. package/dist/@types/components/notification/index.d.ts +0 -1
  90. package/dist/@types/components/notification/item.d.ts +0 -7
  91. package/dist/@types/components/slider/index.d.ts +0 -1
  92. package/dist/@types/components/slider/localisations.d.ts +0 -3
  93. package/dist/@types/date-format.d.ts +0 -8
  94. package/dist/@types/debouncer.d.ts +0 -6
  95. package/dist/@types/index.d.ts +0 -16
  96. package/dist/@types/locale.d.ts +0 -10
  97. package/dist/@types/number-format.d.ts +0 -7
  98. package/dist/@types/string-format.d.ts +0 -3
  99. package/dist/@types/string.d.ts +0 -47
  100. package/dist/theme.js +0 -120
  101. package/dist/ui.es.js +0 -1
  102. package/dist/ui.umd.js +0 -1
  103. package/dist/utils/copy.d.ts +0 -8
  104. package/dist/utils/debouncer.d.ts +0 -8
  105. package/dist/utils/extensions/string-utilities.d.ts +0 -83
  106. package/dist/utils/extensions/string.d.ts +0 -1
  107. package/dist/utils/i18n/datetime-formats.d.ts +0 -3
  108. package/dist/utils/i18n/number-formats.d.ts +0 -3
  109. package/dist/utils/id.d.ts +0 -6
  110. package/dist/utils/name-of.d.ts +0 -7
  111. package/dist/utils/sort.d.ts +0 -9
  112. package/dist/utils/url-params.d.ts +0 -8
  113. package/src/components/accordion/cl-ui-accordion.vue +0 -89
  114. package/src/components/app/cl-ui-app.vue +0 -26
  115. package/src/components/button/cl-ui-button.vue +0 -48
  116. package/src/components/calendar/cl-ui-calendar.vue +0 -277
  117. package/src/components/card/cl-ui-card.vue +0 -70
  118. package/src/components/combo-box/cl-ui-combo-box.vue +0 -357
  119. package/src/components/combo-box/search-container/cl-ui-combo-box-search.vue +0 -279
  120. package/src/components/combo-box/search-container/header/cl-ui-combo-box-header.vue +0 -36
  121. package/src/components/combo-box/search-container/selectable/cl-ui-combo-box-selectable.vue +0 -99
  122. package/src/components/footer/cl-ui-footer.vue +0 -31
  123. package/src/components/grid/cell/cl-ui-grid-cell.vue +0 -153
  124. package/src/components/grid/cl-ui-grid.vue +0 -477
  125. package/src/components/grid/filter/cl-ui-grid-filter.vue +0 -270
  126. package/src/components/grid/footer/cl-ui-grid-footer.vue +0 -186
  127. package/src/components/grid/header/cl-ui-grid-header.vue +0 -76
  128. package/src/components/grid/view-manager/cl-ui-grid-view-manager.vue +0 -145
  129. package/src/components/header/cl-ui-header.vue +0 -11
  130. package/src/components/header-helper/cl-ui-header-helper.vue +0 -50
  131. package/src/components/language-switcher/cl-ui-language-switcher.vue +0 -82
  132. package/src/components/loading-spinner/cl-ui-loading-spinner.vue +0 -16
  133. package/src/components/login/cl-ui-login.vue +0 -183
  134. package/src/components/modal/cl-ui-modal.vue +0 -120
  135. package/src/components/navigation/cl-ui-navigation.vue +0 -124
  136. package/src/components/notification/cl-ui-notification.vue +0 -55
  137. package/src/components/slider/cl-ui-slider.vue +0 -145
@@ -1,50 +0,0 @@
1
- <script setup lang="ts">
2
- import { ref } from 'vue';
3
-
4
- import { AppUser } from '../../@types';
5
-
6
- withDefaults(defineProps<{
7
- user?: AppUser | null;
8
- }>(), {
9
- user: () => null
10
- });
11
-
12
- const isOpen = ref<boolean>(false);
13
- </script>
14
-
15
- <template>
16
- <div class="md:relative">
17
- <div class="bg-blue-light flex items-center md:min-w-[320px] select-none">
18
- <template v-if="user">
19
- <img v-if="user.userImage"
20
- :src="user.userImage"
21
- class="hidden m-4 max-h-12 max-w-12 md:block ring-2 ring-white rounded-full">
22
-
23
- <div v-if="user.userName || (user.userGroup && user.userGroup.groupName)"
24
- class="cursor-default flex-grow hidden md:block my-4 text-white">
25
- <div v-if="user.userName"
26
- class="cursor-default overflow-ellipsis whitespace-nowrap">
27
- {{ user.userName }}
28
- </div>
29
-
30
- <div v-if="user.userGroup && user.userGroup.groupName"
31
- class="cursor-default overflow-ellipsis text-xs whitespace-nowrap">
32
- {{ user.userGroup.groupName }}
33
- </div>
34
- </div>
35
-
36
- <div class="bg-transparent content-center cursor-pointer flex h-20 hover:bg-opacity-10 hover:bg-white items-center justify-center justify-items-center md:ml-4 md:w-20 transition-colors w-10"
37
- @click="isOpen = !isOpen">
38
- <icon class="text-white transform transition-transform"
39
- :class="{ 'rotate-180' : isOpen }"
40
- icon="ph:caret-down" />
41
- </div>
42
- </template>
43
- </div>
44
-
45
- <div v-if="isOpen"
46
- class="absolute bg-white right-0 shadow-2xl top-20 w-full z-20">
47
- <slot name="content"></slot>
48
- </div>
49
- </div>
50
- </template>
@@ -1,82 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, ref, watch } from 'vue';
3
-
4
- import { isLanguageLocaleFormat, Language } from '../../@types';
5
-
6
- const props = withDefaults(defineProps<{
7
- currentLocale: string;
8
- supportedLocales: Language[];
9
- disabled?: boolean;
10
- }>(), {
11
- disabled: false
12
- });
13
-
14
- defineEmits({
15
- 'update:current-locale': null
16
- });
17
-
18
- const localeToggleOpen = ref<boolean>(false);
19
-
20
- const selectedLanguage = computed<Language | null>(() => props.supportedLocales.find(loc => loc.localeCode === props.currentLocale) ?? null);
21
-
22
- const validLanguages = computed<Language[]>(() => props.supportedLocales.filter(e => isLanguageLocaleFormat(e)).sort((a,b) => (a.nativeName > b.nativeName) ? 1 : ((b.nativeName > a.nativeName) ? -1 : 0)));
23
-
24
- /**
25
- * Toggles whether the locale dropdown is shown or hidden.
26
- */
27
- function toggleLocaleSwitcher (): void {
28
- if (!props.disabled) {
29
- localeToggleOpen.value = !localeToggleOpen.value;
30
- }
31
- }
32
-
33
- watch(() => props.disabled, (newValue) => {
34
- if (newValue) {
35
- localeToggleOpen.value = false;
36
- }
37
- });
38
- </script>
39
-
40
- <style scoped lang="postcss">
41
- .flag-svg,
42
- .flag-svg[data-size='small'] {
43
- background-position: center center !important;
44
- background-repeat: no-repeat !important;
45
- background-size: cover !important;
46
- height: 12px;
47
- width: 16px;
48
- }
49
- </style>
50
-
51
- <template>
52
- <div v-if="selectedLanguage !== null && isLanguageLocaleFormat(selectedLanguage)"
53
- class="flex relative select-none w-auto z-30">
54
- <div class="flex items-center"
55
- :class="{ 'cursor-pointer': !disabled }"
56
- @click="toggleLocaleSwitcher">
57
- <span class="flag-svg inline-block mr-3"
58
- :style="{ 'background': `url('${selectedLanguage.svgCode}')` }"></span>
59
-
60
- <span class="font-semibold hidden lg:inline-block mr-4 text-white text-xs">
61
- {{ selectedLanguage.nativeName }}
62
- </span>
63
- </div>
64
-
65
- <div v-show="localeToggleOpen"
66
- class="absolute bg-white overflow-hidden right-0 rounded shadow-xl top-6 z-30">
67
- <div v-for="(location, index) in validLanguages"
68
- :key="index"
69
- class="border-b border-grey-0 content-center cursor-pointer flex hover:bg-grey-0 items-center last-child:border-b-0 last:border-b-0 p-2 text-center transition-colors"
70
- :data-localename="location.name"
71
- :data-localecode="location.localeCode"
72
- @click="$emit('update:current-locale', location.localeCode)">
73
- <span class="flag-svg inline-block mr-3"
74
- :style="{ 'background': `url('${location.svgCode}')` }"></span>
75
-
76
- <span class="hidden lg:inline-flex ml-2 text-xs">
77
- {{ location.nativeName }}
78
- </span>
79
- </div>
80
- </div>
81
- </div>
82
- </template>
@@ -1,16 +0,0 @@
1
- <style scoped lang="postcss">
2
- .loading-spinner {
3
- @apply h-8 w-8;
4
- }
5
-
6
- .loading-spinner:after {
7
- @apply absolute animate-spin border-2 border-primary-default rounded-full h-8 w-8;
8
-
9
- border-bottom: 2px solid transparent;
10
- content: '';
11
- }
12
- </style>
13
-
14
- <template>
15
- <div class="loading-spinner"></div>
16
- </template>
@@ -1,183 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, ref, watch } from 'vue';
3
-
4
- import { Authentication, Language, LoginLocalisations } from '../../@types';
5
- import ClUiLanguageSwitcher from '../language-switcher/cl-ui-language-switcher.vue';
6
-
7
- type PasswordFieldType = 'text' | 'password';
8
-
9
- const props = withDefaults(defineProps<{
10
- errors?: string[];
11
- currentLocale?: string;
12
- supportedLocales: Language[];
13
- localisations?: LoginLocalisations;
14
- logo: string;
15
- backgroundImage: string;
16
- loading?: false;
17
- }>(), {
18
- errors: () => [],
19
- currentLocale: 'en-GB',
20
- localisations: () => ({
21
- login: 'Login',
22
- email: 'Email Address',
23
- password: 'Password',
24
- validEmail: 'Username is a valid email address.',
25
- invalidEmail: 'Username must be a valid email address.'
26
- }),
27
- loading: false
28
- });
29
-
30
- const emit = defineEmits({
31
- login: null,
32
- 'update:errors': null,
33
- 'update:current-locale': null
34
- });
35
-
36
- const username = ref('');
37
- const password = ref('');
38
-
39
- const passwordFieldType = ref<PasswordFieldType>('password');
40
- const usernameValid = ref<boolean>(false);
41
-
42
- const selectedLocale = computed<string>({
43
- get: () => props.currentLocale,
44
- set: (value) => emit('update:current-locale', value)
45
- });
46
-
47
- /**
48
- * Emits the current username and password values.
49
- */
50
- function login (): void {
51
- emit('login', {
52
- username: username.value,
53
- password: password.value
54
- } as Authentication);
55
- }
56
-
57
- /**
58
- * Emits an event to clear the currently displayed error.
59
- */
60
- function clearErrors (): void {
61
- emit('update:errors', []);
62
- }
63
-
64
- watch(username, () => {
65
- const emailRegex = /[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)/gi;
66
-
67
- usernameValid.value = emailRegex.test(username.value);
68
- });
69
- </script>
70
-
71
- <style scoped lang="postcss">
72
- *[data-valid='true'] {
73
- @apply border-2 border-primary-default;
74
- }
75
-
76
- *[data-valid='false'] {
77
- @apply border-2 border-danger-default;
78
- }
79
- </style>
80
-
81
- <template>
82
- <div class="bg-cover bg-left-bottom h-screen"
83
- :style="{ 'background-image': `url('${backgroundImage}')` }">
84
- <form class="bg-secondary-default flex flex-wrap opacity-95 p-10 pb-12 w-full">
85
- <div class="md:flex-1 md:pb-0 pb-8 w-full">
86
- <img :src="logo">
87
- </div>
88
-
89
- <div class="content-center flex items-center md:pb-0 md:pr-2 md:w-auto pb-2 w-auto">
90
- <cl-ui-language-switcher v-model:current-locale="selectedLocale"
91
- :supported-locales="supportedLocales" />
92
- </div>
93
-
94
- <div class="md:pb-0 md:pr-2 md:w-1/4 pb-2 w-full">
95
- <div class="inline relative text-grey-4 w-full">
96
- <icon class="absolute left-3 top-0.5"
97
- icon="ph:user"
98
- :size="18" />
99
-
100
- <input v-model.trim="username"
101
- class="!pb-1 !pl-9 w-full"
102
- type="email"
103
- :data-valid="usernameValid"
104
- :placeholder="localisations.email"
105
- autocomplete="username"
106
- @input="clearErrors">
107
- </div>
108
-
109
- <div v-show="username !== ''"
110
- class="text-grey-3 text-sm">
111
- <div v-show="usernameValid"
112
- class="flex mt-2">
113
- <icon class="text-primary-default"
114
- icon="ph:check"
115
- :size="16" />
116
-
117
- <em class="align-middle inline-block ml-4">
118
- {{ localisations.validEmail }}
119
- </em>
120
- </div>
121
-
122
- <div v-show="!usernameValid"
123
- class="flex mt-2">
124
- <icon class="text-danger-default"
125
- icon="ph:x"
126
- :size="16" />
127
-
128
- <em class="align-middle inline-block ml-4">
129
- {{ localisations.invalidEmail }}
130
- </em>
131
- </div>
132
- </div>
133
- </div>
134
-
135
- <div class="md:pb-0 md:pr-2 md:w-1/4 pb-2 w-full">
136
- <div class="inline relative text-grey-4 w-full">
137
- <icon class="absolute left-3 top-0.5"
138
- icon="ph:lock"
139
- :size="18" />
140
-
141
- <icon v-show="passwordFieldType === 'password'"
142
- class="absolute cursor-pointer right-3 top-0.5"
143
- icon="ph:eye"
144
- :size="18"
145
- @click="passwordFieldType = 'text'" />
146
-
147
- <icon v-show="passwordFieldType === 'text'"
148
- class="absolute cursor-pointer right-3 top-0.5"
149
- icon="ph:eye-slash"
150
- :size="18"
151
- @click="passwordFieldType = 'password'" />
152
-
153
- <input v-model="password"
154
- class="!pb-1 !pl-9 !pr-9 w-full"
155
- :type="passwordFieldType"
156
- :data-valid="password !== ''"
157
- :placeholder="localisations.password"
158
- autocomplete="current-password"
159
- @input="clearErrors">
160
- </div>
161
- </div>
162
-
163
- <div class="md:w-1/4 w-full">
164
- <cl-ui-button class="w-full"
165
- colour="blue"
166
- :loading="loading"
167
- :disabled="!usernameValid || password === ''"
168
- @click.prevent="login">
169
- {{ localisations.login }}
170
- </cl-ui-button>
171
- </div>
172
-
173
- <span v-show="errors.length"
174
- class="emphasis-danger mt-4 p-4 text-sm w-full">
175
- <div v-for="(error, index) in errors"
176
- :key="index"
177
- class="font-semibold">
178
- {{ error }}
179
- </div>
180
- </span>
181
- </form>
182
- </div>
183
- </template>
@@ -1,120 +0,0 @@
1
- <script lang="ts">
2
- export default {
3
- inheritAttrs: false
4
- };
5
- </script>
6
-
7
- <script setup lang="ts">
8
- import { computed, ref } from 'vue';
9
-
10
- type ModalSize = 'x-small' | 'small' | 'medium' | 'large';
11
-
12
- const props = withDefaults(defineProps<{
13
- title: string;
14
- size?: ModalSize;
15
- confirmButton?: string;
16
- cancelButton?: string;
17
- confirmEnabled?: boolean;
18
- }>(), {
19
- size: 'medium',
20
- confirmButton: '',
21
- cancelButton: '',
22
- confirmEnabled: true
23
- });
24
-
25
- const emit = defineEmits({
26
- confirm: null,
27
- cancel: null
28
- });
29
-
30
- const visible = ref<boolean>(false);
31
-
32
- const showConfirmButton = computed(() => props.confirmButton !== '');
33
- const showCancelButton = computed(() => props.cancelButton !== '');
34
-
35
- /**
36
- * Gets the text for a button, either the default or overridden text.
37
- *
38
- * @param buttonValue Enable/disable flag or button override text.
39
- * @returns The label value to use.
40
- */
41
- function getButtonText (buttonValue: string | boolean): string {
42
- return typeof buttonValue === 'string' ? buttonValue : '';
43
- }
44
-
45
- const confirmButtonText = computed(() => getButtonText(props.confirmButton));
46
- const cancelButtonText = computed(() => getButtonText(props.cancelButton));
47
-
48
- /**
49
- * Toggles the visibility of the model, either to the opposite of its current value or to the provided value.
50
- *
51
- * @param show Whether to show or hide the modal.
52
- */
53
- function toggleModal (show?: boolean): void {
54
- visible.value = typeof show !== 'undefined' ? show : !visible.value;
55
- }
56
-
57
- /**
58
- * Emits an event depending on if the modal has been confirmed or cancelled.
59
- *
60
- * @param action Whether the confirm or cancel/close button has been selected.
61
- */
62
- function modalAction (action: boolean): void {
63
- toggleModal(false);
64
-
65
- if (action) {
66
- emit('confirm', action);
67
- }
68
- else {
69
- emit('cancel', action);
70
- }
71
- }
72
- </script>
73
-
74
- <template>
75
- <slot name="trigger"
76
- v-bind="{ toggleModal }"></slot>
77
-
78
- <teleport to="body">
79
- <div v-show="visible"
80
- class="align-items-center bg-black bg-opacity-40 bottom-0 fixed flex h-full justify-center left-0 right-0 top-0 w-full z-40">
81
- <div v-bind="$attrs"
82
- class="bg-white flex flex-wrap mx-0 my-auto overflow-y-auto relative rounded shadow-lg"
83
- :class="{ 'lg:w-2/12 w-10/12': size === 'x-small', 'w-6/12': size === 'small', 'w-8/12': size === 'medium', 'w-10/12': size === 'large' }">
84
- <div class="absolute cursor-pointer h-2 leading-5 right-3 text-black text-center top-3 w-5"
85
- @click="modalAction(false)">
86
- <icon icon="ph:x"
87
- :size="20" />
88
- </div>
89
-
90
- <div class="border-b border-grey-2 font-semibold h-11 leading-10 overflow-ellipsis overflow-hidden pl-2 pr-8 text-2xl w-full whitespace-nowrap">
91
- {{ title }}
92
- </div>
93
-
94
- <div class="overflow-y-auto p-2 w-full"
95
- v-bind="{ toggleModal }">
96
- <slot></slot>
97
- </div>
98
-
99
- <div v-show="showCancelButton || showConfirmButton"
100
- class="p-2 text-right text-sm w-full">
101
- <cl-ui-button v-if="showConfirmButton"
102
- class="mr-2"
103
- colour="primary"
104
- size="small"
105
- :disabled="confirmEnabled === false"
106
- @click.prevent="modalAction(true)">
107
- {{ confirmButtonText }}
108
- </cl-ui-button>
109
-
110
- <cl-ui-button v-if="showCancelButton"
111
- colour="danger"
112
- size="small"
113
- @click.prevent="modalAction(false)">
114
- {{ cancelButtonText }}
115
- </cl-ui-button>
116
- </div>
117
- </div>
118
- </div>
119
- </teleport>
120
- </template>
@@ -1,124 +0,0 @@
1
- <script setup lang="ts">
2
- import { ref } from 'vue';
3
-
4
- import { NavigationGroup } from '../../@types';
5
-
6
- withDefaults(defineProps<{
7
- groups?: NavigationGroup[];
8
- }>(), {
9
- groups: () => []
10
- });
11
-
12
- defineEmits({
13
- 'item-select': null
14
- });
15
-
16
- const activeGroup = ref<NavigationGroup | null>(null);
17
- const menuPinned = ref(false);
18
-
19
- /**
20
- * Selects a given navigation group.
21
- *
22
- * @param group The group which has been selected.
23
- */
24
- function selectNavigationGroup (group: NavigationGroup): void {
25
- activeGroup.value = (activeGroup.value?.name === group.name ? null : group);
26
- }
27
-
28
- /**
29
- * Toggles the pinned state of the navigation.
30
- */
31
- function toggleMenuPinned (): void {
32
- menuPinned.value = !menuPinned.value;
33
- }
34
- </script>
35
-
36
- <style scoped lang="postcss">
37
- .navslide-enter-from,
38
- .navslide-leave-to {
39
- @apply -left-full;
40
- }
41
-
42
- #group-container {
43
- scrollbar-width: 0;
44
- }
45
-
46
- #group-container::-webkit-scrollbar {
47
- @apply hidden;
48
- }
49
- </style>
50
-
51
- <template>
52
- <div class="flex flex-nowrap h-full max-h-full min-h-full min-w-20 relative self-start w-auto">
53
- <div v-if="groups"
54
- id="group-container"
55
- class="bg-blue-default h-full left-0 max-h-full min-h-full min-w-20 overflow-y-auto self-start sticky w-20 z-30">
56
- <div v-for="(group, index) in groups"
57
- :key="index"
58
- class="flex-grow w-full">
59
- <div class="cursor-pointer h-20 hover:bg-blue-light transition-colors w-20"
60
- :class="{ 'bg-blue-light' : group.name === activeGroup?.name }"
61
- @click="selectNavigationGroup(group);">
62
- <icon v-if="group.icon !== null"
63
- class="block h-20 p-7 w-20"
64
- :icon="group.icon"
65
- color="#FFFFFF" />
66
- </div>
67
- </div>
68
- </div>
69
-
70
- <transition name="navslide">
71
- <div v-if="activeGroup"
72
- class="bg-grey-0 border-grey-2 border-r max-h-full min-h-full min-w-[260px] p-8 self-start top-0 transition-all z-20"
73
- :class="{ 'relative' : menuPinned, 'absolute left-20': !menuPinned }">
74
- <div class="font-bold leading-8 mb-8 pr-8 relative w-full">
75
- <span class="select-none text-blue-light text-lg">
76
- {{ activeGroup.caption }}
77
- </span>
78
-
79
- <span class="absolute cursor-pointer h-8 hidden leading-8 md:inline-block right-0 text-center top-0 w-8"
80
- @click="toggleMenuPinned">
81
- <icon v-if="!menuPinned"
82
- class="inline-block"
83
- icon="ph:push-pin" />
84
- <icon v-else
85
- class="inline-block"
86
- icon="ph:push-pin-slash" />
87
- </span>
88
- </div>
89
- <div v-for="(section, sectionIndex) in activeGroup.sections"
90
- :key="sectionIndex"
91
- class="mb-8 text-sm w-full">
92
- <div class="font-bold mb-4 select-none w-full">
93
- {{ section.caption }}
94
- </div>
95
-
96
- <span v-for="(record, recordIndex) in section.records"
97
- :key="recordIndex"
98
- class="block cursor-pointer hover:text-blue-light mb-2 transition-colors">
99
- <template v-if="record.component">
100
- <component :is="record.component"
101
- :to="record.link"
102
- @click="$emit('item-select', record)">
103
- {{ record.caption }}
104
- </component>
105
- </template>
106
- <a v-else
107
- :href="record.link"
108
- :alt="`External link to: ${record.link}`"
109
- :title="`External link to: ${record.link}`"
110
- target="new"
111
- @click="$emit('item-select', record)">
112
- <icon
113
- class="inline-block"
114
- icon="ph:arrow-square-out"
115
- alt="External Link" />
116
-
117
- {{ record.caption }}
118
- </a>
119
- </span>
120
- </div>
121
- </div>
122
- </transition>
123
- </div>
124
- </template>
@@ -1,55 +0,0 @@
1
- <script lang="ts">
2
- export default {
3
- inheritAttrs: false
4
- };
5
- </script>
6
-
7
- <script setup lang="ts">
8
- import { notifications, removeNotification } from '../../composables/notification';
9
-
10
- type NotificationPosition = 'top-left' | 'top-centre' | 'top-right' | 'bottom-left' | 'bottom-centre' | 'bottom-right';
11
-
12
- withDefaults(defineProps<{
13
- container?: string;
14
- position?: NotificationPosition;
15
- }>(), {
16
- container: 'body',
17
- position: 'top-right'
18
- });
19
- </script>
20
-
21
- <template>
22
- <teleport :to="container">
23
- <div class="fixed w-80 z-40"
24
- :class="{
25
- 'top-5 left-5': position === 'top-left',
26
- 'top-5 left-1/2': position === 'top-centre',
27
- 'top-5 right-5': position === 'top-right',
28
- 'bottom-5 left-5': position === 'bottom-left',
29
- 'bottom-5 left-1/2': position === 'bottom-centre',
30
- 'bottom-5 right-5': position === 'bottom-right'
31
- }">
32
- <div v-for="(notification, index) in notifications"
33
- v-bind="$attrs"
34
- :key="index"
35
- class="break-words cursor-pointer flex font-semibold group mb-2 overflow-hidden p-4 rounded shadow-lg text-sm"
36
- :class="{
37
- 'bg-white': notification.colour === 'default',
38
- 'bg-primary-default': notification.colour === 'primary',
39
- 'bg-secondary-default': notification.colour === 'secondary',
40
- 'bg-danger-default': notification.colour === 'danger',
41
- 'bg-warning-default': notification.colour === 'warning'
42
- }"
43
- @click="removeNotification(notification)">
44
- <span class="flex-1 overflow-ellipsis select-none w-64">
45
- {{ notification.message }}
46
- </span>
47
-
48
- <icon class="group-hover:opacity-100 inline-block opacity-0"
49
- icon="ph:x"
50
- :size="16"
51
- weight="bold" />
52
- </div>
53
- </div>
54
- </teleport>
55
- </template>