@espri/vue-components 2.0.4 → 2.1.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/README.md CHANGED
@@ -25,6 +25,7 @@ import EspriInputNumber from '@espri/vue-components/input-number';
25
25
  ### Inputs
26
26
 
27
27
  - `EspriInputNumber`
28
+ - `EspriInputPassword`
28
29
  - `EspriInputText`
29
30
  - `EspriSelect`
30
31
 
package/dist/index.es.js CHANGED
@@ -1,10 +1,12 @@
1
- import { default as t } from "./input-number.es.js";
2
- import { default as p } from "./input-text.es.js";
3
- import { default as f } from "./select.es.js";
4
- import { default as u } from "./virtual-keyboard.es.js";
1
+ import { default as e } from "./input-number.es.js";
2
+ import { default as p } from "./input-password.es.js";
3
+ import { default as s } from "./input-text.es.js";
4
+ import { default as u } from "./select.es.js";
5
+ import { default as l } from "./virtual-keyboard.es.js";
5
6
  export {
6
- t as EspriInputNumber,
7
- p as EspriInputText,
8
- f as EspriSelect,
9
- u as EspriVirtualKeyboard
7
+ e as EspriInputNumber,
8
+ p as EspriInputPassword,
9
+ s as EspriInputText,
10
+ u as EspriSelect,
11
+ l as EspriVirtualKeyboard
10
12
  };
@@ -0,0 +1 @@
1
+ .error[data-v-e3a9900a]{color:var(--p-floatlabel-invalid-color, var(--p-red-600))}
@@ -0,0 +1,68 @@
1
+ import { defineComponent as k, computed as r, openBlock as o, createElementBlock as i, normalizeClass as p, createBlock as c, unref as a, withCtx as y, createVNode as w, createElementVNode as u, createTextVNode as V, toDisplayString as m, createCommentVNode as v } from "vue";
2
+ import { Skeleton as B, FloatLabel as b, Password as x } from "primevue";
3
+ import { _ as C } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
4
+ import './input-password.css';const P = ["for"], E = { key: 0 }, N = { class: "error" }, $ = /* @__PURE__ */ k({
5
+ __name: "input-password",
6
+ props: {
7
+ label: {},
8
+ modelValue: {},
9
+ class: {},
10
+ inputClass: {},
11
+ disabled: { type: Boolean },
12
+ required: { type: Boolean },
13
+ loading: { type: Boolean },
14
+ showError: { type: Boolean },
15
+ rules: {},
16
+ maxlength: {},
17
+ placeholder: {},
18
+ displayPasswordFeedBack: { type: Boolean },
19
+ displayPasswordToggle: { type: Boolean }
20
+ },
21
+ emits: ["update:modelValue"],
22
+ setup(g, { emit: f }) {
23
+ const e = g, _ = f, t = Math.random().toString(16).slice(2), d = r({
24
+ get() {
25
+ return e.modelValue;
26
+ },
27
+ set(s) {
28
+ _("update:modelValue", s);
29
+ }
30
+ }), n = r(() => e.showError && e.rules?.find((l) => l?.$invalid && l?.$message)?.$message || "");
31
+ return (s, l) => (o(), i("div", {
32
+ class: p(`field ${e.class || ""}`)
33
+ }, [
34
+ e.loading ? (o(), c(a(B), {
35
+ key: 0,
36
+ class: "skeleton-input mt-3"
37
+ })) : (o(), c(a(b), {
38
+ key: 1,
39
+ class: "mt-3"
40
+ }, {
41
+ default: y(() => [
42
+ w(a(x), {
43
+ modelValue: d.value,
44
+ "onUpdate:modelValue": l[0] || (l[0] = (h) => d.value = h),
45
+ class: p(["w-full", e.class]),
46
+ "input-class": e.inputClass,
47
+ invalid: !!n.value,
48
+ maxlength: e.maxlength,
49
+ feedback: e.displayPasswordFeedBack,
50
+ "toggle-mask": e.displayPasswordToggle,
51
+ disabled: e.disabled,
52
+ placeholder: e.placeholder,
53
+ "input-id": a(t)
54
+ }, null, 8, ["modelValue", "class", "input-class", "invalid", "maxlength", "feedback", "toggle-mask", "disabled", "placeholder", "input-id"]),
55
+ u("label", { for: a(t) }, [
56
+ V(m(e.label), 1),
57
+ e.required ? (o(), i("span", E, " *")) : v("", !0)
58
+ ], 8, P)
59
+ ]),
60
+ _: 1
61
+ })),
62
+ u("small", N, m(n.value), 1)
63
+ ], 2));
64
+ }
65
+ }), F = /* @__PURE__ */ C($, [["__scopeId", "data-v-e3a9900a"]]), q = F;
66
+ export {
67
+ q as default
68
+ };
@@ -1,5 +1,6 @@
1
1
  import EspriInputNumber from './input-number';
