@vue-interface/input-field 1.0.0-beta.0 → 1.0.0-beta.10

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,510 +0,0 @@
1
- import { openBlock as a, createElementBlock as d, normalizeClass as w, normalizeStyle as B, createElementVNode as E, createBlock as O, resolveDynamicComponent as N, createCommentVNode as p, toDisplayString as L, resolveComponent as P, resolveDirective as R, renderSlot as f, withDirectives as H, mergeProps as D, createVNode as M, Transition as Z, withCtx as G } from "vue";
2
- var V = {
3
- props: {
4
- dropShadow: [Boolean, String],
5
- dropShadowableClassPrefix: {
6
- type: String,
7
- default: "drop-shadow"
8
- },
9
- shadow: [Boolean, String],
10
- shadowableClassPrefix: {
11
- type: String,
12
- default: "shadow"
13
- }
14
- },
15
- computed: {
16
- shadowableClass() {
17
- const e = this.dropShadow === !0 ? "" : this.dropShadow && `-${this.dropShadow}`, t = this.shadow === !0 ? "" : this.shadow && `-${this.shadow}`;
18
- return {
19
- [`${this.dropShadowableClassPrefix}${e}`]: !!this.dropShadow,
20
- [`${this.shadowableClassPrefix}${t}`]: !!this.shadow
21
- };
22
- }
23
- }
24
- }, b = function() {
25
- return b = Object.assign || function(t) {
26
- for (var i, s = 1, r = arguments.length; s < r; s++) {
27
- i = arguments[s];
28
- for (var n in i)
29
- Object.prototype.hasOwnProperty.call(i, n) && (t[n] = i[n]);
30
- }
31
- return t;
32
- }, b.apply(this, arguments);
33
- };
34
- function q(e) {
35
- return e.toLowerCase();
36
- }
37
- var W = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g], U = /[^A-Z0-9]+/gi;
38
- function X(e, t) {
39
- t === void 0 && (t = {});
40
- for (var i = t.splitRegexp, s = i === void 0 ? W : i, r = t.stripRegexp, n = r === void 0 ? U : r, u = t.transform, g = u === void 0 ? q : u, o = t.delimiter, S = o === void 0 ? " " : o, l = A(A(e, s, "$1\0$2"), n, "\0"), c = 0, h = l.length; l.charAt(c) === "\0"; )
41
- c++;
42
- for (; l.charAt(h - 1) === "\0"; )
43
- h--;
44
- return l.slice(c, h).split("\0").map(g).join(S);
45
- }
46
- function A(e, t, i) {
47
- return t instanceof RegExp ? e.replace(t, i) : t.reduce(function(s, r) {
48
- return s.replace(r, i);
49
- }, e);
50
- }
51
- function J(e, t) {
52
- return t === void 0 && (t = {}), X(e, b({
53
- delimiter: "."
54
- }, t));
55
- }
56
- function j(e, t) {
57
- return t === void 0 && (t = {}), J(e, b({
58
- delimiter: "-"
59
- }, t));
60
- }
61
- const _ = {};
62
- function m(...e) {
63
- if (!e.length)
64
- return _;
65
- const [t, i] = e;
66
- return typeof t == "string" ? typeof _[t] < "u" ? _[t] : i : Array.isArray(t) ? t.reduce((s, r) => Object.assign(s, {
67
- [r]: _[r]
68
- }), {}) : Object.assign(_, ...e);
69
- }
70
- function $(e, t, i = "-") {
71
- const s = t.toString().replace(new RegExp(`^${e}${i}?`), "");
72
- return [j(s), e].filter((r) => !!r).join(i);
73
- }
74
- function F(e) {
75
- return !Array.isArray(e) && typeof e == "object";
76
- }
77
- function k(e) {
78
- return e === void 0;
79
- }
80
- const K = {
81
- directives: {
82
- bindEvents: {
83
- beforeMount(e, t, i) {
84
- t.instance.bindEvents(e);
85
- }
86
- }
87
- },
88
- mixins: [V],
89
- inheritAttrs: !1,
90
- props: {
91
- activity: {
92
- type: Boolean,
93
- default: !1
94
- },
95
- animated: {
96
- type: Boolean,
97
- default: () => m("animated", !1)
98
- },
99
- nativeEvents: {
100
- type: Array,
101
- default() {
102
- return ["focus", "blur", "change", "click", "keypress", "keyup", "keydown", "progress", "paste"];
103
- }
104
- },
105
- defaultControlClass: {
106
- type: String,
107
- default: () => m("defaultControlClass", "form-control")
108
- },
109
- error: [String, Array, Boolean],
110
- errors: {
111
- type: [Array, Object, Boolean],
112
- default() {
113
- return {};
114
- }
115
- },
116
- feedback: [String, Array],
117
- group: {
118
- type: Boolean,
119
- default: () => m("group", !0)
120
- },
121
- helpText: [Number, String],
122
- hideLabel: Boolean,
123
- indicator: {
124
- type: String,
125
- default: () => m("indicator", "spinner")
126
- },
127
- indicatorSize: String,
128
- inline: Boolean,
129
- invalid: Boolean,
130
- label: [Number, String],
131
- labelClass: {
132
- type: [Object, String],
133
- default: () => m("labelClass", "form-label")
134
- },
135
- modelValue: {
136
- default: void 0
137
- },
138
- pill: Boolean,
139
- plaintext: Boolean,
140
- size: String,
141
- spacing: String,
142
- valid: Boolean
143
- },
144
- data() {
145
- return {
146
- defaultEmpty: !1,
147
- hasChanged: !1,
148
- hasFocus: !1,
149
- isEmpty: !0
150
- };
151
- },
152
- computed: {
153
- id() {
154
- return this.$attrs.id || this.$attrs.name || (Math.random() + 1).toString(36).substring(7);
155
- },
156
- componentName() {
157
- return this.$options.name;
158
- },
159
- controlAttributes() {
160
- return Object.fromEntries(Object.entries(this.$attrs).concat([["id", this.id], ["class", this.controlClasses]]));
161
- },
162
- controlClass() {
163
- return this.defaultControlClass;
164
- },
165
- controlSizeClass() {
166
- return $(this.size, this.controlClass);
167
- },
168
- formGroupClasses() {
169
- return {
170
- [j(this.componentName)]: !!this.componentName,
171
- [this.size && $(this.size, this.componentName)]: !!this.size,
172
- animated: this.animated,
173
- "default-empty": this.defaultEmpty,
174
- "form-group": this.group,
175
- [this.size && $(this.size, "form-group")]: !!this.size,
176
- "has-activity": this.activity,
177
- "has-changed": this.hasChanged,
178
- "has-focus": this.hasFocus,
179
- "has-icon": !!this.$slots.icon,
180
- "is-empty": this.isEmpty,
181
- "is-invalid": !!(this.invalid || this.invalidFeedback),
182
- "is-valid": !!(this.valid || this.validFeedback),
183
- [this.$attrs.class]: !!this.$attrs.class,
184
- [this.$attrs.id]: !!this.$attrs.id
185
- };
186
- },
187
- controlClasses() {
188
- return Object.assign({
189
- [this.controlClass]: !!this.controlClass,
190
- [this.controlSizeClass]: !!this.controlSizeClass,
191
- "form-control-icon": !!this.$slots.icon,
192
- "is-valid": !!(this.valid || this.validFeedback),
193
- "is-invalid": !!(this.invalid || this.invalidFeedback),
194
- [this.pillClasses]: this.pill,
195
- [this.plaintextClass]: this.plaintext,
196
- [this.spacing]: !!this.spacing
197
- }, this.shadowableClass);
198
- },
199
- hasDefaultSlot() {
200
- return !!this.$slots.default;
201
- },
202
- invalidFeedback() {
203
- if (this.error === "")
204
- return null;
205
- if (this.error)
206
- return this.error;
207
- const e = this.getFieldErrors();
208
- return Array.isArray(e) ? e.filter((t) => t && typeof t == "string").join("<br>") : e;
209
- },
210
- pillClasses() {
211
- return "rounded rounded-pill";
212
- },
213
- plaintextClass() {
214
- return "form-control-plaintext";
215
- },
216
- validFeedback() {
217
- return Array.isArray(this.feedback) ? this.feedback.join("<br>") : this.feedback;
218
- }
219
- },
220
- watch: {
221
- hasFocus() {
222
- this.shouldChangeOnFocus() && (this.hasChanged = !0);
223
- },
224
- defaultEmpty() {
225
- this.hasChanged = !0;
226
- }
227
- },
228
- methods: {
229
- bindEvents(e, t) {
230
- t || (t = this.onInput);
231
- const i = e.querySelectorAll("option")[e.selectedIndex];
232
- k(this.modelValue) ? k(i) || (e.value = i.value) : e.value = this.modelValue, e.value && t(e.value), this.hasChanged = !!e.value, this.isEmpty = !e.value, e.addEventListener("focus", () => {
233
- this.hasFocus = !0;
234
- }), e.addEventListener("blur", () => {
235
- this.hasFocus = !1;
236
- }), e.addEventListener("input", (s) => {
237
- this.isEmpty = !1, this.hasChanged = !0;
238
- }), e.addEventListener(e.tagName === "SELECT" ? "change" : "input", () => t(e.value)), this.nativeEvents.forEach((s) => {
239
- e.addEventListener(s, (r) => {
240
- this.$emit(s, r);
241
- });
242
- });
243
- },
244
- blur() {
245
- this.getInputField() && this.getInputField().blur();
246
- },
247
- focus() {
248
- this.getInputField() && this.getInputField().focus();
249
- },
250
- getInputField() {
251
- return this.$el.querySelector(".form-control, input, select, textarea");
252
- },
253
- getFieldErrors() {
254
- let e = this.error || this.errors;
255
- return this.errors && F(this.errors) && (e = this.errors[this.$attrs.name || this.$attrs.id]), !e || Array.isArray(e) || F(e) ? e : [e];
256
- },
257
- shouldChangeOnFocus() {
258
- return !this.getInputField().readOnly;
259
- },
260
- onInput(e) {
261
- this.$emit("update:modelValue", e);
262
- }
263
- }
264
- };
265
- /*! *****************************************************************************
266
- Copyright (c) Microsoft Corporation.
267
-
268
- Permission to use, copy, modify, and/or distribute this software for any
269
- purpose with or without fee is hereby granted.
270
-
271
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
272
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
273
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
274
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
275
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
276
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
277
- PERFORMANCE OF THIS SOFTWARE.
278
- ***************************************************************************** */
279
- var C = function() {
280
- return C = Object.assign || function(t) {
281
- for (var i, s = 1, r = arguments.length; s < r; s++) {
282
- i = arguments[s];
283
- for (var n in i)
284
- Object.prototype.hasOwnProperty.call(i, n) && (t[n] = i[n]);
285
- }
286
- return t;
287
- }, C.apply(this, arguments);
288
- };
289
- function Q(e) {
290
- return e.toLowerCase();
291
- }
292
- var Y = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g], ee = /[^A-Z0-9]+/gi;
293
- function te(e, t) {
294
- t === void 0 && (t = {});
295
- for (var i = t.splitRegexp, s = i === void 0 ? Y : i, r = t.stripRegexp, n = r === void 0 ? ee : r, u = t.transform, g = u === void 0 ? Q : u, o = t.delimiter, S = o === void 0 ? " " : o, l = z(z(e, s, "$1\0$2"), n, "\0"), c = 0, h = l.length; l.charAt(c) === "\0"; )
296
- c++;
297
- for (; l.charAt(h - 1) === "\0"; )
298
- h--;
299
- return l.slice(c, h).split("\0").map(g).join(S);
300
- }
301
- function z(e, t, i) {
302
- return t instanceof RegExp ? e.replace(t, i) : t.reduce(function(s, r) {
303
- return s.replace(r, i);
304
- }, e);
305
- }
306
- function ie(e, t) {
307
- return t === void 0 && (t = {}), te(e, C({
308
- delimiter: "."
309
- }, t));
310
- }
311
- function y(e, t) {
312
- return t === void 0 && (t = {}), ie(e, C({
313
- delimiter: "-"
314
- }, t));
315
- }
316
- class T {
317
- constructor(t = {}) {
318
- this.components = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([i, s]) => {
319
- this.register(i, s);
320
- });
321
- }
322
- get(t) {
323
- const i = this.components.get(t = y(t));
324
- if (i)
325
- return i;
326
- throw new Error(`"${t}" has not been registered yet!`);
327
- }
328
- register(t, i) {
329
- return typeof t == "object" ? (Object.entries(t).forEach(([s, r]) => {
330
- this.register(y(s), r);
331
- }), this) : (this.components.set(y(t), i), this);
332
- }
333
- remove(t) {
334
- return this.components.delete(y(t)), this;
335
- }
336
- reset() {
337
- return this.components = /* @__PURE__ */ new Map(), this;
338
- }
339
- }
340
- function se(...e) {
341
- return new T(...e);
342
- }
343
- const x = se();
344
- const I = (e, t) => {
345
- const i = e.__vccOpts || e;
346
- for (const [s, r] of t)
347
- i[s] = r;
348
- return i;
349
- };
350
- function v(e, t = "px") {
351
- return e != null && e !== !1 && isFinite(e) ? `${e}${t}` : e;
352
- }
353
- const re = {
354
- name: "ActivityIndicator",
355
- props: {
356
- absolute: Boolean,
357
- center: Boolean,
358
- label: String,
359
- size: {
360
- type: String,
361
- default: "md"
362
- },
363
- registry: {
364
- type: T,
365
- default() {
366
- return x;
367
- }
368
- },
369
- type: {
370
- type: String,
371
- required: !0
372
- },
373
- height: [String, Number],
374
- maxHeight: [String, Number],
375
- minHeight: [String, Number],
376
- width: [String, Number],
377
- maxWidth: [String, Number],
378
- minWidth: [String, Number]
379
- },
380
- data: () => ({
381
- is: null
382
- }),
383
- computed: {
384
- classes() {
385
- return {
386
- "activity-indicator-center": this.center,
387
- "activity-indicator-absolute": this.absolute,
388
- [this.size && `activity-indicator-${this.size}`]: !!this.size
389
- };
390
- },
391
- style() {
392
- return {
393
- width: v(this.width),
394
- maxWidth: v(this.maxWidth),
395
- minWidth: v(this.minWidth),
396
- height: v(this.height),
397
- maxHeight: v(this.maxHeight),
398
- minHeight: v(this.minHeight)
399
- };
400
- }
401
- },
402
- async mounted() {
403
- const e = await this.component();
404
- this.is = () => e;
405
- },
406
- methods: {
407
- async component() {
408
- let e = x.get(this.type);
409
- return e instanceof Promise ? e : (typeof e == "function" && (e = await e()), e.default ? e.default : e);
410
- }
411
- }
412
- }, ne = { class: "activity-indicator-content" }, ae = {
413
- key: 1,
414
- class: "activity-indicator-label"
415
- };
416
- function oe(e, t, i, s, r, n) {
417
- return a(), d("div", {
418
- class: w(["activity-indicator", n.classes]),
419
- style: B(n.style)
420
- }, [
421
- E("div", ne, [
422
- e.is ? (a(), O(N(e.is()), {
423
- key: 0,
424
- class: "mx-auto"
425
- })) : p("", !0),
426
- i.label ? (a(), d("div", ae, L(i.label), 1)) : p("", !0)
427
- ])
428
- ], 6);
429
- }
430
- const le = /* @__PURE__ */ I(re, [["render", oe]]);
431
- const de = {
432
- name: "InputField",
433
- components: {
434
- ActivityIndicator: le
435
- },
436
- mixins: [
437
- K
438
- ]
439
- }, ue = ["for", "innerHTML"], ce = { class: "form-group-inner" }, he = ["innerHTML"], pe = ["innerHTML"];
440
- function fe(e, t, i, s, r, n) {
441
- const u = P("activity-indicator"), g = R("bind-events");
442
- return a(), d("div", {
443
- class: w(e.formGroupClasses)
444
- }, [
445
- f(e.$slots, "label", {}, () => [
446
- e.label ? (a(), d("label", {
447
- key: 0,
448
- ref: "label",
449
- for: e.id,
450
- class: w(e.labelClass),
451
- onClick: t[0] || (t[0] = (...o) => e.focus && e.focus(...o)),
452
- innerHTML: e.label
453
- }, null, 10, ue)) : p("", !0)
454
- ]),
455
- E("div", ce, [
456
- f(e.$slots, "control", {
457
- bindEvents: e.bindEvents,
458
- controlAttributes: e.controlAttributes,
459
- focus: e.focus
460
- }, () => [
461
- e.$slots.icon ? (a(), d("div", {
462
- key: 0,
463
- class: "form-group-inner-icon",
464
- onClick: t[1] || (t[1] = (...o) => e.focus && e.focus(...o))
465
- }, [
466
- f(e.$slots, "icon")
467
- ])) : p("", !0),
468
- H(E("input", D({ ref: "field" }, e.controlAttributes), null, 16), [
469
- [g]
470
- ])
471
- ]),
472
- f(e.$slots, "activity", {}, () => [
473
- M(Z, { name: "input-field-fade" }, {
474
- default: G(() => [
475
- e.activity ? (a(), O(u, {
476
- key: "activity",
477
- ref: "activity",
478
- type: e.indicator,
479
- size: e.indicatorSize || e.size
480
- }, null, 8, ["type", "size"])) : p("", !0)
481
- ]),
482
- _: 1
483
- })
484
- ])
485
- ]),
486
- f(e.$slots, "feedback", {}, () => [
487
- e.invalidFeedback ? (a(), d("div", {
488
- key: 0,
489
- class: "invalid-feedback",
490
- invalid: "",
491
- innerHTML: e.invalidFeedback
492
- }, null, 8, he)) : e.validFeedback ? (a(), d("div", {
493
- key: 1,
494
- class: "valid-feedback",
495
- valid: "",
496
- innerHTML: e.validFeedback
497
- }, null, 8, pe)) : p("", !0)
498
- ]),
499
- f(e.$slots, "help", {}, () => [
500
- e.helpText ? (a(), d("small", {
501
- key: 0,
502
- ref: "help"
503
- }, L(e.helpText), 513)) : p("", !0)
504
- ])
505
- ], 2);
506
- }
507
- const ge = /* @__PURE__ */ I(de, [["render", fe]]);
508
- export {
509
- ge as InputField
510
- };
@@ -1,14 +0,0 @@
1
- (function(d,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],i):(d=typeof globalThis<"u"?globalThis:d||self,i(d.InputField={},d.Vue))})(this,function(d,i){"use strict";var z={props:{dropShadow:[Boolean,String],dropShadowableClassPrefix:{type:String,default:"drop-shadow"},shadow:[Boolean,String],shadowableClassPrefix:{type:String,default:"shadow"}},computed:{shadowableClass(){const e=this.dropShadow===!0?"":this.dropShadow&&`-${this.dropShadow}`,t=this.shadow===!0?"":this.shadow&&`-${this.shadow}`;return{[`${this.dropShadowableClassPrefix}${e}`]:!!this.dropShadow,[`${this.shadowableClassPrefix}${t}`]:!!this.shadow}}}},_=function(){return _=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},_.apply(this,arguments)};function x(e){return e.toLowerCase()}var N=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],O=/[^A-Z0-9]+/gi;function T(e,t){t===void 0&&(t={});for(var n=t.splitRegexp,r=n===void 0?N:n,s=t.stripRegexp,a=s===void 0?O:s,c=t.transform,g=c===void 0?x:c,o=t.delimiter,C=o===void 0?" ":o,l=S(S(e,r,"$1\0$2"),a,"\0"),u=0,h=l.length;l.charAt(u)==="\0";)u++;for(;l.charAt(h-1)==="\0";)h--;return l.slice(u,h).split("\0").map(g).join(C)}function S(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce(function(r,s){return r.replace(s,n)},e)}function j(e,t){return t===void 0&&(t={}),T(e,_({delimiter:"."},t))}function $(e,t){return t===void 0&&(t={}),j(e,_({delimiter:"-"},t))}const f={};function m(...e){if(!e.length)return f;const[t,n]=e;return typeof t=="string"?typeof f[t]<"u"?f[t]:n:Array.isArray(t)?t.reduce((r,s)=>Object.assign(r,{[s]:f[s]}),{}):Object.assign(f,...e)}function b(e,t,n="-"){const r=t.toString().replace(new RegExp(`^${e}${n}?`),"");return[$(r),e].filter(s=>!!s).join(n)}function E(e){return!Array.isArray(e)&&typeof e=="object"}function k(e){return e===void 0}const I={directives:{bindEvents:{beforeMount(e,t,n){t.instance.bindEvents(e)}}},mixins:[z],inheritAttrs:!1,props:{activity:{type:Boolean,default:!1},animated:{type:Boolean,default:()=>m("animated",!1)},nativeEvents:{type:Array,default(){return["focus","blur","change","click","keypress","keyup","keydown","progress","paste"]}},defaultControlClass:{type:String,default:()=>m("defaultControlClass","form-control")},error:[String,Array,Boolean],errors:{type:[Array,Object,Boolean],default(){return{}}},feedback:[String,Array],group:{type:Boolean,default:()=>m("group",!0)},helpText:[Number,String],hideLabel:Boolean,indicator:{type:String,default:()=>m("indicator","spinner")},indicatorSize:String,inline:Boolean,invalid:Boolean,label:[Number,String],labelClass:{type:[Object,String],default:()=>m("labelClass","form-label")},modelValue:{default:void 0},pill:Boolean,plaintext:Boolean,size:String,spacing:String,valid:Boolean},data(){return{defaultEmpty:!1,hasChanged:!1,hasFocus:!1,isEmpty:!0}},computed:{id(){return this.$attrs.id||this.$attrs.name||(Math.random()+1).toString(36).substring(7)},componentName(){return this.$options.name},controlAttributes(){return Object.fromEntries(Object.entries(this.$attrs).concat([["id",this.id],["class",this.controlClasses]]))},controlClass(){return this.defaultControlClass},controlSizeClass(){return b(this.size,this.controlClass)},formGroupClasses(){return{[$(this.componentName)]:!!this.componentName,[this.size&&b(this.size,this.componentName)]:!!this.size,animated:this.animated,"default-empty":this.defaultEmpty,"form-group":this.group,[this.size&&b(this.size,"form-group")]:!!this.size,"has-activity":this.activity,"has-changed":this.hasChanged,"has-focus":this.hasFocus,"has-icon":!!this.$slots.icon,"is-empty":this.isEmpty,"is-invalid":!!(this.invalid||this.invalidFeedback),"is-valid":!!(this.valid||this.validFeedback),[this.$attrs.class]:!!this.$attrs.class,[this.$attrs.id]:!!this.$attrs.id}},controlClasses(){return Object.assign({[this.controlClass]:!!this.controlClass,[this.controlSizeClass]:!!this.controlSizeClass,"form-control-icon":!!this.$slots.icon,"is-valid":!!(this.valid||this.validFeedback),"is-invalid":!!(this.invalid||this.invalidFeedback),[this.pillClasses]:this.pill,[this.plaintextClass]:this.plaintext,[this.spacing]:!!this.spacing},this.shadowableClass)},hasDefaultSlot(){return!!this.$slots.default},invalidFeedback(){if(this.error==="")return null;if(this.error)return this.error;const e=this.getFieldErrors();return Array.isArray(e)?e.filter(t=>t&&typeof t=="string").join("<br>"):e},pillClasses(){return"rounded rounded-pill"},plaintextClass(){return"form-control-plaintext"},validFeedback(){return Array.isArray(this.feedback)?this.feedback.join("<br>"):this.feedback}},watch:{hasFocus(){this.shouldChangeOnFocus()&&(this.hasChanged=!0)},defaultEmpty(){this.hasChanged=!0}},methods:{bindEvents(e,t){t||(t=this.onInput);const n=e.querySelectorAll("option")[e.selectedIndex];k(this.modelValue)?k(n)||(e.value=n.value):e.value=this.modelValue,e.value&&t(e.value),this.hasChanged=!!e.value,this.isEmpty=!e.value,e.addEventListener("focus",()=>{this.hasFocus=!0}),e.addEventListener("blur",()=>{this.hasFocus=!1}),e.addEventListener("input",r=>{this.isEmpty=!1,this.hasChanged=!0}),e.addEventListener(e.tagName==="SELECT"?"change":"input",()=>t(e.value)),this.nativeEvents.forEach(r=>{e.addEventListener(r,s=>{this.$emit(r,s)})})},blur(){this.getInputField()&&this.getInputField().blur()},focus(){this.getInputField()&&this.getInputField().focus()},getInputField(){return this.$el.querySelector(".form-control, input, select, textarea")},getFieldErrors(){let e=this.error||this.errors;return this.errors&&E(this.errors)&&(e=this.errors[this.$attrs.name||this.$attrs.id]),!e||Array.isArray(e)||E(e)?e:[e]},shouldChangeOnFocus(){return!this.getInputField().readOnly},onInput(e){this.$emit("update:modelValue",e)}}};/*! *****************************************************************************
2
- Copyright (c) Microsoft Corporation.
3
-
4
- Permission to use, copy, modify, and/or distribute this software for any
5
- purpose with or without fee is hereby granted.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
- PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */var y=function(){return y=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},y.apply(this,arguments)};function L(e){return e.toLowerCase()}var P=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],R=/[^A-Z0-9]+/gi;function V(e,t){t===void 0&&(t={});for(var n=t.splitRegexp,r=n===void 0?P:n,s=t.stripRegexp,a=s===void 0?R:s,c=t.transform,g=c===void 0?L:c,o=t.delimiter,C=o===void 0?" ":o,l=w(w(e,r,"$1\0$2"),a,"\0"),u=0,h=l.length;l.charAt(u)==="\0";)u++;for(;l.charAt(h-1)==="\0";)h--;return l.slice(u,h).split("\0").map(g).join(C)}function w(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce(function(r,s){return r.replace(s,n)},e)}function D(e,t){return t===void 0&&(t={}),V(e,y({delimiter:"."},t))}function v(e,t){return t===void 0&&(t={}),D(e,y({delimiter:"-"},t))}class A{constructor(t={}){this.components=new Map,Object.entries(t).forEach(([n,r])=>{this.register(n,r)})}get(t){const n=this.components.get(t=v(t));if(n)return n;throw new Error(`"${t}" has not been registered yet!`)}register(t,n){return typeof t=="object"?(Object.entries(t).forEach(([r,s])=>{this.register(v(r),s)}),this):(this.components.set(v(t),n),this)}remove(t){return this.components.delete(v(t)),this}reset(){return this.components=new Map,this}}function H(...e){return new A(...e)}const F=H(),te="",B=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n};function p(e,t="px"){return e!=null&&e!==!1&&isFinite(e)?`${e}${t}`:e}const M={name:"ActivityIndicator",props:{absolute:Boolean,center:Boolean,label:String,size:{type:String,default:"md"},registry:{type:A,default(){return F}},type:{type:String,required:!0},height:[String,Number],maxHeight:[String,Number],minHeight:[String,Number],width:[String,Number],maxWidth:[String,Number],minWidth:[String,Number]},data:()=>({is:null}),computed:{classes(){return{"activity-indicator-center":this.center,"activity-indicator-absolute":this.absolute,[this.size&&`activity-indicator-${this.size}`]:!!this.size}},style(){return{width:p(this.width),maxWidth:p(this.maxWidth),minWidth:p(this.minWidth),height:p(this.height),maxHeight:p(this.maxHeight),minHeight:p(this.minHeight)}}},async mounted(){const e=await this.component();this.is=()=>e},methods:{async component(){let e=F.get(this.type);return e instanceof Promise?e:(typeof e=="function"&&(e=await e()),e.default?e.default:e)}}},Z={class:"activity-indicator-content"},q={key:1,class:"activity-indicator-label"};function G(e,t,n,r,s,a){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["activity-indicator",a.classes]),style:i.normalizeStyle(a.style)},[i.createElementVNode("div",Z,[e.is?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.is()),{key:0,class:"mx-auto"})):i.createCommentVNode("",!0),n.label?(i.openBlock(),i.createElementBlock("div",q,i.toDisplayString(n.label),1)):i.createCommentVNode("",!0)])],6)}const W=B(M,[["render",G]]),ie="",ne="",re="",se="",ae="",oe="",le="",de="",ce="",ue="",he="",pe="",fe="",me="",ge="",U={name:"InputField",components:{ActivityIndicator:W},mixins:[I]},X=["for","innerHTML"],J={class:"form-group-inner"},K=["innerHTML"],Q=["innerHTML"];function Y(e,t,n,r,s,a){const c=i.resolveComponent("activity-indicator"),g=i.resolveDirective("bind-events");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(e.formGroupClasses)},[i.renderSlot(e.$slots,"label",{},()=>[e.label?(i.openBlock(),i.createElementBlock("label",{key:0,ref:"label",for:e.id,class:i.normalizeClass(e.labelClass),onClick:t[0]||(t[0]=(...o)=>e.focus&&e.focus(...o)),innerHTML:e.label},null,10,X)):i.createCommentVNode("",!0)]),i.createElementVNode("div",J,[i.renderSlot(e.$slots,"control",{bindEvents:e.bindEvents,controlAttributes:e.controlAttributes,focus:e.focus},()=>[e.$slots.icon?(i.openBlock(),i.createElementBlock("div",{key:0,class:"form-group-inner-icon",onClick:t[1]||(t[1]=(...o)=>e.focus&&e.focus(...o))},[i.renderSlot(e.$slots,"icon")])):i.createCommentVNode("",!0),i.withDirectives(i.createElementVNode("input",i.mergeProps({ref:"field"},e.controlAttributes),null,16),[[g]])]),i.renderSlot(e.$slots,"activity",{},()=>[i.createVNode(i.Transition,{name:"input-field-fade"},{default:i.withCtx(()=>[e.activity?(i.openBlock(),i.createBlock(c,{key:"activity",ref:"activity",type:e.indicator,size:e.indicatorSize||e.size},null,8,["type","size"])):i.createCommentVNode("",!0)]),_:1})])]),i.renderSlot(e.$slots,"feedback",{},()=>[e.invalidFeedback?(i.openBlock(),i.createElementBlock("div",{key:0,class:"invalid-feedback",invalid:"",innerHTML:e.invalidFeedback},null,8,K)):e.validFeedback?(i.openBlock(),i.createElementBlock("div",{key:1,class:"valid-feedback",valid:"",innerHTML:e.validFeedback},null,8,Q)):i.createCommentVNode("",!0)]),i.renderSlot(e.$slots,"help",{},()=>[e.helpText?(i.openBlock(),i.createElementBlock("small",{key:0,ref:"help"},i.toDisplayString(e.helpText),513)):i.createCommentVNode("",!0)])],2)}const ee=B(U,[["render",Y]]);d.InputField=ee,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});