quasar-ui-sellmate-ui-kit 1.3.21 → 1.3.24

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,5 +1,5 @@
1
1
  /*!
2
- * quasar-ui-sellmate-ui-kit v1.3.20
2
+ * quasar-ui-sellmate-ui-kit v1.3.23
3
3
  * (c) 2023 Sellmate Dev Team <dev@sellmate.co.kr>
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * quasar-ui-sellmate-ui-kit v1.3.20
2
+ * quasar-ui-sellmate-ui-kit v1.3.23
3
3
  * (c) 2023 Sellmate Dev Team <dev@sellmate.co.kr>
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * quasar-ui-sellmate-ui-kit v1.3.20
2
+ * quasar-ui-sellmate-ui-kit v1.3.23
3
3
  * (c) 2023 Sellmate Dev Team <dev@sellmate.co.kr>
4
4
  * Released under the MIT License.
5
5
  */
package/dist/index.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * quasar-ui-sellmate-ui-kit v1.3.20
2
+ * quasar-ui-sellmate-ui-kit v1.3.23
3
3
  * (c) 2023 Sellmate Dev Team <dev@sellmate.co.kr>
4
4
  * Released under the MIT License.
5
5
  */
@@ -703,6 +703,19 @@
703
703
 
704
704
  script$r.render = render$r;
705
705
 
706
+ function useModelBinder(props) {
707
+ var ref$1 = vue.getCurrentInstance();
708
+ var emit = ref$1.emit;
709
+ var model = vue.ref(props.modelValue);
710
+ vue.watch(function () { return model.value; }, function () {
711
+ emit('update:model-value', model.value);
712
+ }, { deep: true });
713
+ vue.watch(function () { return props.modelValue; }, function (newValue) {
714
+ model.value = newValue;
715
+ }, { deep: true });
716
+ return model;
717
+ }
718
+
706
719
  var locale = {
707
720
  ko: {
708
721
  daysShort: ['일', '월', '화', '수', '목', '금', '토'],
@@ -787,7 +800,7 @@
787
800
  var emit = ref$1.emit;
788
801
 
789
802
  var calendarOpen = vue.ref(false);
790
- var dateValue = vue.ref(props.modelValue);
803
+ var dateValue = useModelBinder(props);
791
804
  var inputDate = vue.ref(((dateValue.value.from) + " ~ " + (dateValue.value.to)));
792
805
 
793
806
  function resetDate() {
@@ -796,13 +809,6 @@
796
809
  dateValue.value.to = quasar.date.formatDate(todayReset, 'YYYY-MM-DD');
797
810
  }
798
811
 
799
- function dateUpdate() {
800
- if (dateValue.value.from && dateValue.value.to) {
801
- calendarOpen.value = false;
802
- }
803
- emit('update:modelValue', dateValue.value);
804
- }
805
-
806
812
  function deleteDate() {
807
813
  dateValue.value.from = null;
808
814
  dateValue.value.to = null;
@@ -897,7 +903,6 @@
897
903
  dateValue: dateValue,
898
904
  inputDate: inputDate,
899
905
  resetDate: resetDate,
900
- dateUpdate: dateUpdate,
901
906
  getRangeStartDay: getRangeStartDay,
902
907
  getRangeEndDay: getRangeEndDay,
903
908
  optionsFn: optionsFn,
@@ -974,10 +979,7 @@
974
979
  default: vue.withCtx(function () { return [
975
980
  vue.createVNode(_component_q_date, {
976
981
  modelValue: _ctx.dateValue.from,
977
- "onUpdate:modelValue": [
978
- _cache[0] || (_cache[0] = function ($event) { return ((_ctx.dateValue.from) = $event); }),
979
- _ctx.dateUpdate
980
- ],
982
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { return ((_ctx.dateValue.from) = $event); }),
981
983
  minimal: "",
982
984
  square: "",
983
985
  color: "positive",
@@ -986,14 +988,11 @@
986
988
  locale: _ctx.lang ? _ctx.locale[_ctx.lang] : {},
987
989
  options: _ctx.optionsStartFn,
988
990
  onRangeStart: _ctx.getRangeStartDay
989
- }, null, 8, ["modelValue", "locale", "options", "onRangeStart", "onUpdate:modelValue"]),
991
+ }, null, 8, ["modelValue", "locale", "options", "onRangeStart"]),
990
992
  vue.createVNode(_component_q_separator, { vertical: "" }),
991
993
  vue.createVNode(_component_q_date, {
992
994
  modelValue: _ctx.dateValue.to,
993
- "onUpdate:modelValue": [
994
- _cache[1] || (_cache[1] = function ($event) { return ((_ctx.dateValue.to) = $event); }),
995
- _ctx.dateUpdate
996
- ],
995
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) { return ((_ctx.dateValue.to) = $event); }),
997
996
  minimal: "",
998
997
  square: "",
999
998
  color: "positive",
@@ -1013,7 +1012,7 @@
1013
1012
  }, null, 8, ["onClick"])
1014
1013
  ]; }),
