@citizenplane/pimp 8.2.0 → 8.2.2

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/dist/pimp.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { useSlots, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, unref, renderSlot, createBlock, createCommentVNode, createElementVNode, createVNode, resolveDynamicComponent, mergeProps, withCtx, resolveDirective, createTextVNode, toDisplayString, withDirectives, vModelText, Fragment, renderList, vModelSelect, defineComponent, watch, h, Transition, normalizeStyle, withKeys, TransitionGroup, vShow, ref, withModifiers, vModelCheckbox } from "vue";
2
- function _mergeNamespaces(n2, m) {
3
- m.forEach(function(e) {
2
+ function _mergeNamespaces(n2, m2) {
3
+ m2.forEach(function(e) {
4
4
  e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function(k) {
5
5
  if (k !== "default" && !(k in n2)) {
6
6
  var d = Object.getOwnPropertyDescriptor(e, k);
@@ -15,10 +15,10 @@ function _mergeNamespaces(n2, m) {
15
15
  });
16
16
  return Object.freeze(Object.defineProperty(n2, Symbol.toStringTag, { value: "Module" }));
17
17
  }
18
- /*! maska v2.1.4 | (c) Alexander Shabunevich | Released under the MIT license */
18
+ /*! maska v2.1.6 | (c) Alexander Shabunevich | Released under the MIT license */
19
19
  var b = Object.defineProperty;
20
20
  var L = (n2, t, s2) => t in n2 ? b(n2, t, { enumerable: true, configurable: true, writable: true, value: s2 }) : n2[t] = s2;
21
- var f = (n2, t, s2) => (L(n2, typeof t != "symbol" ? t + "" : t, s2), s2);
21
+ var m = (n2, t, s2) => (L(n2, typeof t != "symbol" ? t + "" : t, s2), s2);
22
22
  const R = {
23
23
  "#": { pattern: /[0-9]/ },
24
24
  "@": { pattern: /[a-zA-Z]/ },
@@ -26,8 +26,8 @@ const R = {
26
26
  };
27
27
  class w {
28
28
  constructor(t = {}) {
29
- f(this, "opts", {});
30
- f(this, "memo", /* @__PURE__ */ new Map());
29
+ m(this, "opts", {});
30
+ m(this, "memo", /* @__PURE__ */ new Map());
31
31
  var e;
32
32
  const s2 = { ...t };
33
33
  if (s2.tokens != null) {
@@ -67,7 +67,7 @@ class w {
67
67
  if (typeof s2 == "function")
68
68
  return s2(t);
69
69
  const e = this.process(t, (a = s2.slice(-1).pop()) != null ? a : "", false);
70
- return (i = s2.find((p) => this.process(t, p, false).length >= e.length)) != null ? i : "";
70
+ return (i = s2.find((c) => this.process(t, c, false).length >= e.length)) != null ? i : "";
71
71
  }
72
72
  escapeMask(t) {
73
73
  const s2 = [], e = [];
@@ -82,26 +82,26 @@ class w {
82
82
  const a = `value=${t},mask=${s2},masked=${e ? 1 : 0}`;
83
83
  if (this.memo.has(a))
84
84
  return this.memo.get(a);
85
- const { mask: i, escaped: p } = this.escapeMask(s2), l2 = [], k = this.opts.tokens != null ? this.opts.tokens : {}, r = this.isReversed() ? -1 : 1, u = this.isReversed() ? "unshift" : "push", g = this.isReversed() ? 0 : i.length - 1, V = this.isReversed() ? () => o > -1 && c > -1 : () => o < i.length && c < t.length, W = (m) => !this.isReversed() && m <= g || this.isReversed() && m >= g;
86
- let E, d = -1, o = this.isReversed() ? i.length - 1 : 0, c = this.isReversed() ? t.length - 1 : 0;
85
+ const { mask: i, escaped: c } = this.escapeMask(s2), r = [], k = this.opts.tokens != null ? this.opts.tokens : {}, l2 = this.isReversed() ? -1 : 1, d = this.isReversed() ? "unshift" : "push", g = this.isReversed() ? 0 : i.length - 1, V = this.isReversed() ? () => o > -1 && h2 > -1 : () => o < i.length && h2 < t.length, P = (f) => !this.isReversed() && f <= g || this.isReversed() && f >= g;
86
+ let E, u = -1, o = this.isReversed() ? i.length - 1 : 0, h2 = this.isReversed() ? t.length - 1 : 0;
87
87
  for (; V(); ) {
88
- const m = i.charAt(o), h2 = k[m], M = (h2 == null ? void 0 : h2.transform) != null ? h2.transform(t.charAt(c)) : t.charAt(c);
89
- if (!p.includes(o) && h2 != null) {
90
- if (M.match(h2.pattern) != null)
91
- l2[u](M), h2.repeated ? (d === -1 ? d = o : o === g && o !== d && (o = d - r), g === d && (o -= r)) : h2.multiple && (o -= r), o += r;
92
- else if (h2.multiple) {
93
- const P = ((v = l2[c - r]) == null ? void 0 : v.match(h2.pattern)) != null, A = i.charAt(o + r);
94
- P && A !== "" && k[A] == null ? (o += r, c -= r) : l2[u]("");
88
+ const f = i.charAt(o), p = k[f], M = (p == null ? void 0 : p.transform) != null ? p.transform(t.charAt(h2)) : t.charAt(h2);
89
+ if (!c.includes(o) && p != null) {
90
+ if (M.match(p.pattern) != null)
91
+ r[d](M), p.repeated ? (u === -1 ? u = o : o === g && o !== u && (o = u - l2), g === u && (o -= l2)) : p.multiple && (o -= l2), o += l2;
92
+ else if (p.multiple) {
93
+ const W = ((v = r[h2 - l2]) == null ? void 0 : v.match(p.pattern)) != null, A = i.charAt(o + l2);
94
+ W && A !== "" && k[A] == null ? (o += l2, h2 -= l2) : r[d]("");
95
95
  } else
96
- M === E ? E = void 0 : h2.optional && (o += r, c -= r);
97
- c += r;
96
+ M === E ? E = void 0 : p.optional && (o += l2, h2 -= l2);
97
+ h2 += l2;
98
98
  } else
99
- e && !this.isEager() && l2[u](m), M === m && !this.isEager() ? c += r : E = m, this.isEager() || (o += r);
99
+ e && !this.isEager() && r[d](f), M === f && !this.isEager() ? h2 += l2 : E = f, this.isEager() || (o += l2);
100
100
  if (this.isEager())
101
- for (; W(o) && (k[i.charAt(o)] == null || p.includes(o)); )
102
- e ? l2[u](i.charAt(o)) : i.charAt(o) === t.charAt(c) && (c += r), o += r;
101
+ for (; P(o) && (k[i.charAt(o)] == null || c.includes(o)); )
102
+ e ? r[d](i.charAt(o)) : i.charAt(o) === t.charAt(h2) && (h2 += l2), o += l2;
103
103
  }
104
- return this.memo.set(a, l2.join("")), this.memo.get(a);
104
+ return this.memo.set(a, r.join("")), this.memo.get(a);
105
105
  }
106
106
  }
107
107
  const S = (n2) => JSON.parse(n2.replaceAll("'", '"')), O = (n2, t = {}) => {
@@ -123,23 +123,23 @@ const S = (n2) => JSON.parse(n2.replaceAll("'", '"')), O = (n2, t = {}) => {
123
123
  };
124
124
  class N {
125
125
  constructor(t, s2 = {}) {
126
- f(this, "items", /* @__PURE__ */ new Map());
127
- f(this, "beforeinputEvent", (t2) => {
126
+ m(this, "items", /* @__PURE__ */ new Map());
127
+ m(this, "beforeinputEvent", (t2) => {
128
128
  const s3 = t2.target, e = this.items.get(s3);
129
129
  e.isEager() && "inputType" in t2 && t2.inputType.startsWith("delete") && e.unmasked(s3.value).length <= 1 && this.setMaskedValue(s3, "");
130
130
  });
131
- f(this, "inputEvent", (t2) => {
131
+ m(this, "inputEvent", (t2) => {
132
132
  if (t2 instanceof CustomEvent && t2.type === "input" && t2.detail != null && typeof t2.detail == "object" && "masked" in t2.detail)
133
133
  return;
134
- const s3 = t2.target, e = this.items.get(s3), a = s3.value, i = s3.selectionStart, p = s3.selectionEnd;
135
- let l2 = a;
134
+ const s3 = t2.target, e = this.items.get(s3), a = s3.value, i = s3.selectionStart, c = s3.selectionEnd;
135
+ let r = a;
136
136
  if (e.isEager()) {
137
- const k = e.unmasked(a), r = e.masked(k);
138
- k === "" && "data" in t2 && t2.data != null ? l2 = t2.data : (r.startsWith(a) || e.completed(k)) && (l2 = k);
137
+ const k = e.masked(a), l2 = e.unmasked(a);
138
+ l2 === "" && "data" in t2 && t2.data != null ? r = t2.data : l2 !== e.unmasked(k) && (r = l2);
139
139
  }
140
- if (this.setMaskedValue(s3, l2), "inputType" in t2 && (t2.inputType.startsWith("delete") || i != null && i < a.length))
140
+ if (this.setMaskedValue(s3, r), "inputType" in t2 && (t2.inputType.startsWith("delete") || i != null && i < a.length))
141
141
  try {
142
- s3.setSelectionRange(i, p);
142
+ s3.setSelectionRange(i, c);
143
143
  } catch {
144
144
  }
145
145
  });
@@ -172,13 +172,9 @@ class N {
172
172
  }
173
173
  setMaskedValue(t, s2) {
174
174
  const e = this.items.get(t);
175
- this.options.preProcess != null && (s2 = this.options.preProcess(s2)), s2 = e.masked(s2), this.options.postProcess != null && (s2 = this.options.postProcess(s2)), t.value = s2, t.dataset.maskaValue = s2;
176
- const a = {
177
- masked: e.masked(s2),
178
- unmasked: e.unmasked(s2),
179
- completed: e.completed(s2)
180
- };
181
- this.options.onMaska != null && (Array.isArray(this.options.onMaska) ? this.options.onMaska.forEach((i) => i(a)) : this.options.onMaska(a)), t.dispatchEvent(new CustomEvent("maska", { detail: a })), t.dispatchEvent(new CustomEvent("input", { detail: a }));
175
+ this.options.preProcess != null && (s2 = this.options.preProcess(s2));
176
+ const a = e.masked(s2), i = e.unmasked(e.isEager() ? a : s2), c = e.completed(s2), r = { masked: a, unmasked: i, completed: c };
177
+ s2 = a, this.options.postProcess != null && (s2 = this.options.postProcess(s2)), t.value = s2, t.dataset.maskaValue = s2, this.options.onMaska != null && (Array.isArray(this.options.onMaska) ? this.options.onMaska.forEach((k) => k(r)) : this.options.onMaska(r)), t.dispatchEvent(new CustomEvent("maska", { detail: r })), t.dispatchEvent(new CustomEvent("input", { detail: r }));
182
178
  }
183
179
  }
184
180
  const T = /* @__PURE__ */ new WeakMap(), C = (n2) => {
@@ -195,10 +191,10 @@ const T = /* @__PURE__ */ new WeakMap(), C = (n2) => {
195
191
  a.destroy();
196
192
  }
197
193
  if (t.value != null) {
198
- const i = t.value, p = (l2) => {
199
- i.masked = l2.masked, i.unmasked = l2.unmasked, i.completed = l2.completed;
194
+ const i = t.value, c = (r) => {
195
+ i.masked = r.masked, i.unmasked = r.unmasked, i.completed = r.completed;
200
196
  };
201
- e.onMaska = e.onMaska == null ? p : Array.isArray(e.onMaska) ? [...e.onMaska, p] : [e.onMaska, p];
197
+ e.onMaska = e.onMaska == null ? c : Array.isArray(e.onMaska) ? [...e.onMaska, c] : [e.onMaska, c];
202
198
  }
203
199
  T.set(s2, new N(s2, e)), setTimeout(() => {
204
200
  C(s2);
@@ -668,19 +664,19 @@ function intlConfigString(localeStr, numberingSystem, outputCalendar) {
668
664
  return localeStr;
669
665
  }
670
666
  }
671
- function mapMonths(f2) {
667
+ function mapMonths(f) {
672
668
  const ms = [];
673
669
  for (let i = 1; i <= 12; i++) {
674
670
  const dt = DateTime.utc(2016, i, 1);
675
- ms.push(f2(dt));
671
+ ms.push(f(dt));
676
672
  }
677
673
  return ms;
678
674
  }
679
- function mapWeekdays(f2) {
675
+ function mapWeekdays(f) {
680
676
  const ms = [];
681
677
  for (let i = 1; i <= 7; i++) {
682
678
  const dt = DateTime.utc(2016, 11, 13 + i);
683
- ms.push(f2(dt));
679
+ ms.push(f(dt));
684
680
  }
685
681
  return ms;
686
682
  }
@@ -894,7 +890,7 @@ class Locale {
894
890
  });
895
891
  }
896
892
  extract(dt, intlOpts, field) {
897
- const df = this.dtFormatter(dt, intlOpts), results = df.formatToParts(), matching = results.find((m) => m.type.toLowerCase() === field);
893
+ const df = this.dtFormatter(dt, intlOpts), results = df.formatToParts(), matching = results.find((m2) => m2.type.toLowerCase() === field);
898
894
  return matching ? matching.value : null;
899
895
  }
900
896
  numberFormatter(opts = {}) {
@@ -1157,8 +1153,8 @@ function parseMillis(fraction) {
1157
1153
  if (isUndefined(fraction) || fraction === null || fraction === "") {
1158
1154
  return void 0;
1159
1155
  } else {
1160
- const f2 = parseFloat("0." + fraction) * 1e3;
1161
- return Math.floor(f2);
1156
+ const f = parseFloat("0." + fraction) * 1e3;
1157
+ return Math.floor(f);
1162
1158
  }
1163
1159
  }
1164
1160
  function roundTo(number, digits, towardZero = false) {
@@ -1218,7 +1214,7 @@ function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {
1218
1214
  intlOpts.timeZone = timeZone;
1219
1215
  }
1220
1216
  const modified = { timeZoneName: offsetFormat, ...intlOpts };
1221
- const parsed = new Intl.DateTimeFormat(locale, modified).formatToParts(date).find((m) => m.type.toLowerCase() === "timezonename");
1217
+ const parsed = new Intl.DateTimeFormat(locale, modified).formatToParts(date).find((m2) => m2.type.toLowerCase() === "timezonename");
1222
1218
  return parsed ? parsed.value : null;
1223
1219
  }
1224
1220
  function signedOffset(offHourStr, offMinuteStr) {
@@ -1682,13 +1678,13 @@ class Invalid {
1682
1678
  }
1683
1679
  const ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
1684
1680
  function combineRegexes(...regexes) {
1685
- const full = regexes.reduce((f2, r) => f2 + r.source, "");
1681
+ const full = regexes.reduce((f, r) => f + r.source, "");
1686
1682
  return RegExp(`^${full}$`);
1687
1683
  }
1688
1684
  function combineExtractors(...extractors) {
1689
- return (m) => extractors.reduce(
1685
+ return (m2) => extractors.reduce(
1690
1686
  ([mergedVals, mergedZone, cursor], ex) => {
1691
- const [val, zone, next] = ex(m, cursor);
1687
+ const [val, zone, next] = ex(m2, cursor);
1692
1688
  return [{ ...mergedVals, ...val }, zone || mergedZone, next];
1693
1689
  },
1694
1690
  [{}, null, 1]
@@ -1699,9 +1695,9 @@ function parse(s2, ...patterns) {
1699
1695
  return [null, null];
1700
1696
  }
1701
1697
  for (const [regex, extractor] of patterns) {
1702
- const m = regex.exec(s2);
1703
- if (m) {
1704
- return extractor(m);
1698
+ const m2 = regex.exec(s2);
1699
+ if (m2) {
1700
+ return extractor(m2);
1705
1701
  }
1706
1702
  }
1707
1703
  return [null, null];
@@ -1732,8 +1728,8 @@ const sqlTimeRegex = RegExp(
1732
1728
  );
1733
1729
  const sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);
1734
1730
  function int(match2, pos, fallback) {
1735
- const m = match2[pos];
1736
- return isUndefined(m) ? fallback : parseInteger(m);
1731
+ const m2 = match2[pos];
1732
+ return isUndefined(m2) ? fallback : parseInteger(m2);
1737
1733
  }
1738
1734
  function extractISOYmd(match2, cursor) {
1739
1735
  const item = {
@@ -2878,7 +2874,7 @@ function oneOf(strings, startIndex) {
2878
2874
  }
2879
2875
  }
2880
2876
  function offset(regex, groups) {
2881
- return { regex, deser: ([, h2, m]) => signedOffset(h2, m), groups };
2877
+ return { regex, deser: ([, h2, m2]) => signedOffset(h2, m2), groups };
2882
2878
  }
2883
2879
  function simple(regex) {
2884
2880
  return { regex, deser: ([s2]) => s2 };
@@ -3058,7 +3054,7 @@ function tokenForPart(part, formatOpts) {
3058
3054
  return void 0;
3059
3055
  }
3060
3056
  function buildRegex(units) {
3061
- const re = units.map((u) => u.regex).reduce((f2, r) => `${f2}(${r.source})`, "");
3057
+ const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, "");
3062
3058
  return [`^${re}$`, units];
3063
3059
  }
3064
3060
  function match(input, regex, handlers) {
@@ -3142,9 +3138,9 @@ function dateTimeFromMatches(matches) {
3142
3138
  matches.S = parseMillis(matches.u);
3143
3139
  }
3144
3140
  const vals = Object.keys(matches).reduce((r, k) => {
3145
- const f2 = toField(k);
3146
- if (f2) {
3147
- r[f2] = matches[k];
3141
+ const f = toField(k);
3142
+ if (f) {
3143
+ r[f] = matches[k];
3148
3144
  }
3149
3145
  return r;
3150
3146
  }, {});
@@ -6363,38 +6359,10 @@ var CpIcon_vue_vue_type_style_index_0_lang = "";
6363
6359
  const _sfc_main$f = defineComponent({
6364
6360
  name: "CpIcon",
6365
6361
  props: {
6366
- animation: {
6367
- type: String,
6368
- default: void 0
6369
- },
6370
- animationSpeed: {
6371
- type: String,
6372
- default: void 0
6373
- },
6374
- fill: {
6375
- type: String,
6376
- default: "none"
6377
- },
6378
6362
  size: {
6379
6363
  type: [Number, String],
6380
6364
  default: 24
6381
6365
  },
6382
- stroke: {
6383
- type: String,
6384
- default: "currentColor"
6385
- },
6386
- strokeLinecap: {
6387
- type: String,
6388
- default: "round"
6389
- },
6390
- strokeLinejoin: {
6391
- type: String,
6392
- default: "round"
6393
- },
6394
- strokeWidth: {
6395
- type: [Number, String],
6396
- default: 2
6397
- },
6398
6366
  tag: {
6399
6367
  type: String,
6400
6368
  default: "i"
@@ -6414,7 +6382,7 @@ const _sfc_main$f = defineComponent({
6414
6382
  }
6415
6383
  },
6416
6384
  setup(props, { attrs }) {
6417
- let icon = feather$2.exports.icons[props.type];
6385
+ let icon = feather$2.exports.icons[props.type] || "";
6418
6386
  watch(
6419
6387
  () => props.type,
6420
6388
  () => {
@@ -6429,10 +6397,8 @@ const _sfc_main$f = defineComponent({
6429
6397
  "data-tags": icon.tags,
6430
6398
  "data-type": props.type,
6431
6399
  class: {
6432
- featherIcon: true,
6433
- [`cpIcon--${props.type}`]: props.type,
6434
- [`cpIcon--${props.animation}`]: props.animation,
6435
- [`cpIcon--${props.animationSpeed}`]: props.animationSpeed
6400
+ cpIcon: true,
6401
+ [`cpIcon--${props.type}`]: props.type
6436
6402
  }
6437
6403
  },
6438
6404
  [
@@ -6440,12 +6406,7 @@ const _sfc_main$f = defineComponent({
6440
6406
  "svg",
6441
6407
  {
6442
6408
  ...icon.attrs,
6443
- fill: props.fill,
6444
6409
  height: props.size,
6445
- stroke: props.stroke,
6446
- "stroke-linecap": props.strokeLinecap,
6447
- "stroke-linejoin": props.strokeLinejoin,
6448
- "stroke-width": props.strokeWidth,
6449
6410
  width: props.size,
6450
6411
  class: [icon.attrs.class, "cpIcon__content"],
6451
6412
  innerHTML: icon.contents
@@ -6689,7 +6650,7 @@ const _sfc_main$e = {
6689
6650
  return dtDateTwo < dtDateOne;
6690
6651
  },
6691
6652
  visibleMonths() {
6692
- const firstMonthArray = this.months.filter((m, index) => index > 0);
6653
+ const firstMonthArray = this.months.filter((m2, index) => index > 0);
6693
6654
  const numberOfMonthsArray = [];
6694
6655
  for (let i = 0; i < this.showMonths; i++) {
6695
6656
  numberOfMonthsArray.push(i);
@@ -8940,7 +8901,7 @@ function rgbToRgba(rgbValue) {
8940
8901
  }
8941
8902
  function hexToRgba(hexValue) {
8942
8903
  var rgx = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
8943
- var hex = hexValue.replace(rgx, function(m, r2, g2, b3) {
8904
+ var hex = hexValue.replace(rgx, function(m2, r2, g2, b3) {
8944
8905
  return r2 + r2 + g2 + g2 + b3 + b3;
8945
8906
  });
8946
8907
  var rgb = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
@@ -9068,9 +9029,9 @@ function getElementTransforms(el) {
9068
9029
  var str = el.style.transform || "";
9069
9030
  var reg = /(\w+)\(([^)]*)\)/g;
9070
9031
  var transforms = /* @__PURE__ */ new Map();
9071
- var m;
9072
- while (m = reg.exec(str)) {
9073
- transforms.set(m[1], m[2]);
9032
+ var m2;
9033
+ while (m2 = reg.exec(str)) {
9034
+ transforms.set(m2[1], m2[2]);
9074
9035
  }
9075
9036
  return transforms;
9076
9037
  }