@quidgest/ui 0.15.4 → 0.15.7

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.
@@ -1,8 +1,8 @@
1
- import { defineComponent as b, mergeModels as h, useModel as z, computed as o, ref as g, createBlock as x, openBlock as w, unref as s, normalizeClass as q, createSlots as $, withCtx as a, withDirectives as v, createElementVNode as B, mergeProps as k, toHandlers as M, vModelText as V, renderSlot as r } from "vue";
2
- import { QField as L } from "../QField/index.js";
3
- import { useId as A } from "../../composables/uid.js";
4
- import { useTextareaAutosize as C } from "../../vendors/@vueuse/core/index.js";
5
- const H = ["id", "required", "placeholder", "readonly", "disabled", "maxlength", "rows", "cols", "resize", "wrap"], Q = /* @__PURE__ */ b({
1
+ import { defineComponent as b, mergeModels as h, useModel as z, computed as t, watch as x, ref as g, createBlock as w, openBlock as q, unref as n, normalizeClass as $, createSlots as v, withCtx as a, withDirectives as B, createElementVNode as k, mergeProps as M, toHandlers as V, vModelText as A, renderSlot as o } from "vue";
2
+ import { QField as C } from "../QField/index.js";
3
+ import { useId as H } from "../../composables/uid.js";
4
+ import { useTextareaAutosize as L } from "../../vendors/@vueuse/core/index.js";
5
+ const R = ["id", "required", "placeholder", "readonly", "disabled", "maxlength", "rows", "cols", "resize", "wrap"], S = /* @__PURE__ */ b({
6
6
  inheritAttrs: !1,
7
7
  __name: "QTextArea",
8
8
  props: /* @__PURE__ */ h({
@@ -27,39 +27,42 @@ const H = ["id", "required", "placeholder", "readonly", "disabled", "maxlength",
27
27
  modelModifiers: {}
28
28
  }),
29
29
  emits: ["update:modelValue"],
30
- setup(t) {
31
- const e = t, d = z(t, "modelValue"), n = A(e.id), m = o(
32
- () => e.readonly || e.disabled ? void 0 : e.placeholder
33
- ), f = o(() => ({ input: e.autosize ? c : null })), i = g(), { triggerResize: c } = C({
34
- element: o(() => e.autosize ? i.value : void 0),
35
- styleProp: "minHeight"
36
- }), p = o({
37
- get: () => d.value,
30
+ setup(i) {
31
+ const e = i, s = z(i, "modelValue"), d = t({
32
+ get: () => s.value,
38
33
  set: (l) => {
39
- d.value = e.maxLength ? l == null ? void 0 : l.slice(0, e.maxLength) : l;
34
+ const r = e.maxLength;
35
+ s.value = r ? l == null ? void 0 : l.slice(0, r) : l;
40
36
  }
41
37
  });
42
- return (l, u) => (w(), x(s(L), {
43
- class: q(["q-text-area", e.class]),
44
- for: s(n),
38
+ x(s, (l) => d.value = l, { immediate: !0 });
39
+ const p = H(e.id), m = t(
40
+ () => e.readonly || e.disabled ? void 0 : e.placeholder
41
+ ), f = t(() => ({ input: e.autosize ? c : null })), u = g(), { triggerResize: c } = L({
42
+ element: t(() => e.autosize ? u.value : void 0),
43
+ styleProp: "minHeight"
44
+ });
45
+ return (l, r) => (q(), w(n(C), {
46
+ class: $(["q-text-area", e.class]),
47
+ for: n(p),
45
48
  label: e.label,
46
49
  size: e.size,
47
50
  readonly: e.readonly,
48
51
  disabled: e.disabled,
49
52
  required: e.required
50
- }, $({
53
+ }, v({
51
54
  "label.prepend": a(() => [
52
- r(l.$slots, "label.prepend")
55
+ o(l.$slots, "label.prepend")
53
56
  ]),
54
57
  "label.append": a(() => [
55
- r(l.$slots, "label.append")
58
+ o(l.$slots, "label.append")
56
59
  ]),
57
60
  default: a(() => [
58
- v(B("textarea", k({
59
- id: s(n),
61
+ B(k("textarea", M({
62
+ id: n(p),
60
63
  ref_key: "textareaRef",
61
- ref: i,
62
- "onUpdate:modelValue": u[0] || (u[0] = (y) => p.value = y),
64
+ ref: u,
65
+ "onUpdate:modelValue": r[0] || (r[0] = (y) => d.value = y),
63
66
  class: "q-text-area__input",
64
67
  required: e.required,
65
68
  placeholder: m.value,
@@ -70,8 +73,8 @@ const H = ["id", "required", "placeholder", "readonly", "disabled", "maxlength",
70
73
  cols: e.cols,
71
74
  resize: e.resize,
72
75
  wrap: e.wrap
73
- }, l.$attrs, M(f.value, !0)), null, 16, H), [
74
- [V, p.value]
76
+ }, l.$attrs, V(f.value, !0)), null, 16, R), [
77
+ [A, d.value]
75
78
  ])
76
79
  ]),
77
80
  _: 2
@@ -80,21 +83,21 @@ const H = ["id", "required", "placeholder", "readonly", "disabled", "maxlength",
80
83
  l.$slots.prepend ? {
81
84
  name: "prepend",
82
85
  fn: a(() => [
83
- r(l.$slots, "prepend")
86
+ o(l.$slots, "prepend")
84
87
  ]),
85
88
  key: "0"
86
89
  } : void 0,
87
90
  l.$slots.append ? {
88
91
  name: "append",
89
92
  fn: a(() => [
90
- r(l.$slots, "append")
93
+ o(l.$slots, "append")
91
94
  ]),
92
95
  key: "1"
93
96
  } : void 0,
94
97
  l.$slots.extras ? {
95
98
  name: "extras",
96
99
  fn: a(() => [
97
- r(l.$slots, "extras")
100
+ o(l.$slots, "extras")
98
101
  ]),
99
102
  key: "2"
100
103
  } : void 0
@@ -102,5 +105,5 @@ const H = ["id", "required", "placeholder", "readonly", "disabled", "maxlength",
102
105
  }
103
106
  });
104
107
  export {
105
- Q as default
108
+ S as default
106
109
  };
@@ -1 +1 @@
1
- {"version":3,"file":"QTextField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QTextField/QTextField.vue"],"names":[],"mappings":"AAmDA;AAmHC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAM9C,KAAK,WAAW,GAAG,eAAe,CAAC;AAwDpC,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WAkIT,OAAO,IAA6B;;iCAjBb,GAAG;gCACJ,GAAG;yBACV,GAAG;wBACH,GAAG;wBACH,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAqEole,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;EAnDzue;AAmBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;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AAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,11 +1,11 @@
1
- import { defineComponent as x, mergeModels as m, useModel as R, ref as y, computed as o, createBlock as b, openBlock as v, unref as r, normalizeClass as V, createSlots as z, withCtx as a, withDirectives as M, createElementVNode as w, mergeProps as Q, vModelDynamic as g, renderSlot as d, createCommentVNode as D } from "vue";
2
- import { QField as F } from "../QField/index.js";
3
- import { QClearButton as N } from "../__internal__/QClearButton/index.js";
4
- import { useId as S } from "../../composables/uid.js";
5
- const _ = ["id", "type", "required", "placeholder", "readonly", "disabled"], T = /* @__PURE__ */ x({
1
+ import { defineComponent as C, mergeModels as y, useModel as R, computed as n, watch as V, ref as b, createBlock as h, openBlock as v, unref as r, normalizeClass as z, createSlots as M, withCtx as a, withDirectives as w, createElementVNode as L, mergeProps as Q, vModelDynamic as D, renderSlot as o, createCommentVNode as F } from "vue";
2
+ import { QField as N } from "../QField/index.js";
3
+ import { QClearButton as S } from "../__internal__/QClearButton/index.js";
4
+ import { useId as _ } from "../../composables/uid.js";
5
+ const A = ["id", "type", "maxlength", "required", "placeholder", "readonly", "disabled"], U = /* @__PURE__ */ C({
6
6
  inheritAttrs: !1,
7
7
  __name: "QTextField",
8
- props: /* @__PURE__ */ m({
8
+ props: /* @__PURE__ */ y({
9
9
  id: {},
10
10
  class: {},
11
11
  label: {},
@@ -16,6 +16,7 @@ const _ = ["id", "type", "required", "placeholder", "readonly", "disabled"], T =
16
16
  disabled: { type: Boolean },
17
17
  invalid: { type: Boolean },
18
18
  placeholder: {},
19
+ maxLength: {},
19
20
  clearable: { type: Boolean },
20
21
  type: { default: "text" },
21
22
  texts: {}
@@ -23,52 +24,61 @@ const _ = ["id", "type", "required", "placeholder", "readonly", "disabled"], T =
23
24
  modelValue: {},
24
25
  modelModifiers: {}
25
26
  }),
26
- emits: /* @__PURE__ */ m(["click:clear"], ["update:modelValue"]),
27
- setup(n, { expose: k, emit: q }) {
28
- const e = n, h = q, t = R(n, "modelValue"), s = S(e.id), i = y(null), p = y(null), B = o(
27
+ emits: /* @__PURE__ */ y(["click:clear"], ["update:modelValue"]),
28
+ setup(i, { expose: x, emit: k }) {
29
+ const e = i, q = k, t = R(i, "modelValue"), s = n({
30
+ get: () => t.value,
31
+ set: (l) => {
32
+ const d = e.maxLength;
33
+ t.value = d ? l == null ? void 0 : l.slice(0, d) : l;
34
+ }
35
+ });
36
+ V(t, (l) => s.value = l, { immediate: !0 });
37
+ const p = _(e.id), u = b(null), f = b(null), g = n(
29
38
  () => e.readonly || e.disabled ? void 0 : e.placeholder
30
- ), u = o(() => e.clearable && !e.readonly && !e.disabled), f = o(() => u.value && t.value);
31
- function $(l) {
32
- u.value && (t.value = "", h("click:clear", l));
39
+ ), m = n(() => e.clearable && !e.readonly && !e.disabled), c = n(() => m.value && t.value);
40
+ function B(l) {
41
+ m.value && (t.value = "", q("click:clear", l));
33
42
  }
34
- return k({
35
- fieldRef: o(() => {
43
+ return x({
44
+ fieldRef: n(() => {
36
45
  var l;
37
- return (l = i.value) == null ? void 0 : l.fieldRef;
46
+ return (l = u.value) == null ? void 0 : l.fieldRef;
38
47
  }),
39
- inputRef: p
40
- }), (l, c) => (v(), b(r(F), {
48
+ inputRef: f
49
+ }), (l, d) => (v(), h(r(N), {
41
50
  ref_key: "fieldRef",
42
- ref: i,
43
- class: V(["q-text-field", e.class]),
44
- for: r(s),
51
+ ref: u,
52
+ class: z(["q-text-field", e.class]),
53
+ for: r(p),
45
54
  label: e.label,
46
55
  size: e.size,
47
56
  readonly: e.readonly,
48
57
  disabled: e.disabled,
49
58
  required: e.required,
50
59
  invalid: e.invalid
51
- }, z({
60
+ }, M({
52
61
  "label.prepend": a(() => [
53
- d(l.$slots, "label.prepend")
62
+ o(l.$slots, "label.prepend")
54
63
  ]),
55
64
  "label.append": a(() => [
56
- d(l.$slots, "label.append")
65
+ o(l.$slots, "label.append")
57
66
  ]),
58
67
  default: a(() => [
59
- M(w("input", Q({
60
- id: r(s),
68
+ w(L("input", Q({
69
+ id: r(p),
61
70
  ref_key: "inputRef",
62
- ref: p,
63
- "onUpdate:modelValue": c[0] || (c[0] = (C) => t.value = C),
71
+ ref: f,
72
+ "onUpdate:modelValue": d[0] || (d[0] = ($) => s.value = $),
64
73
  class: "q-text-field__input",
65
74
  type: e.type,
75
+ maxlength: e.maxLength,
66
76
  required: e.required,
67
- placeholder: B.value,
77
+ placeholder: g.value,
68
78
  readonly: e.readonly,
69
79
  disabled: e.disabled
70
- }, l.$attrs), null, 16, _), [
71
- [g, t.value]
80
+ }, l.$attrs), null, 16, A), [
81
+ [D, s.value]
72
82
  ])
73
83
  ]),
74
84
  _: 2
@@ -77,27 +87,27 @@ const _ = ["id", "type", "required", "placeholder", "readonly", "disabled"], T =
77
87
  l.$slots.prepend ? {
78
88
  name: "prepend",
79
89
  fn: a(() => [
80
- d(l.$slots, "prepend")
90
+ o(l.$slots, "prepend")
81
91
  ]),
82
92
  key: "0"
83
93
  } : void 0,
84
- l.$slots.append || f.value ? {
94
+ l.$slots.append || c.value ? {
85
95
  name: "append",
86
96
  fn: a(() => [
87
- d(l.$slots, "append"),
88
- f.value ? (v(), b(r(N), {
97
+ o(l.$slots, "append"),
98
+ c.value ? (v(), h(r(S), {
89
99
  key: 0,
90
100
  "data-testid": "q-text-field__clear-button",
91
101
  texts: e.texts,
92
- onClick: $
93
- }, null, 8, ["texts"])) : D("v-if", !0)
102
+ onClick: B
103
+ }, null, 8, ["texts"])) : F("v-if", !0)
94
104
  ]),
95
105
  key: "1"
96
106
  } : void 0,
97
107
  l.$slots.extras ? {
98
108
  name: "extras",
99
109
  fn: a(() => [
100
- d(l.$slots, "extras")
110
+ o(l.$slots, "extras")
101
111
  ]),
102
112
  key: "2"
103
113
  } : void 0
@@ -105,5 +115,5 @@ const _ = ["id", "type", "required", "placeholder", "readonly", "disabled"], T =
105
115
  }
106
116
  });
107
117
  export {
108
- T as default
118
+ U as default
109
119
  };
@@ -14,6 +14,7 @@ declare const QTextField: {
14
14
  invalid?: boolean;
15
15
  } & {
16
16
  placeholder?: string;
17
+ maxLength?: number;
17
18
  clearable?: boolean;
18
19
  type?: string;
19
20
  texts?: typeof import('./types').DEFAULT_TEXTS;
@@ -121,6 +122,7 @@ declare const QTextField: {
121
122
  invalid?: boolean;
122
123
  } & {
123
124
  placeholder?: string;
125
+ maxLength?: number;
124
126
  clearable?: boolean;
125
127
  type?: string;
126
128
  texts?: typeof import('./types').DEFAULT_TEXTS;
@@ -150,6 +152,7 @@ declare const QTextField: {
150
152
  invalid?: boolean;
151
153
  } & {
152
154
  placeholder?: string;
155
+ maxLength?: number;
153
156
  clearable?: boolean;
154
157
  type?: string;
155
158
  texts?: typeof import('./types').DEFAULT_TEXTS;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QTextField/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAK9C,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAO+ozB,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAPtuzB,CAAA;AAG/C,OAAO,EAAE,UAAU,EAAE,CAAA;AAGrB,YAAY,EAAE,eAAe,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QTextField/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAK9C,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAO+ozB,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAPtuzB,CAAA;AAG/C,OAAO,EAAE,UAAU,EAAE,CAAA;AAGrB,YAAY,EAAE,eAAe,EAAE,CAAA"}
@@ -4,6 +4,11 @@ export type QTextFieldProps = QFieldProps & {
4
4
  * The placeholder text for the text field.
5
5
  */
6
6
  placeholder?: string;
7
+ /**
8
+ * If set, defines the maximum string length
9
+ * that the user can enter into the text area field.
10
+ */
11
+ maxLength?: number;
7
12
  /**
8
13
  * Whether the value of the field can be cleared.
9
14
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/QTextField/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEtD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC3C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;CAC5B,CAAA;AAGD,eAAO,MAAM,aAAa;;CAEQ,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/QTextField/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEtD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC3C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;CAC5B,CAAA;AAGD,eAAO,MAAM,aAAa;;CAEQ,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@quidgest/ui",
3
3
  "description": "Quidgest's UI framework",
4
- "version": "0.15.4",
4
+ "version": "0.15.7",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "author": "Quidgest",