@citruslime/ui 2.0.0-beta.2 → 2.0.0-beta.23
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/README.md +5 -4
- package/dist/citrus-lime-ui.es.js +4616 -0
- package/dist/citrus-lime-ui.umd.js +2 -0
- package/dist/components/accordion/cl-ui-accordion.vue.d.ts +26 -0
- package/dist/components/accordion/index.d.ts +4 -0
- package/dist/components/accordion/item/cl-ui-accordion-item.vue.d.ts +35 -0
- package/dist/{@types/components/accordion/item.d.ts → components/accordion/types.d.ts} +0 -0
- package/dist/components/app/cl-ui-app.vue.d.ts +51 -0
- package/dist/components/app/index.d.ts +1 -0
- package/dist/components/button/cl-ui-button.vue.d.ts +51 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/types.d.ts +4 -0
- package/dist/components/calendar/cl-ui-calendar.vue.d.ts +2 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/types.d.ts +2 -0
- package/dist/components/calendar/utils.d.ts +38 -0
- package/dist/components/card/cl-ui-card.vue.d.ts +27 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/types.d.ts +2 -0
- package/dist/components/combo-box/cl-ui-combo-box.vue.d.ts +583 -0
- package/dist/components/combo-box/index.d.ts +2 -0
- package/dist/components/combo-box/search-container/cl-ui-combo-box-search.vue.d.ts +276 -0
- package/dist/components/combo-box/search-container/header/cl-ui-combo-box-header.vue.d.ts +42 -0
- package/dist/components/combo-box/search-container/selectable/cl-ui-combo-box-selectable.vue.d.ts +81 -0
- package/dist/{@types/components/combo-box/item.d.ts → components/combo-box/types.d.ts} +0 -0
- package/dist/components/footer/index.d.ts +1 -0
- package/dist/components/grid/cell/cl-ui-grid-cell.vue.d.ts +72 -0
- package/dist/components/grid/cl-ui-grid.vue.d.ts +550 -0
- package/dist/components/grid/filter/cl-ui-grid-filter.vue.d.ts +72 -0
- package/dist/components/grid/filter/filter-methods.d.ts +5 -0
- package/dist/components/grid/footer/cl-ui-grid-footer.vue.d.ts +63 -0
- package/dist/components/grid/header/cl-ui-grid-header.vue.d.ts +207 -0
- package/dist/components/grid/index.d.ts +2 -0
- package/dist/components/grid/types.d.ts +92 -0
- package/dist/components/grid/view-manager/cl-ui-grid-view-manager.vue.d.ts +88 -0
- package/dist/components/header/index.d.ts +2 -0
- package/dist/components/header/menu/cl-ui-header-menu.vue.d.ts +40 -0
- package/dist/components/header/menu/index.d.ts +1 -0
- package/dist/components/index.d.ts +16 -17
- package/dist/components/input/cl-ui-input.vue.d.ts +2 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/types.d.ts +6 -0
- package/dist/components/input/utils.d.ts +44 -0
- package/dist/components/language-switcher/cl-ui-language-switcher.vue.d.ts +37 -0
- package/dist/components/language-switcher/index.d.ts +2 -0
- package/dist/{@types/language.d.ts → components/language-switcher/types.d.ts} +0 -1
- package/dist/components/loading-spinner/index.d.ts +1 -0
- package/dist/components/login/cl-ui-login.vue.d.ts +106 -0
- package/dist/components/login/index.d.ts +2 -0
- package/dist/{@types/components/login/authentication.d.ts → components/login/types.d.ts} +0 -0
- package/dist/components/modal/cl-ui-modal.vue.d.ts +49 -0
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/types.d.ts +4 -0
- package/dist/components/navigation/cl-ui-navigation.vue.d.ts +11 -0
- package/dist/components/navigation/group/cl-ui-navigation-group.vue.d.ts +12 -0
- package/dist/components/navigation/icon/cl-ui-navigation-icon.vue.d.ts +20 -0
- package/dist/components/navigation/index.d.ts +5 -0
- package/dist/components/notification/cl-ui-notification.vue.d.ts +36 -0
- package/dist/components/notification/index.d.ts +1 -0
- package/dist/components/notification/types.d.ts +9 -0
- package/dist/components/slider/cl-ui-slider.vue.d.ts +114 -0
- package/dist/components/slider/index.d.ts +1 -0
- package/dist/components/tab/cl-ui-tab.vue.d.ts +52 -0
- package/dist/components/tab/header/cl-ui-tab-header.vue.d.ts +60 -0
- package/dist/components/tab/index.d.ts +4 -0
- package/dist/components/tab/types.d.ts +4 -0
- package/dist/composables/notification.d.ts +1 -1
- package/dist/main.d.ts +2 -4
- package/dist/style.css +1 -1
- package/dist/utils/i18n/config.d.ts +33 -0
- package/dist/utils/i18n/defaults.d.ts +4 -0
- package/dist/utils/i18n/index.d.ts +3 -0
- package/dist/utils/i18n/types.d.ts +97 -0
- package/dist/utils/index.d.ts +2 -6
- package/dist/utils/validation.d.ts +37 -0
- package/package.json +27 -14
- package/dist/.eslintrc.js +0 -453
- package/dist/.stylelintrc.js +0 -119
- package/dist/@types/appUser.d.ts +0 -11
- package/dist/@types/components/accordion/index.d.ts +0 -1
- package/dist/@types/components/combo-box/index.d.ts +0 -2
- package/dist/@types/components/combo-box/localisations.d.ts +0 -19
- package/dist/@types/components/grid/column.d.ts +0 -46
- package/dist/@types/components/grid/index.d.ts +0 -4
- package/dist/@types/components/grid/localisations.d.ts +0 -47
- package/dist/@types/components/grid/request.d.ts +0 -49
- package/dist/@types/components/grid/update.d.ts +0 -4
- package/dist/@types/components/header/index.d.ts +0 -1
- package/dist/@types/components/header/localisations.d.ts +0 -8
- package/dist/@types/components/login/index.d.ts +0 -2
- package/dist/@types/components/login/localisations.d.ts +0 -7
- package/dist/@types/components/navigation/index.d.ts +0 -18
- package/dist/@types/components/notification/index.d.ts +0 -1
- package/dist/@types/components/notification/item.d.ts +0 -7
- package/dist/@types/components/slider/index.d.ts +0 -1
- package/dist/@types/components/slider/localisations.d.ts +0 -3
- package/dist/@types/date-format.d.ts +0 -8
- package/dist/@types/debouncer.d.ts +0 -6
- package/dist/@types/index.d.ts +0 -16
- package/dist/@types/locale.d.ts +0 -10
- package/dist/@types/number-format.d.ts +0 -7
- package/dist/@types/string-format.d.ts +0 -3
- package/dist/@types/string.d.ts +0 -47
- package/dist/theme.js +0 -120
- package/dist/ui.es.js +0 -1
- package/dist/ui.umd.js +0 -1
- package/dist/utils/copy.d.ts +0 -8
- package/dist/utils/debouncer.d.ts +0 -8
- package/dist/utils/extensions/string-utilities.d.ts +0 -83
- package/dist/utils/extensions/string.d.ts +0 -1
- package/dist/utils/i18n/datetime-formats.d.ts +0 -3
- package/dist/utils/i18n/number-formats.d.ts +0 -3
- package/dist/utils/id.d.ts +0 -6
- package/dist/utils/name-of.d.ts +0 -7
- package/dist/utils/sort.d.ts +0 -9
- package/dist/utils/url-params.d.ts +0 -8
- package/src/components/accordion/cl-ui-accordion.vue +0 -89
- package/src/components/app/cl-ui-app.vue +0 -26
- package/src/components/button/cl-ui-button.vue +0 -48
- package/src/components/calendar/cl-ui-calendar.vue +0 -277
- package/src/components/card/cl-ui-card.vue +0 -70
- package/src/components/combo-box/cl-ui-combo-box.vue +0 -357
- package/src/components/combo-box/search-container/cl-ui-combo-box-search.vue +0 -279
- package/src/components/combo-box/search-container/header/cl-ui-combo-box-header.vue +0 -36
- package/src/components/combo-box/search-container/selectable/cl-ui-combo-box-selectable.vue +0 -99
- package/src/components/footer/cl-ui-footer.vue +0 -31
- package/src/components/grid/cell/cl-ui-grid-cell.vue +0 -153
- package/src/components/grid/cl-ui-grid.vue +0 -477
- package/src/components/grid/filter/cl-ui-grid-filter.vue +0 -270
- package/src/components/grid/footer/cl-ui-grid-footer.vue +0 -186
- package/src/components/grid/header/cl-ui-grid-header.vue +0 -76
- package/src/components/grid/view-manager/cl-ui-grid-view-manager.vue +0 -145
- package/src/components/header/cl-ui-header.vue +0 -11
- package/src/components/header-helper/cl-ui-header-helper.vue +0 -50
- package/src/components/language-switcher/cl-ui-language-switcher.vue +0 -82
- package/src/components/loading-spinner/cl-ui-loading-spinner.vue +0 -16
- package/src/components/login/cl-ui-login.vue +0 -183
- package/src/components/modal/cl-ui-modal.vue +0 -120
- package/src/components/navigation/cl-ui-navigation.vue +0 -124
- package/src/components/notification/cl-ui-notification.vue +0 -55
- package/src/components/slider/cl-ui-slider.vue +0 -145
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, nextTick } from 'vue';
|
|
3
|
-
import { useI18n } from 'vue-i18n';
|
|
4
|
-
|
|
5
|
-
import { NumberFormat, SliderLocalisations } from '../../@types';
|
|
6
|
-
import { useDebouncer } from '../../utils';
|
|
7
|
-
|
|
8
|
-
const props = withDefaults(defineProps<{
|
|
9
|
-
value: number;
|
|
10
|
-
min: number;
|
|
11
|
-
max: number;
|
|
12
|
-
currentLocale?: string;
|
|
13
|
-
localisations?: SliderLocalisations;
|
|
14
|
-
step?: number;
|
|
15
|
-
enforceStep?: boolean;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
}>(), {
|
|
18
|
-
currentLocale: 'en-GB',
|
|
19
|
-
localisations: () => ({
|
|
20
|
-
invalidProps: 'The current combination of props is invalid. Please confirm the values provided are correct.'
|
|
21
|
-
}),
|
|
22
|
-
step: 1,
|
|
23
|
-
enforceStep: false,
|
|
24
|
-
disabled: false
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
const emit = defineEmits({
|
|
28
|
-
'update:value': null
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const { n } = useI18n();
|
|
32
|
-
const { debounce } = useDebouncer();
|
|
33
|
-
|
|
34
|
-
const currentValue = computed<number>({
|
|
35
|
-
get: () => props.value,
|
|
36
|
-
set: (value) => emit('update:value', value)
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const colour = computed<string>(() => props.disabled ? 'rgba(153, 153, 153, 0.8)' : '#9acd32');
|
|
40
|
-
const percentage = computed<number>(() => {
|
|
41
|
-
let value = ((currentValue.value - props.min) / (props.max - props.min)) * 100;
|
|
42
|
-
|
|
43
|
-
if (value < 35 && value > 0) {
|
|
44
|
-
if (value < 20) {
|
|
45
|
-
value += 0.5;
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
value += 0.25;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
else if (value > 65 && value < 100) {
|
|
52
|
-
if (value > 80) {
|
|
53
|
-
value -= 0.5;
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
value -= 0.25;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return value;
|
|
61
|
-
});
|
|
62
|
-
const validProps = computed<boolean>(() => props.min <= props.max && props.step > 0);
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Updates the current value and forces a re-render of the input.
|
|
66
|
-
*
|
|
67
|
-
* @param target The input event target.
|
|
68
|
-
* @param forceUpdate $forceUpdate isn't available in the composition API but can be passed in as a parameter.
|
|
69
|
-
*/
|
|
70
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
71
|
-
function updateCurrentValue (target: EventTarget | null, forceUpdate: Function): void {
|
|
72
|
-
const inputValue: string = (target as HTMLInputElement | null)?.value ?? '';
|
|
73
|
-
const value: number = Math.max(Math.min(parseFloat(inputValue) || props.min, props.max), props.min);
|
|
74
|
-
|
|
75
|
-
currentValue.value = props.enforceStep ? Math.ceil(value / props.step) * props.step : value;
|
|
76
|
-
|
|
77
|
-
nextTick(() => forceUpdate());
|
|
78
|
-
}
|
|
79
|
-
</script>
|
|
80
|
-
|
|
81
|
-
<style scoped lang="postcss">
|
|
82
|
-
input[type='range']::-webkit-slider-runnable-track {
|
|
83
|
-
@apply bg-none h-1;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
input[type='range']::-moz-range-track {
|
|
87
|
-
@apply bg-none rounded-full h-1;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
input[type='range']::-webkit-slider-thumb {
|
|
91
|
-
@apply appearance-none bg-white border border-solid border-grey-2 rounded-full cursor-pointer h-6 w-6;
|
|
92
|
-
|
|
93
|
-
margin-top: -0.6rem;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
input[type='range']:disabled::-webkit-slider-thumb {
|
|
97
|
-
@apply hidden;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
input[type='range']::-moz-range-thumb {
|
|
101
|
-
@apply bg-white border border-grey-2 rounded-full cursor-pointer h-6 w-6;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
input[type='range']:disabled::-moz-range-thumb {
|
|
105
|
-
@apply h-0 w-0;
|
|
106
|
-
}
|
|
107
|
-
</style>
|
|
108
|
-
|
|
109
|
-
<template>
|
|
110
|
-
<div v-if="validProps"
|
|
111
|
-
v-bind="$attrs"
|
|
112
|
-
class="flex flex-wrap items-center">
|
|
113
|
-
<input class="!text-sm md:!h-8 md:!w-auto"
|
|
114
|
-
type="number"
|
|
115
|
-
:value="currentValue"
|
|
116
|
-
:min="min"
|
|
117
|
-
:max="max"
|
|
118
|
-
:step="step"
|
|
119
|
-
:disabled="disabled"
|
|
120
|
-
@input="debounce(updateCurrentValue, [ $event.target, $forceUpdate ])">
|
|
121
|
-
|
|
122
|
-
<div class="flex flex-1 flex-wrap items-center md:mt-0 mt-3">
|
|
123
|
-
<span class="bg-grey-0 leading-6 md:ml-2 ml-0 px-3 rounded-full text-center text-xs">
|
|
124
|
-
{{ n(min, Number.isInteger(min) ? NumberFormat.INTEGER : NumberFormat.DECIMAL, currentLocale ) }}
|
|
125
|
-
</span>
|
|
126
|
-
|
|
127
|
-
<input v-model.number="currentValue"
|
|
128
|
-
class="align-middle appearance-none bg-gradient-to-r border border-grey-2 delay-500 ease-in flex-1 h-5 ml-2 outline-none rounded-full transition-colors"
|
|
129
|
-
:style="{ background: `linear-gradient(to right, ${colour} 0%, ${colour} ${percentage}%, white ${percentage}%, white 100%)` }"
|
|
130
|
-
type="range"
|
|
131
|
-
:min="min"
|
|
132
|
-
:max="max"
|
|
133
|
-
:step="step"
|
|
134
|
-
:disabled="disabled">
|
|
135
|
-
|
|
136
|
-
<span class="bg-grey-0 leading-6 ml-2 px-3 rounded-full text-center text-xs">
|
|
137
|
-
{{ n(max, Number.isInteger(max) ? NumberFormat.INTEGER : NumberFormat.DECIMAL, currentLocale ) }}
|
|
138
|
-
</span>
|
|
139
|
-
</div>
|
|
140
|
-
</div>
|
|
141
|
-
<div v-else
|
|
142
|
-
class="emphasis-danger text-sm w-full">
|
|
143
|
-
{{ localisations.invalidProps }}
|
|
144
|
-
</div>
|
|
145
|
-
</template>
|