@castlabs/ui 4.23.0 → 4.24.1

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.
@@ -2622,7 +2622,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
2622
2622
  name: 'ClUI',
2623
2623
  computed: {
2624
2624
  version: function () {
2625
- return "4.23.0" ?? 0;
2625
+ return "4.24.1" ?? 0;
2626
2626
  }
2627
2627
  }
2628
2628
  }));
@@ -4044,32 +4044,29 @@ ClDropzone_template.install = Vue => {
4044
4044
  Vue.component(ClDropzone_template.name ?? 'ClNoName', ClDropzone_template);
4045
4045
  };
4046
4046
  /* harmony default export */ var ClDropzone = (ClDropzone_template);
4047
- ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-86.use[2]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[4]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/form/ClField/template.vue?vue&type=template&id=1e758708&ts=true
4047
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-86.use[2]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[4]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/form/ClField/template.vue?vue&type=template&id=7afc34d1&ts=true
4048
4048
 
4049
- const templatevue_type_template_id_1e758708_ts_true_hoisted_1 = ["for"];
4050
- const templatevue_type_template_id_1e758708_ts_true_hoisted_2 = {
4049
+ const templatevue_type_template_id_7afc34d1_ts_true_hoisted_1 = ["for"];
4050
+ const templatevue_type_template_id_7afc34d1_ts_true_hoisted_2 = {
4051
4051
  key: 0,
4052
4052
  class: "required"
4053
4053
  };
4054
- const templatevue_type_template_id_1e758708_ts_true_hoisted_3 = ["id", "autofocus", "disabled", "maxlength", "minlength", "placeholder", "required"];
4055
- const templatevue_type_template_id_1e758708_ts_true_hoisted_4 = ["id", "autofocus", "disabled", "required"];
4056
- const _hoisted_5 = ["id", "autofocus", "disabled", "maxlength", "minlength", "pattern", "placeholder", "required", "type"];
4054
+ const templatevue_type_template_id_7afc34d1_ts_true_hoisted_3 = ["id", "autofocus", "disabled", "maxlength", "minlength", "placeholder", "required"];
4055
+ const templatevue_type_template_id_7afc34d1_ts_true_hoisted_4 = ["id", "autofocus", "disabled", "required"];
4056
+ const _hoisted_5 = ["id", "autofocus", "disabled", "min", "max", "maxlength", "minlength", "pattern", "placeholder", "required", "type"];
4057
4057
  const _hoisted_6 = ["id", "for"];
4058
4058
  const _hoisted_7 = {
4059
- class: "invalid-feedback"
4060
- };
4061
- const _hoisted_8 = {
4062
4059
  key: 1,
4063
4060
  class: "valid-feedback valid-feedback-none"
4064
4061
  };
4065
- function templatevue_type_template_id_1e758708_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
4062
+ function templatevue_type_template_id_7afc34d1_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
4066
4063
  return (0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)(external_vue_.Fragment, null, [_ctx.label ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("label", {
4067
4064
  key: 0,
4068
4065
  for: _ctx.$uid,
4069
4066
  class: (0,external_vue_.normalizeClass)(["form-label", {
4070
4067
  disabled: _ctx.disabled
4071
4068
  }])
4072
- }, [(0,external_vue_.createTextVNode)((0,external_vue_.toDisplayString)(_ctx.label), 1), _ctx.required ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("span", templatevue_type_template_id_1e758708_ts_true_hoisted_2, "*")) : (0,external_vue_.createCommentVNode)("", true)], 10, templatevue_type_template_id_1e758708_ts_true_hoisted_1)) : (0,external_vue_.createCommentVNode)("", true), _ctx.type === 'textarea' ? (0,external_vue_.withDirectives)(((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("textarea", (0,external_vue_.mergeProps)({
4069
+ }, [(0,external_vue_.createTextVNode)((0,external_vue_.toDisplayString)(_ctx.label), 1), _ctx.required ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("span", templatevue_type_template_id_7afc34d1_ts_true_hoisted_2, "*")) : (0,external_vue_.createCommentVNode)("", true)], 10, templatevue_type_template_id_7afc34d1_ts_true_hoisted_1)) : (0,external_vue_.createCommentVNode)("", true), _ctx.type === 'textarea' ? (0,external_vue_.withDirectives)(((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("textarea", (0,external_vue_.mergeProps)({
4073
4070
  key: 1,
4074
4071
  id: _ctx.$uid
4075
4072
  }, _ctx.$attrs, {
@@ -4085,7 +4082,7 @@ function templatevue_type_template_id_1e758708_ts_true_render(_ctx, _cache, $pro
4085
4082
  onBlur: _cache[1] || (_cache[1] = $event => _ctx.validate(true)),
4086
4083
  onChange: _cache[2] || (_cache[2] = $event => _ctx.validate()),
4087
4084
  onInput: _cache[3] || (_cache[3] = $event => _ctx.validate())
4088
- }), null, 16, templatevue_type_template_id_1e758708_ts_true_hoisted_3)), [[external_vue_.vModelText, _ctx.modelValue]]) : _ctx.type === 'select' ? (0,external_vue_.withDirectives)(((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("select", (0,external_vue_.mergeProps)({
4085
+ }), null, 16, templatevue_type_template_id_7afc34d1_ts_true_hoisted_3)), [[external_vue_.vModelText, _ctx.modelValue]]) : _ctx.type === 'select' ? (0,external_vue_.withDirectives)(((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("select", (0,external_vue_.mergeProps)({
4089
4086
  key: 2,
4090
4087
  id: _ctx.$uid,
4091
4088
  "onUpdate:modelValue": _cache[4] || (_cache[4] = $event => _ctx.modelValue = $event),
@@ -4097,7 +4094,7 @@ function templatevue_type_template_id_1e758708_ts_true_render(_ctx, _cache, $pro
4097
4094
  onBlur: _cache[5] || (_cache[5] = $event => _ctx.validate(true)),
4098
4095
  onChange: _cache[6] || (_cache[6] = $event => _ctx.validate()),
4099
4096
  onInput: _cache[7] || (_cache[7] = $event => _ctx.validate())
4100
- }), [(0,external_vue_.renderSlot)(_ctx.$slots, "default")], 16, templatevue_type_template_id_1e758708_ts_true_hoisted_4)), [[external_vue_.vModelSelect, _ctx.modelValue]]) : (0,external_vue_.withDirectives)(((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("input", (0,external_vue_.mergeProps)({
4097
+ }), [(0,external_vue_.renderSlot)(_ctx.$slots, "default")], 16, templatevue_type_template_id_7afc34d1_ts_true_hoisted_4)), [[external_vue_.vModelSelect, _ctx.modelValue]]) : (0,external_vue_.withDirectives)(((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("input", (0,external_vue_.mergeProps)({
4101
4098
  key: 3,
4102
4099
  id: _ctx.$uid
4103
4100
  }, _ctx.$attrs, {
@@ -4106,12 +4103,14 @@ function templatevue_type_template_id_1e758708_ts_true_render(_ctx, _cache, $pro
4106
4103
  autofocus: _ctx.autofocus,
4107
4104
  class: _ctx.clazz,
4108
4105
  disabled: _ctx.disabled,
4106
+ min: _ctx.min,
4107
+ max: _ctx.max,
4109
4108
  maxlength: _ctx.maxlength,
4110
4109
  minlength: _ctx.minlength,
4111
4110
  pattern: _ctx.pattern,
4112
4111
  placeholder: _ctx.placeholder,
4113
4112
  required: _ctx.required,
4114
- type: _ctx.type,
4113
+ type: ['number'].includes(_ctx.type) ? 'text' : _ctx.type,
4115
4114
  onBlur: _cache[9] || (_cache[9] = $event => _ctx.validate(true)),
4116
4115
  onChange: _cache[10] || (_cache[10] = $event => _ctx.validate()),
4117
4116
  onInput: _cache[11] || (_cache[11] = $event => _ctx.validate())
@@ -4122,14 +4121,18 @@ function templatevue_type_template_id_1e758708_ts_true_render(_ctx, _cache, $pro
4122
4121
  class: "cl-file-companion"
4123
4122
  }, (0,external_vue_.toDisplayString)(_ctx.filePlaceholder), 9, _hoisted_6)) : (0,external_vue_.createCommentVNode)("", true), !_ctx.nofeedback ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)(external_vue_.Fragment, {
4124
4123
  key: 5
4125
- }, [(0,external_vue_.createElementVNode)("p", _hoisted_7, (0,external_vue_.toDisplayString)(_ctx.invalidMessage), 1), _ctx.help ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("p", {
4124
+ }, [(0,external_vue_.createElementVNode)("p", {
4125
+ class: (0,external_vue_.normalizeClass)(["invalid-feedback", {
4126
+ disabled: _ctx.disabled
4127
+ }])
4128
+ }, (0,external_vue_.toDisplayString)(_ctx.invalidMessage), 3), _ctx.help ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("p", {
4126
4129
  key: 0,
4127
4130
  class: (0,external_vue_.normalizeClass)(["valid-feedback", {
4128
4131
  disabled: _ctx.disabled
4129
4132
  }])
4130
- }, (0,external_vue_.toDisplayString)(_ctx.help), 3)) : ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("p", _hoisted_8))], 64)) : (0,external_vue_.createCommentVNode)("", true)], 64);
4133
+ }, (0,external_vue_.toDisplayString)(_ctx.help), 3)) : ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("p", _hoisted_7))], 64)) : (0,external_vue_.createCommentVNode)("", true)], 64);
4131
4134
  }