1015
1014
  _: 1
1016
- }, 8, ["modelValue", "locale", "options", "onRangeEnd", "onUpdate:modelValue"])
1015
+ }, 8, ["modelValue", "locale", "options", "onRangeEnd"])
1017
1016
  ]; }),
1018
1017
  _: 1
1019
1018
  }, 8, ["modelValue"])
@@ -3920,19 +3919,6 @@
3920
3919
 
3921
3920
  script$4.render = render$4;
3922
3921
 
3923
- function useModelBinder(props) {
3924
- var ref$1 = vue.getCurrentInstance();
3925
- var emit = ref$1.emit;
3926
- var model = vue.ref(props.modelValue);
3927
- vue.watch(function () { return model.value; }, function () {
3928
- emit('update:model-value', model.value);
3929
- }, { deep: true });
3930
- vue.watch(function () { return props.modelValue; }, function (newValue) {
3931
- model.value = newValue;
3932
- }, { deep: true });
3933
- return model;
3934
- }
3935
-
3936
3922
  var script$3 = {
3937
3923
  name: 'TimePickerCard',
3938
3924
  emits: ['update:model-value'],
@@ -4163,12 +4149,55 @@
4163
4149
  default: '',
4164
4150
  },
4165
4151
  },
4166
- setup: function setup(props) {
4152
+ setup: function setup(props, ref$1) {
4153
+ var emit = ref$1.emit;
4154
+
4167
4155
  var model = vue.ref(props.modelValue);
4156
+ var display = vue.ref(typeof model.value !== 'string' ? Object.assign({}, model.value) : model.value);
4157
+ function timeFormat(time) {
4158
+ if (typeof time === 'string') {
4159
+ var hour = Number(time.split(':')[0]);
4160
+ var minute = Number(time.split(':')[1]);
4161
+ var isAm = hour < 12;
4162
+ time = (hour === 12 ? hour : (("0" + (hour % 12))).slice(-2)) + ":" + minute + " " + (isAm ? 'AM' : 'PM');
4163
+ return time;
4164
+ }
4165
+ var toHour = Number(time.to.split(':')[0]);
4166
+ var fromHour = Number(time.from.split(':')[0]);
4167
+ var toMinute = time.to.split(':')[1];
4168
+ var fromMinute = time.from.split(':')[1];
4169
+ var toIsAm = toHour < 12;
4170
+ var fromIsAm = fromHour < 12;
4171
+ time.to = (toHour === 12 ? toHour : (("0" + (toHour % 12))).slice(-2)) + ":" + toMinute;
4172
+ time.to = (time.to) + " " + (toIsAm ? 'AM' : 'PM');
4173
+ time.from = (fromHour === 12 ? fromHour : (("0" + (fromHour % 12))).slice(-2)) + ":" + fromMinute;
4174
+ time.from = (time.from) + " " + (fromIsAm ? 'AM' : 'PM');
4175
+
4176
+ return time;
4177
+ }
4178
+ vue.onMounted(function () {
4179
+ display.value = timeFormat(display.value);
4180
+ });
4181
+
4182
+ function modelFormat(value) {
4183
+ var hour = Number(value.split(':')[0]);
4184
+ var minute = value.split(':')[1].split(' ')[0];
4185
+ return value.includes('PM') ? ((hour < 12 ? hour + 12 : hour) + ":" + minute) : ((hour < 12 ? (("0" + hour)).slice(-2) : '00') + ":" + minute);
4186
+ }
4187
+ function handleModel(val, key) {
4188
+ if (!key) {
4189
+ model.value = modelFormat(val);
4190
+ emit('update:modelValue', model.value);
4191
+ return;
4192
+ }
4193
+ model.value[key] = modelFormat(val);
4194
+ emit('update:modelValue', model.value);
4195
+ }
4196
+
4168
4197
  return {
4169
4198
  clockIcon: clockIcon,
4170
-
4171
- model: model,
4199
+ display: display,
4200
+ handleModel: handleModel,
4172
4201
  };
4173
4202
  },
4174
4203
  });
