@aziontech/webkit 1.0.1 → 1.2.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.
- package/package.json +4 -2
- package/src/components/azion-system-status/azion-system-status.vue +123 -0
- package/src/components/azion-system-status/azion-system-status.vue.d.ts +4 -0
- package/src/components/azion-system-status/azion-system-status.vue.d.ts.map +1 -0
- package/src/components/azion-system-status/package.json +11 -0
- package/src/core/form/field-auto-complete/field-auto-complete.vue.d.ts +4 -4
- package/src/core/form/field-checkbox-block/field-checkbox-block.vue.d.ts +3 -3
- package/src/core/form/field-dropdown/field-dropdown.vue.d.ts +5 -5
- package/src/core/form/field-dropdown-icon/field-dropdown-icon.vue.d.ts +4 -4
- package/src/core/form/field-dropdown-lazy-loader/field-dropdown-lazy-loader.vue.d.ts +2 -2
- package/src/core/form/field-dropdown-lazy-loader-dynamic/field-dropdown-lazy-loader-dynamic.vue.d.ts +2 -2
- package/src/core/form/field-dropdown-lazy-loader-with-filter/field-dropdown-lazy-loader-with-filter.vue.d.ts +2 -2
- package/src/core/form/field-dropdown-multi-select-lazy-loader/field-dropdown-multi-select-lazy-loader.vue.d.ts +2 -2
- package/src/core/form/field-input-group/field-input-group.vue.d.ts +3 -3
- package/src/core/form/field-multi-select/field-multi-select.vue.d.ts +5 -5
- package/src/core/form/field-number/field-number.vue.d.ts +3 -3
- package/src/core/form/field-phone-number/field-phone-number.vue.d.ts +2 -2
- package/src/core/form/field-radio-block/field-radio-block.vue.d.ts +2 -2
- package/src/core/form/field-switch/field-switch.vue.d.ts +1 -1
- package/src/core/form/field-switch-block/field-switch-block.vue.d.ts +1 -1
- package/src/core/form/field-text/field-text.vue.d.ts +3 -3
- package/src/core/form/field-text-area/field-text-area.vue.d.ts +3 -3
- package/src/core/form/field-text-icon/field-text-icon.vue.d.ts +4 -4
- package/src/core/form/field-text-password/field-text-password.vue.d.ts +3 -3
- package/src/core/form/field-text-privacy/field-text-privacy.vue +284 -0
- package/src/core/form/field-text-privacy/field-text-privacy.vue.d.ts +119 -0
- package/src/core/form/field-text-privacy/field-text-privacy.vue.d.ts.map +1 -0
- package/src/core/form/field-text-privacy/package.json +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aziontech/webkit",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Reusable UI components and design system utilities for building Azion web interfaces.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -64,7 +64,9 @@
|
|
|
64
64
|
"./field-text-area": "./src/core/form/field-text-area/field-text-area.vue",
|
|
65
65
|
"./field-text-icon": "./src/core/form/field-text-icon/field-text-icon.vue",
|
|
66
66
|
"./field-text-password": "./src/core/form/field-text-password/field-text-password.vue",
|
|
67
|
+
"./field-text-privacy": "./src/core/form/field-text-privacy/field-text-privacy.vue",
|
|
67
68
|
"./label": "./src/core/form/label/label.vue",
|
|
68
|
-
"./selector-block": "./src/core/selector-block/selector-block.vue"
|
|
69
|
+
"./selector-block": "./src/core/selector-block/selector-block.vue",
|
|
70
|
+
"./azion-system-status": "./src/components/azion-system-status/azion-system-status.vue"
|
|
69
71
|
}
|
|
70
72
|
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
// azion system status button
|
|
3
|
+
import PrimeButton from 'primevue/button'
|
|
4
|
+
import { ref, computed, onMounted } from 'vue'
|
|
5
|
+
|
|
6
|
+
const STATUS_PAGE = {
|
|
7
|
+
none: 'operational',
|
|
8
|
+
minor: 'minor-outage',
|
|
9
|
+
major: 'partial-outage',
|
|
10
|
+
critical: 'major-outage',
|
|
11
|
+
maintenance: 'maintenance'
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const STATUS_PAGE_COLORS = {
|
|
15
|
+
none: '#8bc249',
|
|
16
|
+
minor: '#fec111',
|
|
17
|
+
major: '#f3652b',
|
|
18
|
+
critical: '#ff4141',
|
|
19
|
+
maintenance: '#6e7cf7'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const OPERATIONAL_STATUS = {
|
|
23
|
+
indicator: 'none',
|
|
24
|
+
description: 'All Systems Operational'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const STATUS_API_BASE_URL = 'https://status.azion.com/api/v2'
|
|
28
|
+
|
|
29
|
+
async function fetchStatusApi(endpoint) {
|
|
30
|
+
const response = await fetch(`${STATUS_API_BASE_URL}${endpoint}`, {
|
|
31
|
+
method: 'GET'
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
if (!response.ok) {
|
|
35
|
+
throw new Error(`HTTP error! status: ${response.status}`)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return response.json()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const error = ref(false)
|
|
42
|
+
const status = ref('')
|
|
43
|
+
const label = ref('')
|
|
44
|
+
const link = ref('https://status.azion.com')
|
|
45
|
+
const color = ref(STATUS_PAGE_COLORS.none)
|
|
46
|
+
|
|
47
|
+
const colorStatus = computed(() => ({ color: color.value }))
|
|
48
|
+
|
|
49
|
+
function redirectToLink() {
|
|
50
|
+
window.open(link.value, '_blank')
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async function fetchComponentsStatus() {
|
|
54
|
+
return fetchStatusApi('/components.json')
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function fetchStatusPage() {
|
|
58
|
+
const data = await fetchStatusApi('/status.json')
|
|
59
|
+
|
|
60
|
+
if (data && data.status) {
|
|
61
|
+
return {
|
|
62
|
+
indicator: data.status.indicator,
|
|
63
|
+
description: data.status.description
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return OPERATIONAL_STATUS
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function checkComponentStatus() {
|
|
71
|
+
try {
|
|
72
|
+
const data = await fetchComponentsStatus()
|
|
73
|
+
const components = data?.components || []
|
|
74
|
+
|
|
75
|
+
const checkComponents = (component) =>
|
|
76
|
+
component.status !== 'operational' && component.status !== 'partial_outage'
|
|
77
|
+
const hasImpactedComponent = components.some(checkComponents)
|
|
78
|
+
|
|
79
|
+
const statusResult = await getStatus(hasImpactedComponent)
|
|
80
|
+
updateSystemStatus(statusResult)
|
|
81
|
+
} catch (err) {
|
|
82
|
+
error.value = true
|
|
83
|
+
// eslint-disable-next-line no-console
|
|
84
|
+
console.error(err)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async function getStatus(checkStatusPage) {
|
|
89
|
+
if (checkStatusPage) {
|
|
90
|
+
return fetchStatusPage()
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return OPERATIONAL_STATUS
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function updateSystemStatus({ indicator, description }) {
|
|
97
|
+
status.value = STATUS_PAGE[indicator]
|
|
98
|
+
color.value = STATUS_PAGE_COLORS[indicator]
|
|
99
|
+
label.value = description
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
onMounted(() => {
|
|
103
|
+
checkComponentStatus()
|
|
104
|
+
})
|
|
105
|
+
</script>
|
|
106
|
+
|
|
107
|
+
<template>
|
|
108
|
+
<PrimeButton
|
|
109
|
+
outlined
|
|
110
|
+
class="surface-section min-w-fit hover:surface-hover whitespace-nowrap"
|
|
111
|
+
icon="pi pi-circle-fill"
|
|
112
|
+
size="small"
|
|
113
|
+
v-show="!error"
|
|
114
|
+
:label="label"
|
|
115
|
+
:loading="!label"
|
|
116
|
+
:pt="{
|
|
117
|
+
root: { class: 'h-8 flex-row items-center' },
|
|
118
|
+
label: { class: 'font-normal text-sm min-w-[9rem]' },
|
|
119
|
+
icon: { style: colorStatus, class: 'text-xs' }
|
|
120
|
+
}"
|
|
121
|
+
@click="redirectToLink"
|
|
122
|
+
/>
|
|
123
|
+
</template>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
4
|
+
//# sourceMappingURL=azion-system-status.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azion-system-status.vue.d.ts","sourceRoot":"","sources":["azion-system-status.vue"],"names":[],"mappings":"wBA0SqB,OAAO,YAAY;;AAFxC,0SACG"}
|
|
@@ -93,13 +93,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
93
93
|
default: boolean;
|
|
94
94
|
};
|
|
95
95
|
}>> & Readonly<{}>, {
|
|
96
|
-
value: string;
|
|
97
|
-
label: string;
|
|
98
|
-
placeholder: string;
|
|
99
96
|
description: string;
|
|
97
|
+
label: string;
|
|
98
|
+
icon: string;
|
|
100
99
|
disabled: boolean;
|
|
100
|
+
value: string;
|
|
101
|
+
placeholder: string;
|
|
101
102
|
readonly: boolean;
|
|
102
|
-
icon: string;
|
|
103
103
|
suggestions: unknown[];
|
|
104
104
|
onComplete: Function;
|
|
105
105
|
completeOnFocus: boolean;
|
|
@@ -43,7 +43,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
43
43
|
required: true;
|
|
44
44
|
};
|
|
45
45
|
value: {
|
|
46
|
-
type: (
|
|
46
|
+
type: (BooleanConstructor | StringConstructor | ObjectConstructor)[];
|
|
47
47
|
default: boolean;
|
|
48
48
|
};
|
|
49
49
|
binary: {
|
|
@@ -89,7 +89,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
89
89
|
required: true;
|
|
90
90
|
};
|
|
91
91
|
value: {
|
|
92
|
-
type: (
|
|
92
|
+
type: (BooleanConstructor | StringConstructor | ObjectConstructor)[];
|
|
93
93
|
default: boolean;
|
|
94
94
|
};
|
|
95
95
|
binary: {
|
|
@@ -97,8 +97,8 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
97
97
|
default: boolean;
|
|
98
98
|
};
|
|
99
99
|
}>> & Readonly<{}>, {
|
|
100
|
-
value: string | boolean | Record<string, any>;
|
|
101
100
|
disabled: boolean;
|
|
101
|
+
value: string | boolean | Record<string, any>;
|
|
102
102
|
auto: boolean;
|
|
103
103
|
isCard: boolean;
|
|
104
104
|
hideSelector: boolean;
|
|
@@ -175,18 +175,18 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
175
175
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
176
176
|
onOnSelectOption?: ((...args: any[]) => any) | undefined;
|
|
177
177
|
}>, {
|
|
178
|
-
value: string | number;
|
|
179
|
-
label: string;
|
|
180
|
-
placeholder: string;
|
|
181
178
|
description: string;
|
|
179
|
+
label: string;
|
|
180
|
+
loading: boolean;
|
|
181
|
+
pt: Record<string, any>;
|
|
182
182
|
disabled: boolean;
|
|
183
|
+
value: string | number;
|
|
184
|
+
placeholder: string;
|
|
183
185
|
filter: boolean;
|
|
184
186
|
optionLabel: string;
|
|
185
187
|
optionDisabled: string | Function;
|
|
186
188
|
optionGroupLabel: string;
|
|
187
189
|
optionGroupChildren: string;
|
|
188
|
-
loading: boolean;
|
|
189
|
-
pt: Record<string, any>;
|
|
190
190
|
optionValue: string;
|
|
191
191
|
options: unknown[];
|
|
192
192
|
enableWorkaroundLabelToDisabledOptions: boolean;
|
|
@@ -97,13 +97,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
97
97
|
}>> & Readonly<{
|
|
98
98
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
99
99
|
}>, {
|
|
100
|
-
value: string;
|
|
101
|
-
label: string;
|
|
102
|
-
placeholder: string;
|
|
103
100
|
description: string;
|
|
101
|
+
label: string;
|
|
102
|
+
icon: string;
|
|
104
103
|
disabled: boolean;
|
|
104
|
+
value: string;
|
|
105
|
+
placeholder: string;
|
|
105
106
|
readonly: boolean;
|
|
106
|
-
icon: string;
|
|
107
107
|
suggestions: unknown[];
|
|
108
108
|
onComplete: Function;
|
|
109
109
|
completeOnFocus: boolean;
|
|
@@ -173,10 +173,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
173
173
|
onOnAccessDenied?: ((...args: any[]) => any) | undefined;
|
|
174
174
|
onOnLoaded?: ((...args: any[]) => any) | undefined;
|
|
175
175
|
}>, {
|
|
176
|
-
|
|
176
|
+
description: string;
|
|
177
177
|
label: string;
|
|
178
|
+
value: string | number;
|
|
178
179
|
placeholder: string;
|
|
179
|
-
description: string;
|
|
180
180
|
optionLabel: string;
|
|
181
181
|
optionDisabled: string | Function;
|
|
182
182
|
optionGroupLabel: string;
|
package/src/core/form/field-dropdown-lazy-loader-dynamic/field-dropdown-lazy-loader-dynamic.vue.d.ts
CHANGED
|
@@ -137,10 +137,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
137
137
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
138
138
|
onOnSelectOption?: ((...args: any[]) => any) | undefined;
|
|
139
139
|
}>, {
|
|
140
|
-
|
|
140
|
+
description: string;
|
|
141
141
|
label: string;
|
|
142
|
+
value: string | number;
|
|
142
143
|
placeholder: string;
|
|
143
|
-
description: string;
|
|
144
144
|
optionLabel: string;
|
|
145
145
|
optionDisabled: string | Function;
|
|
146
146
|
optionValue: string;
|
|
@@ -177,10 +177,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
177
177
|
onOnSelectOption?: ((...args: any[]) => any) | undefined;
|
|
178
178
|
onOnAccessDenied?: ((...args: any[]) => any) | undefined;
|
|
179
179
|
}>, {
|
|
180
|
-
|
|
180
|
+
description: string;
|
|
181
181
|
label: string;
|
|
182
|
+
value: string | number;
|
|
182
183
|
placeholder: string;
|
|
183
|
-
description: string;
|
|
184
184
|
optionLabel: string;
|
|
185
185
|
optionDisabled: string | Function;
|
|
186
186
|
optionGroupLabel: string;
|
|
@@ -143,10 +143,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
143
143
|
onOnLoaded?: ((...args: any[]) => any) | undefined;
|
|
144
144
|
onOnClear?: ((...args: any[]) => any) | undefined;
|
|
145
145
|
}>, {
|
|
146
|
-
|
|
146
|
+
description: string;
|
|
147
147
|
label: string;
|
|
148
|
+
value: unknown[];
|
|
148
149
|
placeholder: string;
|
|
149
|
-
description: string;
|
|
150
150
|
optionLabel: string;
|
|
151
151
|
optionDisabled: string | Function;
|
|
152
152
|
optionValue: string;
|
|
@@ -71,11 +71,11 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
71
71
|
default: string;
|
|
72
72
|
};
|
|
73
73
|
}>> & Readonly<{}>, {
|
|
74
|
-
value: string;
|
|
75
|
-
label: string;
|
|
76
|
-
placeholder: string;
|
|
77
74
|
description: string;
|
|
75
|
+
label: string;
|
|
78
76
|
disabled: boolean;
|
|
77
|
+
value: string;
|
|
78
|
+
placeholder: string;
|
|
79
79
|
readonly: boolean;
|
|
80
80
|
inputClass: string;
|
|
81
81
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -117,16 +117,16 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
117
117
|
onOnBlur?: ((...args: any[]) => any) | undefined;
|
|
118
118
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
119
119
|
}>, {
|
|
120
|
-
value: unknown[];
|
|
121
|
-
label: string;
|
|
122
|
-
placeholder: string;
|
|
123
120
|
description: string;
|
|
121
|
+
label: string;
|
|
122
|
+
loading: boolean;
|
|
123
|
+
pt: Record<string, any>;
|
|
124
124
|
disabled: boolean;
|
|
125
|
+
value: unknown[];
|
|
126
|
+
placeholder: string;
|
|
125
127
|
filter: boolean;
|
|
126
128
|
optionLabel: string;
|
|
127
129
|
optionDisabled: string | Function;
|
|
128
|
-
loading: boolean;
|
|
129
|
-
pt: Record<string, any>;
|
|
130
130
|
optionValue: string;
|
|
131
131
|
options: unknown[];
|
|
132
132
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -117,11 +117,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
117
117
|
onInput?: ((...args: any[]) => any) | undefined;
|
|
118
118
|
onBlur?: ((...args: any[]) => any) | undefined;
|
|
119
119
|
}>, {
|
|
120
|
-
value: string;
|
|
121
|
-
label: string;
|
|
122
|
-
placeholder: string;
|
|
123
120
|
description: string;
|
|
121
|
+
label: string;
|
|
124
122
|
disabled: boolean;
|
|
123
|
+
value: string;
|
|
124
|
+
placeholder: string;
|
|
125
125
|
readonly: boolean;
|
|
126
126
|
inputClass: string;
|
|
127
127
|
aditionalError: string;
|
|
@@ -65,10 +65,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
65
65
|
"onChange:countryCode"?: ((...args: any[]) => any) | undefined;
|
|
66
66
|
"onChange:mobile"?: ((...args: any[]) => any) | undefined;
|
|
67
67
|
}>, {
|
|
68
|
-
label: string;
|
|
69
68
|
description: string;
|
|
70
|
-
|
|
69
|
+
label: string;
|
|
71
70
|
loading: boolean;
|
|
71
|
+
disabled: boolean;
|
|
72
72
|
options: unknown[];
|
|
73
73
|
countryCodeName: string;
|
|
74
74
|
mobileName: string;
|
|
@@ -43,7 +43,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
43
43
|
required: true;
|
|
44
44
|
};
|
|
45
45
|
inputValue: {
|
|
46
|
-
type: (
|
|
46
|
+
type: (BooleanConstructor | StringConstructor | ObjectConstructor)[];
|
|
47
47
|
default: boolean;
|
|
48
48
|
};
|
|
49
49
|
binary: {
|
|
@@ -91,7 +91,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
91
91
|
required: true;
|
|
92
92
|
};
|
|
93
93
|
inputValue: {
|
|
94
|
-
type: (
|
|
94
|
+
type: (BooleanConstructor | StringConstructor | ObjectConstructor)[];
|
|
95
95
|
default: boolean;
|
|
96
96
|
};
|
|
97
97
|
binary: {
|
|
@@ -27,7 +27,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
27
27
|
default: string;
|
|
28
28
|
};
|
|
29
29
|
}>> & Readonly<{}>, {
|
|
30
|
-
label: string;
|
|
31
30
|
description: string;
|
|
31
|
+
label: string;
|
|
32
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
33
33
|
//# sourceMappingURL=field-switch.vue.d.ts.map
|
|
@@ -109,8 +109,8 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
109
109
|
}>> & Readonly<{
|
|
110
110
|
onOnSwitchChange?: ((...args: any[]) => any) | undefined;
|
|
111
111
|
}>, {
|
|
112
|
-
value: boolean;
|
|
113
112
|
disabled: boolean;
|
|
113
|
+
value: boolean;
|
|
114
114
|
readonly: boolean;
|
|
115
115
|
auto: boolean;
|
|
116
116
|
isCard: boolean;
|
|
@@ -93,11 +93,11 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
93
93
|
onInput?: ((...args: any[]) => any) | undefined;
|
|
94
94
|
onBlur?: ((...args: any[]) => any) | undefined;
|
|
95
95
|
}>, {
|
|
96
|
-
value: string;
|
|
97
|
-
label: string;
|
|
98
|
-
placeholder: string;
|
|
99
96
|
description: string;
|
|
97
|
+
label: string;
|
|
100
98
|
disabled: boolean;
|
|
99
|
+
value: string;
|
|
100
|
+
placeholder: string;
|
|
101
101
|
readonly: boolean;
|
|
102
102
|
aditionalError: string;
|
|
103
103
|
sensitive: boolean;
|
|
@@ -123,12 +123,12 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
123
123
|
onInput?: ((...args: any[]) => any) | undefined;
|
|
124
124
|
onBlur?: ((...args: any[]) => any) | undefined;
|
|
125
125
|
}>, {
|
|
126
|
-
value: string;
|
|
127
|
-
placeholder: string;
|
|
128
126
|
description: string;
|
|
129
|
-
disabled: boolean;
|
|
130
127
|
icon: string;
|
|
131
128
|
loading: boolean;
|
|
129
|
+
disabled: boolean;
|
|
130
|
+
value: string;
|
|
131
|
+
placeholder: string;
|
|
132
132
|
aditionalError: string;
|
|
133
133
|
sensitive: boolean;
|
|
134
134
|
rows: string | number;
|
|
@@ -87,13 +87,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
87
87
|
}>> & Readonly<{
|
|
88
88
|
"onClick-icon"?: ((...args: any[]) => any) | undefined;
|
|
89
89
|
}>, {
|
|
90
|
-
value: string;
|
|
91
|
-
label: string;
|
|
92
|
-
placeholder: string;
|
|
93
90
|
description: string;
|
|
91
|
+
label: string;
|
|
92
|
+
icon: string;
|
|
94
93
|
disabled: boolean;
|
|
94
|
+
value: string;
|
|
95
|
+
placeholder: string;
|
|
95
96
|
readonly: boolean;
|
|
96
|
-
icon: string;
|
|
97
97
|
required: boolean;
|
|
98
98
|
iconPosition: string;
|
|
99
99
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -93,11 +93,11 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
93
93
|
onInput?: ((...args: any[]) => any) | undefined;
|
|
94
94
|
onBlur?: ((...args: any[]) => any) | undefined;
|
|
95
95
|
}>, {
|
|
96
|
-
value: string;
|
|
97
|
-
label: string;
|
|
98
|
-
placeholder: string;
|
|
99
96
|
description: string;
|
|
97
|
+
label: string;
|
|
100
98
|
disabled: boolean;
|
|
99
|
+
value: string;
|
|
100
|
+
placeholder: string;
|
|
101
101
|
readonly: boolean;
|
|
102
102
|
aditionalError: string;
|
|
103
103
|
sensitive: boolean;
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref, toRef, useAttrs, useSlots } from 'vue'
|
|
3
|
+
import { useField } from 'vee-validate'
|
|
4
|
+
import InputText from 'primevue/inputtext'
|
|
5
|
+
import LabelBlock from '../label'
|
|
6
|
+
|
|
7
|
+
const emit = defineEmits(['blur', 'input', 'update:isPublic'])
|
|
8
|
+
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
value: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: ''
|
|
13
|
+
},
|
|
14
|
+
class: {
|
|
15
|
+
type: String
|
|
16
|
+
},
|
|
17
|
+
name: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
label: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: ''
|
|
24
|
+
},
|
|
25
|
+
placeholder: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ''
|
|
28
|
+
},
|
|
29
|
+
description: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ''
|
|
32
|
+
},
|
|
33
|
+
disabled: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false
|
|
36
|
+
},
|
|
37
|
+
readonly: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false
|
|
40
|
+
},
|
|
41
|
+
sensitive: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false
|
|
44
|
+
},
|
|
45
|
+
aditionalError: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: ''
|
|
48
|
+
},
|
|
49
|
+
isPublic: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const inputRef = ref(null)
|
|
56
|
+
const name = toRef(props, 'name')
|
|
57
|
+
const slots = useSlots()
|
|
58
|
+
const attrs = useAttrs()
|
|
59
|
+
const hasDescriptionSlot = !!slots.description
|
|
60
|
+
|
|
61
|
+
const isFocused = ref(false)
|
|
62
|
+
const isHovered = ref(false)
|
|
63
|
+
|
|
64
|
+
const customTestId = computed(() => {
|
|
65
|
+
const id = attrs['data-testid'] || 'field-text-privacy'
|
|
66
|
+
return {
|
|
67
|
+
label: `${id}__label`,
|
|
68
|
+
input: `${id}__input`,
|
|
69
|
+
description: `${id}__description`,
|
|
70
|
+
error: `${id}__error-message`,
|
|
71
|
+
privacySwitch: `${id}__privacy-switch`
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const groupBorderClass = computed(() => {
|
|
76
|
+
if (aditionalError.value || veeValidateErrorMessage.value) return '!border-red-500'
|
|
77
|
+
if (isFocused.value || isHovered.value) return '!border-[#f3652b]'
|
|
78
|
+
return ''
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
const groupShadowClass = computed(() => {
|
|
82
|
+
if (isFocused.value || isHovered.value) {
|
|
83
|
+
const color = aditionalError.value || veeValidateErrorMessage.value ? '#ef4444' : '#f3652b'
|
|
84
|
+
return `shadow-[0_0_0_1px_${color}]`
|
|
85
|
+
}
|
|
86
|
+
return ''
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
const {
|
|
90
|
+
value: inputValue,
|
|
91
|
+
errorMessage: veeValidateErrorMessage,
|
|
92
|
+
handleBlur,
|
|
93
|
+
handleChange
|
|
94
|
+
} = useField(name, undefined, {
|
|
95
|
+
initialValue: props.value
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
const aditionalError = computed(() => props.aditionalError)
|
|
99
|
+
|
|
100
|
+
const onBlur = (event) => {
|
|
101
|
+
handleBlur(event)
|
|
102
|
+
emit('blur', event)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const onChange = (event) => {
|
|
106
|
+
handleChange(event)
|
|
107
|
+
emit('input', event.target.value)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const togglePrivacy = () => {
|
|
111
|
+
if (props.disabled || props.readonly) return
|
|
112
|
+
emit('update:isPublic', !props.isPublic)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const onGroupFocusIn = () => {
|
|
116
|
+
isFocused.value = true
|
|
117
|
+
}
|
|
118
|
+
const onGroupFocusOut = (event) => {
|
|
119
|
+
if (!event.currentTarget.contains(event.relatedTarget)) {
|
|
120
|
+
isFocused.value = false
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
const onGroupMouseEnter = () => {
|
|
124
|
+
isHovered.value = true
|
|
125
|
+
}
|
|
126
|
+
const onGroupMouseLeave = () => {
|
|
127
|
+
isHovered.value = false
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
defineExpose({ inputRef })
|
|
131
|
+
</script>
|
|
132
|
+
|
|
133
|
+
<template>
|
|
134
|
+
<LabelBlock
|
|
135
|
+
v-if="props.label"
|
|
136
|
+
:for="props.name"
|
|
137
|
+
:data-testid="customTestId.label"
|
|
138
|
+
:label="props.label"
|
|
139
|
+
:isRequired="attrs.required"
|
|
140
|
+
/>
|
|
141
|
+
|
|
142
|
+
<div
|
|
143
|
+
class="p-inputgroup rounded transition-shadow duration-150"
|
|
144
|
+
:class="[groupShadowClass, disabled ? 'opacity-50 pointer-events-none' : '']"
|
|
145
|
+
@focusin="onGroupFocusIn"
|
|
146
|
+
@focusout="onGroupFocusOut"
|
|
147
|
+
@mouseenter="onGroupMouseEnter"
|
|
148
|
+
@mouseleave="onGroupMouseLeave"
|
|
149
|
+
>
|
|
150
|
+
<InputText
|
|
151
|
+
v-bind="sensitive ? { 'data-sentry-mask': '' } : {}"
|
|
152
|
+
v-model="inputValue"
|
|
153
|
+
ref="inputRef"
|
|
154
|
+
type="text"
|
|
155
|
+
:data-testid="customTestId.input"
|
|
156
|
+
:id="name"
|
|
157
|
+
:name="name"
|
|
158
|
+
:readonly="readonly"
|
|
159
|
+
:disabled="disabled"
|
|
160
|
+
:placeholder="props.placeholder"
|
|
161
|
+
:class="[
|
|
162
|
+
'!border-r-0 !outline-none !shadow-none transition-colors duration-150',
|
|
163
|
+
groupBorderClass,
|
|
164
|
+
{ 'p-invalid': aditionalError || veeValidateErrorMessage },
|
|
165
|
+
props.class
|
|
166
|
+
]"
|
|
167
|
+
@input="onChange"
|
|
168
|
+
@keypress.enter.prevent
|
|
169
|
+
@blur="onBlur"
|
|
170
|
+
/>
|
|
171
|
+
|
|
172
|
+
<span
|
|
173
|
+
:data-testid="customTestId.privacySwitch"
|
|
174
|
+
:title="isPublic ? 'Public – click to make private' : 'Private – click to make public'"
|
|
175
|
+
:aria-label="
|
|
176
|
+
isPublic
|
|
177
|
+
? 'Field is public. Click to make private.'
|
|
178
|
+
: 'Field is private. Click to make public.'
|
|
179
|
+
"
|
|
180
|
+
:aria-pressed="isPublic"
|
|
181
|
+
role="switch"
|
|
182
|
+
tabindex="0"
|
|
183
|
+
class="p-inputgroup-addon !bg-[var(--input-bg,var(--surface-0))] !border-l-0 cursor-pointer outline-none transition-colors duration-150 select-none"
|
|
184
|
+
:class="[
|
|
185
|
+
groupBorderClass,
|
|
186
|
+
{ 'opacity-50 cursor-not-allowed pointer-events-none': disabled || readonly }
|
|
187
|
+
]"
|
|
188
|
+
@click="togglePrivacy"
|
|
189
|
+
@keydown.enter.prevent="togglePrivacy"
|
|
190
|
+
@keydown.space.prevent="togglePrivacy"
|
|
191
|
+
>
|
|
192
|
+
<span
|
|
193
|
+
class="relative w-9 h-5 rounded-full transition-colors duration-200"
|
|
194
|
+
:class="
|
|
195
|
+
isPublic
|
|
196
|
+
? 'bg-[#f3652b] hover:bg-[#d95522]'
|
|
197
|
+
: 'bg-[var(--input-switch-slider-off-bg)] hover:bg-[var(--input-switch-slider-off-hover-bg)]'
|
|
198
|
+
"
|
|
199
|
+
>
|
|
200
|
+
<span
|
|
201
|
+
class="absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white flex items-center justify-center shadow-sm transition-transform duration-200"
|
|
202
|
+
:class="isPublic ? 'translate-x-4' : 'translate-x-0'"
|
|
203
|
+
>
|
|
204
|
+
<span class="relative w-3 h-3">
|
|
205
|
+
<svg
|
|
206
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
207
|
+
width="12"
|
|
208
|
+
height="12"
|
|
209
|
+
viewBox="0 0 24 24"
|
|
210
|
+
fill="none"
|
|
211
|
+
stroke="currentColor"
|
|
212
|
+
stroke-width="2.5"
|
|
213
|
+
stroke-linecap="round"
|
|
214
|
+
stroke-linejoin="round"
|
|
215
|
+
aria-hidden="true"
|
|
216
|
+
class="absolute inset-0 transition-all duration-200 text-gray-500"
|
|
217
|
+
:class="isPublic ? 'opacity-0 scale-75' : 'opacity-100 scale-100'"
|
|
218
|
+
>
|
|
219
|
+
<rect
|
|
220
|
+
x="3"
|
|
221
|
+
y="11"
|
|
222
|
+
width="18"
|
|
223
|
+
height="11"
|
|
224
|
+
rx="2"
|
|
225
|
+
ry="2"
|
|
226
|
+
/>
|
|
227
|
+
<path d="M7 11V7a5 5 0 0 1 10 0v4" />
|
|
228
|
+
</svg>
|
|
229
|
+
|
|
230
|
+
<svg
|
|
231
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
232
|
+
width="12"
|
|
233
|
+
height="12"
|
|
234
|
+
viewBox="0 0 24 24"
|
|
235
|
+
fill="none"
|
|
236
|
+
stroke="currentColor"
|
|
237
|
+
stroke-width="2.5"
|
|
238
|
+
stroke-linecap="round"
|
|
239
|
+
stroke-linejoin="round"
|
|
240
|
+
aria-hidden="true"
|
|
241
|
+
class="absolute inset-0 transition-all duration-200 text-orange-700"
|
|
242
|
+
:class="isPublic ? 'opacity-100 scale-100' : 'opacity-0 scale-75'"
|
|
243
|
+
>
|
|
244
|
+
<rect
|
|
245
|
+
x="3"
|
|
246
|
+
y="11"
|
|
247
|
+
width="18"
|
|
248
|
+
height="11"
|
|
249
|
+
rx="2"
|
|
250
|
+
ry="2"
|
|
251
|
+
/>
|
|
252
|
+
<path d="M7 11V7a5 5 0 0 1 9.9-1" />
|
|
253
|
+
</svg>
|
|
254
|
+
</span>
|
|
255
|
+
</span>
|
|
256
|
+
</span>
|
|
257
|
+
</span>
|
|
258
|
+
</div>
|
|
259
|
+
|
|
260
|
+
<small
|
|
261
|
+
v-if="aditionalError || veeValidateErrorMessage"
|
|
262
|
+
class="p-error text-xs font-normal leading-tight"
|
|
263
|
+
:data-testid="customTestId.error"
|
|
264
|
+
>
|
|
265
|
+
{{ aditionalError || veeValidateErrorMessage }}
|
|
266
|
+
</small>
|
|
267
|
+
|
|
268
|
+
<small
|
|
269
|
+
v-if="props.description || hasDescriptionSlot"
|
|
270
|
+
class="text-xs text-color-secondary font-normal leading-5"
|
|
271
|
+
:data-testid="customTestId.description"
|
|
272
|
+
>
|
|
273
|
+
<slot name="description">
|
|
274
|
+
{{ props.description }}
|
|
275
|
+
</slot>
|
|
276
|
+
</small>
|
|
277
|
+
</template>
|
|
278
|
+
|
|
279
|
+
<style scoped>
|
|
280
|
+
:deep(.p-inputtext:focus) {
|
|
281
|
+
outline: none !important;
|
|
282
|
+
box-shadow: none !important;
|
|
283
|
+
}
|
|
284
|
+
</style>
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
4
|
+
type __VLS_WithSlots<T, S> = T & (new () => {
|
|
5
|
+
$slots: S;
|
|
6
|
+
});
|
|
7
|
+
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
|
+
value: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
class: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
};
|
|
15
|
+
name: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
label: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
placeholder: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
description: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
disabled: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
35
|
+
readonly: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
default: boolean;
|
|
38
|
+
};
|
|
39
|
+
sensitive: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
default: boolean;
|
|
42
|
+
};
|
|
43
|
+
aditionalError: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
default: string;
|
|
46
|
+
};
|
|
47
|
+
isPublic: {
|
|
48
|
+
type: BooleanConstructor;
|
|
49
|
+
default: boolean;
|
|
50
|
+
};
|
|
51
|
+
}>, {
|
|
52
|
+
inputRef: import("vue").Ref<null, null>;
|
|
53
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
54
|
+
input: (...args: any[]) => void;
|
|
55
|
+
blur: (...args: any[]) => void;
|
|
56
|
+
"update:isPublic": (...args: any[]) => void;
|
|
57
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
58
|
+
value: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
default: string;
|
|
61
|
+
};
|
|
62
|
+
class: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
};
|
|
65
|
+
name: {
|
|
66
|
+
type: StringConstructor;
|
|
67
|
+
required: true;
|
|
68
|
+
};
|
|
69
|
+
label: {
|
|
70
|
+
type: StringConstructor;
|
|
71
|
+
default: string;
|
|
72
|
+
};
|
|
73
|
+
placeholder: {
|
|
74
|
+
type: StringConstructor;
|
|
75
|
+
default: string;
|
|
76
|
+
};
|
|
77
|
+
description: {
|
|
78
|
+
type: StringConstructor;
|
|
79
|
+
default: string;
|
|
80
|
+
};
|
|
81
|
+
disabled: {
|
|
82
|
+
type: BooleanConstructor;
|
|
83
|
+
default: boolean;
|
|
84
|
+
};
|
|
85
|
+
readonly: {
|
|
86
|
+
type: BooleanConstructor;
|
|
87
|
+
default: boolean;
|
|
88
|
+
};
|
|
89
|
+
sensitive: {
|
|
90
|
+
type: BooleanConstructor;
|
|
91
|
+
default: boolean;
|
|
92
|
+
};
|
|
93
|
+
aditionalError: {
|
|
94
|
+
type: StringConstructor;
|
|
95
|
+
default: string;
|
|
96
|
+
};
|
|
97
|
+
isPublic: {
|
|
98
|
+
type: BooleanConstructor;
|
|
99
|
+
default: boolean;
|
|
100
|
+
};
|
|
101
|
+
}>> & Readonly<{
|
|
102
|
+
onInput?: ((...args: any[]) => any) | undefined;
|
|
103
|
+
onBlur?: ((...args: any[]) => any) | undefined;
|
|
104
|
+
"onUpdate:isPublic"?: ((...args: any[]) => any) | undefined;
|
|
105
|
+
}>, {
|
|
106
|
+
description: string;
|
|
107
|
+
label: string;
|
|
108
|
+
disabled: boolean;
|
|
109
|
+
value: string;
|
|
110
|
+
placeholder: string;
|
|
111
|
+
readonly: boolean;
|
|
112
|
+
aditionalError: string;
|
|
113
|
+
sensitive: boolean;
|
|
114
|
+
isPublic: boolean;
|
|
115
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
116
|
+
type __VLS_Slots = {
|
|
117
|
+
description?: ((props: {}) => any) | undefined;
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=field-text-privacy.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-text-privacy.vue.d.ts","sourceRoot":"","sources":["field-text-privacy.vue"],"names":[],"mappings":"wBAuvBqB,OAAO,YAAY;;AADxC,4BAA2B,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;qBAEtD,CAAC,EAAE,CAAC;;;AAnDzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EAgDG"}
|