2
+ import EspriInputPassword from './input-password';
2
3
  import EspriInputText from './input-text';
3
4
  import EspriSelect from './select';
4
5
  import EspriVirtualKeyboard from './virtual-keyboard';
5
- export { EspriInputNumber, EspriInputText, EspriSelect, EspriVirtualKeyboard, };
6
+ export { EspriInputNumber, EspriInputPassword, EspriInputText, EspriSelect, EspriVirtualKeyboard, };
@@ -0,0 +1,19 @@
1
+ import type { DefineComponent } from 'vue';
2
+ import type EspriInputPasswordEmits from './interfaces/input-password-emits.interface';
3
+ import type { EspriInputPasswordEmitsForDoc } from './interfaces/input-password-emits.interface';
4
+ import type EspriInputPasswordProps from './interfaces/input-password-props.interface';
5
+ /**
6
+ * **ESPRI Digital - Input Password (Vue component)**
7
+ * --- ---
8
+ * ![ESPRIDigital](https://espridigital.fr/wp-content/uploads/2024/09/logo_espri_digital_white-100-1.png)
9
+ *
10
+ */
11
+ declare const EspriInputPassword: DefineComponent<EspriInputPasswordProps, {}, // For slots if any
12
+ {}, // For methods or data if any
13
+ {}, // Computed
14
+ {}, // Methods
15
+ {}, // Mixin
16
+ {}, // Extends
17
+ EspriInputPasswordEmitsForDoc>;
18
+ export default EspriInputPassword;
19
+ export type { EspriInputPasswordEmits, EspriInputPasswordProps };
@@ -0,0 +1,10 @@
1
+ import type { ObjectEmitsOptions } from 'vue';
2
+ export default interface EspriInputPasswordEmits {
3
+ (e: 'update:modelValue', value: any): void;
4
+ }
5
+ export interface EspriInputPasswordEmitsForDoc extends ObjectEmitsOptions {
6
+ /**
7
+ * Called when modelValue is updated.
8
+ */
9
+ 'update:modelValue': (value: any) => void;
10
+ }
@@ -0,0 +1,60 @@
1
+ export default interface EspriInputPasswordProps {
2
+ /**
3
+ * Label displayed above the input.
4
+ */
5
+ label: string;
6
+ /**
7
+ * Model value representing the current state of the input.
8
+ */
9
+ modelValue: string | null;
10
+ /**
11
+ * Class of the component.
12
+ */
13
+ class?: any;
14
+ /**
15
+ * Optional CSS class applied to the input element.
16
+ */
17
+ inputClass?: string;
18
+ /**
19
+ * Disables the input when true.
20
+ */
21
+ disabled?: boolean;
22
+ /**
23
+ * Marks the input as required when true.
24
+ */
25
+ required?: boolean;
26
+ /**
27
+ * Indicates if the input is in a loading state.
28
+ */
29
+ loading: boolean;
30
+ /**
31
+ * Shows error messages when true.
32
+ */
33
+ showError?: boolean;
34
+ /**
35
+ * Validation rules for the input.
36
+ * Each rule can be undefined or an object containing:
37
+ * - $invalid: whether the rule is violated
38
+ * - $message: the error message associated with the rule
39
+ */
40
+ rules?: Array<{
41
+ $invalid: boolean;
42
+ $message: string;
43
+ } | undefined>;
44
+ /**
45
+ * Maximum number of characters allowed in the input.
46
+ */
47
+ maxlength?: number;
48
+ /**
49
+ * Placeholder text displayed inside the input.
50
+ */
51
+ placeholder?: string;
52
+ /**
53
+ * Whether to display feedback for the password field (e.g., strength meter).
54
+ */
55
+ displayPasswordFeedBack?: boolean;
56
+ /**
57
+ * Whether to display a toggle for showing/hiding the password.
58
+ */
59
+ displayPasswordToggle?: boolean;
60
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@espri/vue-components",
3
- "version": "2.0.4",
3
+ "version": "2.1.0",
4
4
  "description": "ESPRI Digital - Vue components library",
5
5
  "author": "ESPRI Digital",
6
6
  "homepage": "https://github.com/ESPRI-Digital/vue-select#readme",
@@ -16,6 +16,10 @@
16
16
  "types": "./dist/types/input-number/index.d.ts",
17
17
  "import": "./dist/input-number.es.js"
18
18
  },
19
+ "./input-password": {
20
+ "types": "./dist/types/input-password/index.d.ts",
21
+ "import": "./dist/input-password.es.js"
22
+ },
19
23
  "./input-text": {
20
24
  "types": "./dist/types/input-text/index.d.ts",
21
25
  "import": "./dist/input-text.es.js"