@@ -4212,7 +4241,7 @@
4212
4241
  (_ctx.range)
4213
4242
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [
4214
4243
  vue.createElementVNode("span", _hoisted_3, [
4215
- vue.createTextVNode(vue.toDisplayString(_ctx.model.from) + " ", 1),
4244
+ vue.createTextVNode(vue.toDisplayString(_ctx.display.from) + " ", 1),
4216
4245
  (!_ctx.disabled)
4217
4246
  ? (vue.openBlock(), vue.createBlock(_component_q_menu, {
4218
4247
  key: 0,
@@ -4221,8 +4250,11 @@
4221
4250
  }, {
4222
4251
  default: vue.withCtx(function () { return [
4223
4252
  vue.createVNode(_component_time_picker_card, {
4224
- modelValue: _ctx.model.from,
4225
- "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { return ((_ctx.model.from) = $event); })
4253
+ modelValue: _ctx.display.from,
4254
+ "onUpdate:modelValue": [
4255
+ _cache[0] || (_cache[0] = function ($event) { return ((_ctx.display.from) = $event); }),
4256
+ _cache[1] || (_cache[1] = function (val) { return _ctx.handleModel(val, 'from'); })
4257
+ ]
4226
4258
  }, null, 8, ["modelValue"])
4227
4259
  ]; }),
4228
4260
  _: 1
@@ -4231,7 +4263,7 @@
4231
4263
  ]),
4232
4264
  _hoisted_4,
4233
4265
  vue.createElementVNode("span", _hoisted_5, [
4234
- vue.createTextVNode(vue.toDisplayString(_ctx.model.to) + " ", 1),
4266
+ vue.createTextVNode(vue.toDisplayString(_ctx.display.to) + " ", 1),
4235
4267
  (!_ctx.disabled)
4236
4268
  ? (vue.openBlock(), vue.createBlock(_component_q_menu, {
4237
4269
  key: 0,
@@ -4240,8 +4272,11 @@
4240
4272
  }, {
4241
4273
  default: vue.withCtx(function () { return [
4242
4274
  vue.createVNode(_component_time_picker_card, {
4243
- modelValue: _ctx.model.to,
4244
- "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) { return ((_ctx.model.to) = $event); })
4275
+ modelValue: _ctx.display.to,
4276
+ "onUpdate:modelValue": [
4277
+ _cache[2] || (_cache[2] = function ($event) { return ((_ctx.display.to) = $event); }),
4278
+ _cache[3] || (_cache[3] = function (val) { return _ctx.handleModel(val, 'to'); })
4279
+ ]
4245
4280
  }, null, 8, ["modelValue"])
4246
4281
  ]; }),
4247
4282
  _: 1
@@ -4250,7 +4285,7 @@
4250
4285
  ])
4251
4286
  ]))
4252
4287
  : (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
4253
- vue.createTextVNode(vue.toDisplayString(_ctx.model) + " ", 1),
4288
+ vue.createTextVNode(vue.toDisplayString(_ctx.display) + " ", 1),
4254
4289
  (!_ctx.disabled)
4255
4290
  ? (vue.openBlock(), vue.createBlock(_component_q_menu, {
4256
4291
  key: 0,
@@ -4259,8 +4294,11 @@
4259
4294
  }, {
4260
4295
  default: vue.withCtx(function () { return [
4261
4296
  vue.createVNode(_component_time_picker_card, {
4262
- modelValue: _ctx.model,
4263
- "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) { return ((_ctx.model) = $event); })
4297
+ modelValue: _ctx.display,
4298
+ "onUpdate:modelValue": [
4299
+ _cache[4] || (_cache[4] = function ($event) { return ((_ctx.display) = $event); }),
4300
+ _cache[5] || (_cache[5] = function (val) { return _ctx.handleModel(val); })
4301
+ ]
4264
4302
  }, null, 8, ["modelValue"])
4265
4303
  ]; }),
4266
4304
  _: 1
@@ -4462,7 +4500,7 @@
4462
4500
 
4463
4501
 
4464
4502
 
4465
- var version = '1.3.20';
4503
+ var version = '1.3.23';
4466
4504
 
4467
4505
  function install(app) {
4468
4506
  app.component('s-breadcrumbs', script$y);