4132
- ;// ./src/components/form/ClField/template.vue?vue&type=template&id=1e758708&ts=true
4135
+ ;// ./src/components/form/ClField/template.vue?vue&type=template&id=7afc34d1&ts=true
4133
4136
 
4134
4137
  ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-86.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/form/ClField/template.vue?vue&type=script&lang=ts
4135
4138
 
@@ -4197,6 +4200,14 @@ function templatevue_type_template_id_1e758708_ts_true_render(_ctx, _cache, $pro
4197
4200
  type: String,
4198
4201
  default: undefined
4199
4202
  },
4203
+ min: {
4204
+ type: String,
4205
+ default: undefined
4206
+ },
4207
+ max: {
4208
+ type: String,
4209
+ default: undefined
4210
+ },
4200
4211
  pattern: {
4201
4212
  type: String,
4202
4213
  default: undefined
@@ -4232,7 +4243,7 @@ function templatevue_type_template_id_1e758708_ts_true_render(_ctx, _cache, $pro
4232
4243
  },
4233
4244
  methods: {
4234
4245
  runAutotrim: function () {
4235
- if (this.autotrim) {
4246
+ if (this.autotrim || ['number'].includes(this.type)) {
4236
4247
  const input = this.$refs.input;
4237
4248
  input.value = input.value.trim();
4238
4249
  this.modelValue = input.value;
@@ -4246,7 +4257,7 @@ function templatevue_type_template_id_1e758708_ts_true_render(_ctx, _cache, $pro
4246
4257
  },
4247
4258
  validate: function (trim = false) {
4248
4259
  this.valid = true;
4249
- if (trim && this.autotrim) this.runAutotrim();
4260
+ if (trim) this.runAutotrim();
4250
4261
  if (this.type === 'file') {
4251
4262
  this.filePlaceholder = this.modelValue.replace(/.*[/\\]/, '');
4252
4263
  }
@@ -4254,6 +4265,9 @@ function templatevue_type_template_id_1e758708_ts_true_render(_ctx, _cache, $pro
4254
4265
  this.setInvalid('This field may not be blank.');
4255
4266
  } else {
4256
4267
  switch (this.type) {
4268
+ case 'number':
4269
+ this.validateNumber();
4270
+ break;
4257
4271
  case 'email':
4258
4272
  this.validateEMail();
4259
4273
  break;
@@ -4276,6 +4290,31 @@ function templatevue_type_template_id_1e758708_ts_true_render(_ctx, _cache, $pro
4276
4290
  this.setInvalid(this.error);
4277
4291
  }
4278
4292
  },
4293
+ validateNumber: function () {
4294
+ const modelValue = this.modelValue.trim();
4295
+ if (!/^-?[0-9]*$/.test(modelValue.trim())) {
4296
+ this.setInvalid('Please enter a number.');
4297
+ return;
4298
+ }
4299
+ const val = parseInt(modelValue.trim());
4300
+ if (val.toString() !== modelValue) {
4301
+ this.setInvalid('Please enter a number.');
4302
+ return;
4303
+ }
4304
+ if (this.min !== undefined && this.max !== undefined) {
4305
+ if (val < parseInt(this.min) || val > parseInt(this.max)) {
4306
+ this.setInvalid(`Please enter a number between ${this.min} and ${this.max}.`);
4307
+ }
4308
+ } else if (this.min !== undefined) {
4309
+ if (val < parseInt(this.min)) {
4310
+ this.setInvalid(`Please enter a number >= ${this.min}.`);
4311
+ }
4312
+ } else if (this.max !== undefined) {
4313
+ if (val > parseInt(this.max)) {
4314
+ this.setInvalid(`Please enter a number <= ${this.max}.`);
4315
+ }
4316
+ }
4317
+ },
4279
4318
  validateEMail: function () {
4280
4319
  if (!/^[^\s@]+@[^\s@]+\.[^\s@]+[^\s@.]$/.test(this.modelValue)) {
4281
4320
  this.setInvalid('Please enter a valid email address.');
@@ -4305,7 +4344,7 @@ function templatevue_type_template_id_1e758708_ts_true_render(_ctx, _cache, $pro
4305
4344
 
4306
4345
 
4307
4346
  ;
4308
- const ClField_template_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ClField_templatevue_type_script_lang_ts, [['render',templatevue_type_template_id_1e758708_ts_true_render]])
4347
+ const ClField_template_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ClField_templatevue_type_script_lang_ts, [['render',templatevue_type_template_id_7afc34d1_ts_true_render]])
4309
4348
 
4310
4349
  /* harmony default export */ var ClField_template = (ClField_template_exports_);
4311
4350
  ;// ./src/components/form/ClField/index.ts
@@ -4951,7 +4990,7 @@ const templatevue_type_template_id_cd5029d0_ts_true_hoisted_7 = {
4951
4990
  key: 1,
4952
4991
  class: "modal-body"
4953
4992
  };
4954
- const templatevue_type_template_id_cd5029d0_ts_true_hoisted_8 = {
4993
+ const _hoisted_8 = {
4955
4994
  class: "modal-footer"
4956
4995
  };
4957
4996
  const _hoisted_9 = {
@@ -4983,7 +5022,7 @@ function templatevue_type_template_id_cd5029d0_ts_true_render(_ctx, _cache, $pro
4983
5022
  class: "modal-body cl-form container",
4984
5023
  novalidate: "",
4985
5024
  onSubmit: _cache[0] || (_cache[0] = (0,external_vue_.withModifiers)(() => {}, ["prevent"]))
4986
- }, [(0,external_vue_.renderSlot)(_ctx.$slots, "default"), (0,external_vue_.renderSlot)(_ctx.$slots, "body")], 40, templatevue_type_template_id_cd5029d0_ts_true_hoisted_6)) : ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", templatevue_type_template_id_cd5029d0_ts_true_hoisted_7, [(0,external_vue_.renderSlot)(_ctx.$slots, "default"), (0,external_vue_.renderSlot)(_ctx.$slots, "body")])), (0,external_vue_.createElementVNode)("div", templatevue_type_template_id_cd5029d0_ts_true_hoisted_8, [(0,external_vue_.createElementVNode)("span", _hoisted_9, [(0,external_vue_.renderSlot)(_ctx.$slots, "footer-left")]), (0,external_vue_.createElementVNode)("span", _hoisted_10, [(0,external_vue_.renderSlot)(_ctx.$slots, "footer")]), (0,external_vue_.createElementVNode)("span", _hoisted_11, [(0,external_vue_.renderSlot)(_ctx.$slots, "footer-right")])])])])], 10, templatevue_type_template_id_cd5029d0_ts_true_hoisted_1);
5025
+ }, [(0,external_vue_.renderSlot)(_ctx.$slots, "default"), (0,external_vue_.renderSlot)(_ctx.$slots, "body")], 40, templatevue_type_template_id_cd5029d0_ts_true_hoisted_6)) : ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", templatevue_type_template_id_cd5029d0_ts_true_hoisted_7, [(0,external_vue_.renderSlot)(_ctx.$slots, "default"), (0,external_vue_.renderSlot)(_ctx.$slots, "body")])), (0,external_vue_.createElementVNode)("div", _hoisted_8, [(0,external_vue_.createElementVNode)("span", _hoisted_9, [(0,external_vue_.renderSlot)(_ctx.$slots, "footer-left")]), (0,external_vue_.createElementVNode)("span", _hoisted_10, [(0,external_vue_.renderSlot)(_ctx.$slots, "footer")]), (0,external_vue_.createElementVNode)("span", _hoisted_11, [(0,external_vue_.renderSlot)(_ctx.$slots, "footer-right")])])])])], 10, templatevue_type_template_id_cd5029d0_ts_true_hoisted_1);
4987
5026
  }
4988
5027
  ;// ./src/components/modal/ClModal/template.vue?vue&type=template&id=cd5029d0&ts=true
4989
5028