@neutron.co.id/operasional-interfaces 1.4.3-beta.1 → 1.4.3-beta.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/build/index.cjs CHANGED
@@ -19,9 +19,9 @@ const pinia = require("pinia");
19
19
  const vueRouter = require("vue-router");
20
20
  const component = require("@neon.id/utils/component");
21
21
  const personaliaModels = require("@neutron.co.id/personalia-models");
22
- const _hoisted_1$9 = { class: "xxx-button" };
22
+ const _hoisted_1$a = { class: "xxx-button" };
23
23
  const __default__$9 = vue.defineComponent({ name: "XxxButton" });
24
- const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
24
+ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
25
25
  ...__default__$9,
26
26
  props: {
27
27
  color: {
@@ -31,7 +31,7 @@ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
31
31
  },
32
32
  setup(__props) {
33
33
  return (_ctx, _cache) => {
34
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
34
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
35
35
  vue.createVNode(vue.unref(interfaces.NeonButton), { label: "XXX" })
36
36
  ]);
37
37
  };
@@ -5109,13 +5109,13 @@ function cleanEscapedString(input) {
5109
5109
  function startOfToday() {
5110
5110
  return startOfDay(Date.now());
5111
5111
  }
5112
- const _hoisted_1$8 = { class: "operasional-identitas" };
5112
+ const _hoisted_1$9 = { class: "operasional-identitas" };
5113
5113
  const _hoisted_2$5 = {
5114
5114
  key: 2,
5115
5115
  class: "section"
5116
5116
  };
5117
5117
  const __default__$8 = vue.defineComponent({ name: "OperasionalIdentitas" });
5118
- const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
5118
+ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
5119
5119
  ...__default__$8,
5120
5120
  props: {
5121
5121
  profile: {
@@ -5369,7 +5369,7 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
5369
5369
  candidateId.value = null;
5370
5370
  }
5371
5371
  return (_ctx, _cache) => {
5372
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
5372
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
5373
5373
  state.value === "connect" ? (vue.openBlock(), vue.createBlock(vue.unref(identitasInterfaces.IdentitasConnect), {
5374
5374
  key: 0,
5375
5375
  user: vue.unref(user),
@@ -5470,7 +5470,7 @@ const _export_sfc = (sfc, props) => {
5470
5470
  }
5471
5471
  return target;
5472
5472
  };
5473
- const OperasionalIdentitas = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-780f9c83"]]);
5473
+ const OperasionalIdentitas = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-780f9c83"]]);
5474
5474
  const CheckInModel = tempatModels.models.CheckInModel;
5475
5475
  const useOperasionalStore = pinia.defineStore("neu:operasional", () => {
5476
5476
  const isLoading = vue.ref(false);
@@ -5611,8 +5611,8 @@ function mitt(n) {
5611
5611
  } };
5612
5612
  }
5613
5613
  const bus = mitt();
5614
- const _withScopeId$2 = (n) => (vue.pushScopeId("data-v-6c1902ac"), n = n(), vue.popScopeId(), n);
5615
- const _hoisted_1$7 = { id: "view-checkIns" };
5614
+ const _withScopeId$2 = (n) => (vue.pushScopeId("data-v-89ba2448"), n = n(), vue.popScopeId(), n);
5615
+ const _hoisted_1$8 = { id: "view-checkIns" };
5616
5616
  const _hoisted_2$4 = { class: "summary" };
5617
5617
  const _hoisted_3$1 = { class: "wrapper" };
5618
5618
  const _hoisted_4$1 = { class: "header" };
@@ -5630,7 +5630,7 @@ const _hoisted_6 = { class: "end" };
5630
5630
  const __default__$7 = vue.defineComponent({
5631
5631
  name: "CheckInPresenceCollection"
5632
5632
  });
5633
- const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
5633
+ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
5634
5634
  ...__default__$7,
5635
5635
  setup(__props) {
5636
5636
  const collectionBus = core.useEventBus("neu:tempat:checkIn");
@@ -5766,9 +5766,9 @@ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
5766
5766
  return checkInId;
5767
5767
  }
5768
5768
  return (_ctx, _cache) => {
5769
- const _component_CheckInSingleView = vue.resolveComponent("CheckInSingleView");
5769
+ const _component_CheckInSingleExternalView = vue.resolveComponent("CheckInSingleExternalView");
5770
5770
  const _component_CheckInCollection = vue.resolveComponent("CheckInCollection");
5771
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
5771
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
5772
5772
  vue.createVNode(vue.unref(office.OfficeContent), {
5773
5773
  icon: "barcode-read",
5774
5774
  title: "Presensi",
@@ -5868,7 +5868,7 @@ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
5868
5868
  onClose: onModalClose
5869
5869
  }, {
5870
5870
  default: vue.withCtx(() => [
5871
- vue.createVNode(_component_CheckInSingleView, {
5871
+ vue.createVNode(_component_CheckInSingleExternalView, {
5872
5872
  id: id.value,
5873
5873
  "is-new": "",
5874
5874
  "is-main": false,
@@ -5931,10 +5931,10 @@ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
5931
5931
  };
5932
5932
  }
5933
5933
  });
5934
- const CheckInPresenceCollection_vue_vue_type_style_index_0_scoped_6c1902ac_lang = "";
5935
- const CheckInPresenceCollection = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-6c1902ac"]]);
5936
- const _hoisted_1$6 = { class: "grid gap-4 sm:grid-cols-2" };
5937
- const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
5934
+ const CheckInPresenceCollection_vue_vue_type_style_index_0_scoped_89ba2448_lang = "";
5935
+ const CheckInPresenceCollection = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-89ba2448"]]);
5936
+ const _hoisted_1$7 = { class: "grid gap-4 sm:grid-cols-2" };
5937
+ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
5938
5938
  __name: "CheckInSingle",
5939
5939
  setup(__props) {
5940
5940
  const {
@@ -5992,7 +5992,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
5992
5992
  field: vue.unref(fields).building,
5993
5993
  "is-disabled": ""
5994
5994
  }, null, 8, ["modelValue", "field"]),
5995
- vue.createElementVNode("div", _hoisted_1$6, [
5995
+ vue.createElementVNode("div", _hoisted_1$7, [
5996
5996
  vue.createVNode(vue.unref(form.NeonField), vue.mergeProps({
5997
5997
  modelValue: vue.unref(values).type,
5998
5998
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.unref(values).type = $event)
@@ -6032,7 +6032,107 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
6032
6032
  }
6033
6033
  });
6034
6034
  const CheckInSingle_vue_vue_type_style_index_0_scoped_2e2803fb_lang = "";
6035
- const CheckInSingle = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-2e2803fb"]]);
6035
+ const CheckInSingle = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-2e2803fb"]]);
6036
+ const _hoisted_1$6 = { class: "grid gap-4 sm:grid-cols-2" };
6037
+ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
6038
+ __name: "CheckInExternal",
6039
+ setup(__props) {
6040
+ const {
6041
+ fields,
6042
+ id,
6043
+ initialValues,
6044
+ values,
6045
+ isLoading,
6046
+ isChanged,
6047
+ isReady,
6048
+ isMain,
6049
+ isNew,
6050
+ saveOne,
6051
+ discardChanges,
6052
+ getOne
6053
+ } = context.useSingle();
6054
+ const { staff } = useOperasional();
6055
+ vue.onMounted(() => {
6056
+ var _a, _b, _c;
6057
+ console.log("idnya?", id.value);
6058
+ if (id.value === "new") {
6059
+ values.value.staffId = (_a = staff.value) == null ? void 0 : _a.id;
6060
+ values.value.staff = {
6061
+ id: (_b = staff.value) == null ? void 0 : _b.id,
6062
+ display: (_c = staff.value) == null ? void 0 : _c.display
6063
+ };
6064
+ values.value.checkInAt = new Date().toISOString();
6065
+ values.value.type = "checkpoint";
6066
+ }
6067
+ });
6068
+ return (_ctx, _cache) => {
6069
+ return vue.openBlock(), vue.createBlock(vue.unref(context.NeonSingle), { class: "neu-checkIn-single" }, {
6070
+ default: vue.withCtx(() => [
6071
+ vue.createVNode(vue.unref(office.OfficeTabs), { "use-url": vue.unref(isMain) }, {
6072
+ default: vue.withCtx(() => [
6073
+ vue.createVNode(vue.unref(office.OfficeTab), {
6074
+ handle: "info",
6075
+ icon: "circle-info",
6076
+ title: "Info"
6077
+ }, {
6078
+ default: vue.withCtx(() => [
6079
+ vue.createVNode(vue.unref(form.NeonForm), {
6080
+ handle: "info",
6081
+ "initial-values": vue.unref(initialValues),
6082
+ "is-loading": vue.unref(isLoading),
6083
+ "is-changed": vue.unref(isChanged),
6084
+ "use-unsaved": "",
6085
+ onCancel: vue.unref(discardChanges),
6086
+ onSubmit: vue.unref(saveOne)
6087
+ }, {
6088
+ default: vue.withCtx(() => [
6089
+ vue.unref(values).type === "in" || vue.unref(values).type === "out" ? (vue.openBlock(), vue.createBlock(vue.unref(office.OfficeRelation), {
6090
+ key: 0,
6091
+ modelValue: vue.unref(values),
6092
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(values) ? values.value = $event : null),
6093
+ field: vue.unref(fields).building
6094
+ }, null, 8, ["modelValue", "field"])) : vue.createCommentVNode("v-if", true),
6095
+ vue.createElementVNode("div", _hoisted_1$6, [
6096
+ vue.createVNode(vue.unref(form.NeonField), vue.mergeProps({
6097
+ modelValue: vue.unref(values).type,
6098
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.unref(values).type = $event)
6099
+ }, vue.unref(fields).type, { "is-disabled": "" }), null, 16, ["modelValue"]),
6100
+ vue.createVNode(vue.unref(form.NeonField), vue.mergeProps({
6101
+ modelValue: vue.unref(values).checkInAt,
6102
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.unref(values).checkInAt = $event)
6103
+ }, vue.unref(fields).checkInAt, { "is-disabled": "" }), null, 16, ["modelValue"])
6104
+ ]),
6105
+ vue.createVNode(vue.unref(office.OfficeRelation), {
6106
+ modelValue: vue.unref(values),
6107
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => vue.isRef(values) ? values.value = $event : null),
6108
+ field: vue.unref(fields).staff,
6109
+ "is-disabled": ""
6110
+ }, null, 8, ["modelValue", "field"]),
6111
+ vue.createVNode(vue.unref(form.NeonField), vue.mergeProps({
6112
+ modelValue: vue.unref(values).note,
6113
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => vue.unref(values).note = $event)
6114
+ }, vue.unref(fields).note), null, 16, ["modelValue"])
6115
+ ]),
6116
+ _: 1
6117
+ /* STABLE */
6118
+ }, 8, ["initial-values", "is-loading", "is-changed", "onCancel", "onSubmit"])
6119
+ ]),
6120
+ _: 1
6121
+ /* STABLE */
6122
+ })
6123
+ ]),
6124
+ _: 1
6125
+ /* STABLE */
6126
+ }, 8, ["use-url"])
6127
+ ]),
6128
+ _: 1
6129
+ /* STABLE */
6130
+ });
6131
+ };
6132
+ }
6133
+ });
6134
+ const CheckInExternal_vue_vue_type_style_index_0_scoped_3c28699a_lang = "";
6135
+ const CheckInExternal = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-3c28699a"]]);
6036
6136
  const _withScopeId$1 = (n) => (vue.pushScopeId("data-v-d23b6de5"), n = n(), vue.popScopeId(), n);
6037
6137
  const _hoisted_1$5 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode(
6038
6138
  "h4",
@@ -7285,26 +7385,43 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
7285
7385
  discardChanges
7286
7386
  } = context.useSingle();
7287
7387
  const authStore = identitasInterfaces.useAuthStore();
7288
- const { userId } = pinia.storeToRefs(authStore);
7388
+ pinia.storeToRefs(authStore);
7289
7389
  const { staff } = useOperasional();
7290
- vue.onMounted(() => {
7291
- var _a, _b, _c, _d, _e, _f;
7292
- if (id.value === "new") {
7293
- values.value.situationReportedByIds = [((_a = staff.value) == null ? void 0 : _a.id) || ""];
7294
- values.value.branchIds = [((_b = staff.value) == null ? void 0 : _b.branchId) || ""];
7295
- values.value.userId = userId.value;
7390
+ vue.watch(
7391
+ isNew,
7392
+ (isNew2) => {
7393
+ var _a, _b, _c, _d, _e;
7394
+ const branch = ((_a = staff.value) == null ? void 0 : _a.branchIds) || [];
7395
+ const branchDisplay = ((_b = staff.value) == null ? void 0 : _b.branches) || [];
7396
+ if (!isNew2)
7397
+ return;
7398
+ values.value.situationReportedByIds = [((_c = staff.value) == null ? void 0 : _c.id) || ""];
7296
7399
  values.value.situationReportedBy = [
7297
7400
  {
7298
- id: (_c = staff.value) == null ? void 0 : _c.id,
7299
- display: (_d = staff.value) == null ? void 0 : _d.display
7401
+ id: (_d = staff.value) == null ? void 0 : _d.id,
7402
+ display: (_e = staff.value) == null ? void 0 : _e.display
7300
7403
  }
7301
7404
  ];
7302
- }
7303
- if (isChanged) {
7304
- values.value.situationReportedByIds = [((_e = staff.value) == null ? void 0 : _e.id) || ""];
7305
- values.value.branchIds = [((_f = staff.value) == null ? void 0 : _f.branchId) || ""];
7306
- values.value.userId = userId.value;
7307
- }
7405
+ values.value.branchIds = [branch[0]];
7406
+ values.value.branches = [branchDisplay[0]];
7407
+ },
7408
+ { immediate: true }
7409
+ );
7410
+ const onTypeState = vue.computed(() => {
7411
+ var _a;
7412
+ return query.Query.define({
7413
+ filter: {
7414
+ branchIds: { $in: (_a = staff.value) == null ? void 0 : _a.branchIds }
7415
+ }
7416
+ });
7417
+ });
7418
+ const onBranchState = vue.computed(() => {
7419
+ var _a;
7420
+ return query.Query.define({
7421
+ filter: {
7422
+ _id: { $in: (_a = staff.value) == null ? void 0 : _a.branchIds }
7423
+ }
7424
+ });
7308
7425
  });
7309
7426
  return (_ctx, _cache) => {
7310
7427
  return vue.openBlock(), vue.createBlock(vue.unref(context.NeonSingle), { class: "neu-situation-single" }, {
@@ -7344,18 +7461,21 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
7344
7461
  modelValue: vue.unref(values),
7345
7462
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.isRef(values) ? values.value = $event : null),
7346
7463
  field: vue.unref(fields).branches,
7347
- fragment: { id: 1, display: 1, name: 1 }
7348
- }, null, 8, ["modelValue", "field"]),
7464
+ fragment: { id: 1, display: 1, name: 1 },
7465
+ query: vue.unref(onBranchState)
7466
+ }, null, 8, ["modelValue", "field", "query"]),
7349
7467
  vue.createVNode(vue.unref(office.OfficeRelation), {
7350
7468
  modelValue: vue.unref(values),
7351
7469
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.isRef(values) ? values.value = $event : null),
7352
- field: vue.unref(fields).situationType
7353
- }, null, 8, ["modelValue", "field"]),
7470
+ field: vue.unref(fields).situationType,
7471
+ query: vue.unref(onTypeState)
7472
+ }, null, 8, ["modelValue", "field", "query"]),
7354
7473
  vue.createVNode(vue.unref(office.OfficeRelation), {
7355
7474
  modelValue: vue.unref(values),
7356
7475
  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => vue.isRef(values) ? values.value = $event : null),
7357
7476
  field: vue.unref(fields).situationReportedBy,
7358
- fragment: { id: 1, display: 1, name: 1 }
7477
+ fragment: { id: 1, display: 1, name: 1 },
7478
+ "is-disabled": ""
7359
7479
  }, null, 8, ["modelValue", "field"]),
7360
7480
  vue.createVNode(vue.unref(form.NeonFields), { md: "grid-cols-4" }, {
7361
7481
  default: vue.withCtx(() => [
@@ -8064,16 +8184,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
8064
8184
  discardChanges
8065
8185
  } = context.useSingle();
8066
8186
  const authStore = identitasInterfaces.useAuthStore();
8067
- const { userId } = pinia.storeToRefs(authStore);
8187
+ pinia.storeToRefs(authStore);
8068
8188
  useOperasional();
8069
- vue.onMounted(() => {
8070
- if (id.value === "new") {
8071
- values.value.userId = userId.value;
8072
- }
8073
- if (isChanged) {
8074
- values.value.userId = userId.value;
8075
- }
8076
- });
8077
8189
  function onChangeDateUpdate(date) {
8078
8190
  values.value.estimatedStartDate = date == null ? void 0 : date.start.toISOString();
8079
8191
  values.value.estimatedEndDate = date == null ? void 0 : date.end.toISOString();
@@ -8291,6 +8403,7 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
8291
8403
  __proto__: null,
8292
8404
  CheckInAccess,
8293
8405
  CheckInCollection: _sfc_main$d,
8406
+ CheckInExternal,
8294
8407
  CheckInModel,
8295
8408
  CheckInPresenceCollection,
8296
8409
  CheckInScanError: _sfc_main$g,
@@ -8315,7 +8428,7 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
8315
8428
  TaskSingle: _sfc_main$1,
8316
8429
  TaskWork: _sfc_main,
8317
8430
  TaskWorkButton: _sfc_main$3,
8318
- XxxButton: _sfc_main$l
8431
+ XxxButton: _sfc_main$m
8319
8432
  }, Symbol.toStringTag, { value: "Module" }));
8320
8433
  function registerComponents(app) {
8321
8434
  Object.entries(components).forEach(([name, component2]) => {
@@ -8434,6 +8547,7 @@ const qrScannerWorker_min = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object
8434
8547
  }, Symbol.toStringTag, { value: "Module" }));
8435
8548
  exports.CheckInAccess = CheckInAccess;
8436
8549
  exports.CheckInCollection = _sfc_main$d;
8550
+ exports.CheckInExternal = CheckInExternal;
8437
8551
  exports.CheckInModel = CheckInModel;
8438
8552
  exports.CheckInPresenceCollection = CheckInPresenceCollection;
8439
8553
  exports.CheckInScanError = _sfc_main$g;
@@ -8461,7 +8575,7 @@ exports.TaskModel = TaskModel;
8461
8575
  exports.TaskSingle = _sfc_main$1;
8462
8576
  exports.TaskWork = _sfc_main;
8463
8577
  exports.TaskWorkButton = _sfc_main$3;
8464
- exports.XxxButton = _sfc_main$l;
8578
+ exports.XxxButton = _sfc_main$m;
8465
8579
  exports.bus = bus;
8466
8580
  exports.useAttendanceStore = useAttendanceStore;
8467
8581
  exports.useOperasional = useOperasional;
package/build/index.mjs CHANGED
@@ -17,9 +17,9 @@ import { defineStore, storeToRefs } from "pinia";
17
17
  import { useRouter } from "vue-router";
18
18
  import { ComponentUtil } from "@neon.id/utils/component";
19
19
  import { models as models$2 } from "@neutron.co.id/personalia-models";
20
- const _hoisted_1$9 = { class: "xxx-button" };
20
+ const _hoisted_1$a = { class: "xxx-button" };
21
21
  const __default__$9 = defineComponent({ name: "XxxButton" });
22
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
22
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
23
23
  ...__default__$9,
24
24
  props: {
25
25
  color: {
@@ -29,7 +29,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
29
29
  },
30
30
  setup(__props) {
31
31
  return (_ctx, _cache) => {
32
- return openBlock(), createElementBlock("div", _hoisted_1$9, [
32
+ return openBlock(), createElementBlock("div", _hoisted_1$a, [
33
33
  createVNode(unref(NeonButton), { label: "XXX" })
34
34
  ]);
35
35
  };
@@ -5107,13 +5107,13 @@ function cleanEscapedString(input) {
5107
5107
  function startOfToday() {
5108
5108
  return startOfDay(Date.now());
5109
5109
  }
5110
- const _hoisted_1$8 = { class: "operasional-identitas" };
5110
+ const _hoisted_1$9 = { class: "operasional-identitas" };
5111
5111
  const _hoisted_2$5 = {
5112
5112
  key: 2,
5113
5113
  class: "section"
5114
5114
  };
5115
5115
  const __default__$8 = defineComponent({ name: "OperasionalIdentitas" });
5116
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
5116
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
5117
5117
  ...__default__$8,
5118
5118
  props: {
5119
5119
  profile: {
@@ -5367,7 +5367,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
5367
5367
  candidateId.value = null;
5368
5368
  }
5369
5369
  return (_ctx, _cache) => {
5370
- return openBlock(), createElementBlock("div", _hoisted_1$8, [
5370
+ return openBlock(), createElementBlock("div", _hoisted_1$9, [
5371
5371
  state.value === "connect" ? (openBlock(), createBlock(unref(IdentitasConnect), {
5372
5372
  key: 0,
5373
5373
  user: unref(user),
@@ -5468,7 +5468,7 @@ const _export_sfc = (sfc, props) => {
5468
5468
  }
5469
5469
  return target;
5470
5470
  };
5471
- const OperasionalIdentitas = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-780f9c83"]]);
5471
+ const OperasionalIdentitas = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-780f9c83"]]);
5472
5472
  const CheckInModel = models$1.CheckInModel;
5473
5473
  const useOperasionalStore = defineStore("neu:operasional", () => {
5474
5474
  const isLoading = ref(false);
@@ -5609,8 +5609,8 @@ function mitt(n) {
5609
5609
  } };
5610
5610
  }
5611
5611
  const bus = mitt();
5612
- const _withScopeId$2 = (n) => (pushScopeId("data-v-6c1902ac"), n = n(), popScopeId(), n);
5613
- const _hoisted_1$7 = { id: "view-checkIns" };
5612
+ const _withScopeId$2 = (n) => (pushScopeId("data-v-89ba2448"), n = n(), popScopeId(), n);
5613
+ const _hoisted_1$8 = { id: "view-checkIns" };
5614
5614
  const _hoisted_2$4 = { class: "summary" };
5615
5615
  const _hoisted_3$1 = { class: "wrapper" };
5616
5616
  const _hoisted_4$1 = { class: "header" };
@@ -5628,7 +5628,7 @@ const _hoisted_6 = { class: "end" };
5628
5628
  const __default__$7 = defineComponent({
5629
5629
  name: "CheckInPresenceCollection"
5630
5630
  });
5631
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
5631
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
5632
5632
  ...__default__$7,
5633
5633
  setup(__props) {
5634
5634
  const collectionBus = useEventBus("neu:tempat:checkIn");
@@ -5764,9 +5764,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
5764
5764
  return checkInId;
5765
5765
  }
5766
5766
  return (_ctx, _cache) => {
5767
- const _component_CheckInSingleView = resolveComponent("CheckInSingleView");
5767
+ const _component_CheckInSingleExternalView = resolveComponent("CheckInSingleExternalView");
5768
5768
  const _component_CheckInCollection = resolveComponent("CheckInCollection");
5769
- return openBlock(), createElementBlock("div", _hoisted_1$7, [
5769
+ return openBlock(), createElementBlock("div", _hoisted_1$8, [
5770
5770
  createVNode(unref(OfficeContent), {
5771
5771
  icon: "barcode-read",
5772
5772
  title: "Presensi",
@@ -5866,7 +5866,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
5866
5866
  onClose: onModalClose
5867
5867
  }, {
5868
5868
  default: withCtx(() => [
5869
- createVNode(_component_CheckInSingleView, {
5869
+ createVNode(_component_CheckInSingleExternalView, {
5870
5870
  id: id.value,
5871
5871
  "is-new": "",
5872
5872
  "is-main": false,
@@ -5929,10 +5929,10 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
5929
5929
  };
5930
5930
  }
5931
5931
  });
5932
- const CheckInPresenceCollection_vue_vue_type_style_index_0_scoped_6c1902ac_lang = "";
5933
- const CheckInPresenceCollection = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-6c1902ac"]]);
5934
- const _hoisted_1$6 = { class: "grid gap-4 sm:grid-cols-2" };
5935
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
5932
+ const CheckInPresenceCollection_vue_vue_type_style_index_0_scoped_89ba2448_lang = "";
5933
+ const CheckInPresenceCollection = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-89ba2448"]]);
5934
+ const _hoisted_1$7 = { class: "grid gap-4 sm:grid-cols-2" };
5935
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
5936
5936
  __name: "CheckInSingle",
5937
5937
  setup(__props) {
5938
5938
  const {
@@ -5990,7 +5990,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
5990
5990
  field: unref(fields).building,
5991
5991
  "is-disabled": ""
5992
5992
  }, null, 8, ["modelValue", "field"]),
5993
- createElementVNode("div", _hoisted_1$6, [
5993
+ createElementVNode("div", _hoisted_1$7, [
5994
5994
  createVNode(unref(NeonField), mergeProps({
5995
5995
  modelValue: unref(values).type,
5996
5996
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(values).type = $event)
@@ -6030,7 +6030,107 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
6030
6030
  }
6031
6031
  });
6032
6032
  const CheckInSingle_vue_vue_type_style_index_0_scoped_2e2803fb_lang = "";
6033
- const CheckInSingle = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-2e2803fb"]]);
6033
+ const CheckInSingle = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-2e2803fb"]]);
6034
+ const _hoisted_1$6 = { class: "grid gap-4 sm:grid-cols-2" };
6035
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
6036
+ __name: "CheckInExternal",
6037
+ setup(__props) {
6038
+ const {
6039
+ fields,
6040
+ id,
6041
+ initialValues,
6042
+ values,
6043
+ isLoading,
6044
+ isChanged,
6045
+ isReady,
6046
+ isMain,
6047
+ isNew,
6048
+ saveOne,
6049
+ discardChanges,
6050
+ getOne
6051
+ } = useSingle();
6052
+ const { staff } = useOperasional();
6053
+ onMounted(() => {
6054
+ var _a, _b, _c;
6055
+ console.log("idnya?", id.value);
6056
+ if (id.value === "new") {
6057
+ values.value.staffId = (_a = staff.value) == null ? void 0 : _a.id;
6058
+ values.value.staff = {
6059
+ id: (_b = staff.value) == null ? void 0 : _b.id,
6060
+ display: (_c = staff.value) == null ? void 0 : _c.display
6061
+ };
6062
+ values.value.checkInAt = new Date().toISOString();
6063
+ values.value.type = "checkpoint";
6064
+ }
6065
+ });
6066
+ return (_ctx, _cache) => {
6067
+ return openBlock(), createBlock(unref(NeonSingle), { class: "neu-checkIn-single" }, {
6068
+ default: withCtx(() => [
6069
+ createVNode(unref(OfficeTabs), { "use-url": unref(isMain) }, {
6070
+ default: withCtx(() => [
6071
+ createVNode(unref(OfficeTab), {
6072
+ handle: "info",
6073
+ icon: "circle-info",
6074
+ title: "Info"
6075
+ }, {
6076
+ default: withCtx(() => [
6077
+ createVNode(unref(NeonForm), {
6078
+ handle: "info",
6079
+ "initial-values": unref(initialValues),
6080
+ "is-loading": unref(isLoading),
6081
+ "is-changed": unref(isChanged),
6082
+ "use-unsaved": "",
6083
+ onCancel: unref(discardChanges),
6084
+ onSubmit: unref(saveOne)
6085
+ }, {
6086
+ default: withCtx(() => [
6087
+ unref(values).type === "in" || unref(values).type === "out" ? (openBlock(), createBlock(unref(OfficeRelation), {
6088
+ key: 0,
6089
+ modelValue: unref(values),
6090
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(values) ? values.value = $event : null),
6091
+ field: unref(fields).building
6092
+ }, null, 8, ["modelValue", "field"])) : createCommentVNode("v-if", true),
6093
+ createElementVNode("div", _hoisted_1$6, [
6094
+ createVNode(unref(NeonField), mergeProps({
6095
+ modelValue: unref(values).type,
6096
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(values).type = $event)
6097
+ }, unref(fields).type, { "is-disabled": "" }), null, 16, ["modelValue"]),
6098
+ createVNode(unref(NeonField), mergeProps({
6099
+ modelValue: unref(values).checkInAt,
6100
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(values).checkInAt = $event)
6101
+ }, unref(fields).checkInAt, { "is-disabled": "" }), null, 16, ["modelValue"])
6102
+ ]),
6103
+ createVNode(unref(OfficeRelation), {
6104
+ modelValue: unref(values),
6105
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(values) ? values.value = $event : null),
6106
+ field: unref(fields).staff,
6107
+ "is-disabled": ""
6108
+ }, null, 8, ["modelValue", "field"]),
6109
+ createVNode(unref(NeonField), mergeProps({
6110
+ modelValue: unref(values).note,
6111
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(values).note = $event)
6112
+ }, unref(fields).note), null, 16, ["modelValue"])
6113
+ ]),
6114
+ _: 1
6115
+ /* STABLE */
6116
+ }, 8, ["initial-values", "is-loading", "is-changed", "onCancel", "onSubmit"])
6117
+ ]),
6118
+ _: 1
6119
+ /* STABLE */
6120
+ })
6121
+ ]),
6122
+ _: 1
6123
+ /* STABLE */
6124
+ }, 8, ["use-url"])
6125
+ ]),
6126
+ _: 1
6127
+ /* STABLE */
6128
+ });
6129
+ };
6130
+ }
6131
+ });
6132
+ const CheckInExternal_vue_vue_type_style_index_0_scoped_3c28699a_lang = "";
6133
+ const CheckInExternal = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-3c28699a"]]);
6034
6134
  const _withScopeId$1 = (n) => (pushScopeId("data-v-d23b6de5"), n = n(), popScopeId(), n);
6035
6135
  const _hoisted_1$5 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode(
6036
6136
  "h4",
@@ -7283,26 +7383,43 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
7283
7383
  discardChanges
7284
7384
  } = useSingle();
7285
7385
  const authStore = useAuthStore();
7286
- const { userId } = storeToRefs(authStore);
7386
+ storeToRefs(authStore);
7287
7387
  const { staff } = useOperasional();
7288
- onMounted(() => {
7289
- var _a, _b, _c, _d, _e, _f;
7290
- if (id.value === "new") {
7291
- values.value.situationReportedByIds = [((_a = staff.value) == null ? void 0 : _a.id) || ""];
7292
- values.value.branchIds = [((_b = staff.value) == null ? void 0 : _b.branchId) || ""];
7293
- values.value.userId = userId.value;
7388
+ watch(
7389
+ isNew,
7390
+ (isNew2) => {
7391
+ var _a, _b, _c, _d, _e;
7392
+ const branch = ((_a = staff.value) == null ? void 0 : _a.branchIds) || [];
7393
+ const branchDisplay = ((_b = staff.value) == null ? void 0 : _b.branches) || [];
7394
+ if (!isNew2)
7395
+ return;
7396
+ values.value.situationReportedByIds = [((_c = staff.value) == null ? void 0 : _c.id) || ""];
7294
7397
  values.value.situationReportedBy = [
7295
7398
  {
7296
- id: (_c = staff.value) == null ? void 0 : _c.id,
7297
- display: (_d = staff.value) == null ? void 0 : _d.display
7399
+ id: (_d = staff.value) == null ? void 0 : _d.id,
7400
+ display: (_e = staff.value) == null ? void 0 : _e.display
7298
7401
  }
7299
7402
  ];
7300
- }
7301
- if (isChanged) {
7302
- values.value.situationReportedByIds = [((_e = staff.value) == null ? void 0 : _e.id) || ""];
7303
- values.value.branchIds = [((_f = staff.value) == null ? void 0 : _f.branchId) || ""];
7304
- values.value.userId = userId.value;
7305
- }
7403
+ values.value.branchIds = [branch[0]];
7404
+ values.value.branches = [branchDisplay[0]];
7405
+ },
7406
+ { immediate: true }
7407
+ );
7408
+ const onTypeState = computed(() => {
7409
+ var _a;
7410
+ return Query.define({
7411
+ filter: {
7412
+ branchIds: { $in: (_a = staff.value) == null ? void 0 : _a.branchIds }
7413
+ }
7414
+ });
7415
+ });
7416
+ const onBranchState = computed(() => {
7417
+ var _a;
7418
+ return Query.define({
7419
+ filter: {
7420
+ _id: { $in: (_a = staff.value) == null ? void 0 : _a.branchIds }
7421
+ }
7422
+ });
7306
7423
  });
7307
7424
  return (_ctx, _cache) => {
7308
7425
  return openBlock(), createBlock(unref(NeonSingle), { class: "neu-situation-single" }, {
@@ -7342,18 +7459,21 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
7342
7459
  modelValue: unref(values),
7343
7460
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(values) ? values.value = $event : null),
7344
7461
  field: unref(fields).branches,
7345
- fragment: { id: 1, display: 1, name: 1 }
7346
- }, null, 8, ["modelValue", "field"]),
7462
+ fragment: { id: 1, display: 1, name: 1 },
7463
+ query: unref(onBranchState)
7464
+ }, null, 8, ["modelValue", "field", "query"]),
7347
7465
  createVNode(unref(OfficeRelation), {
7348
7466
  modelValue: unref(values),
7349
7467
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(values) ? values.value = $event : null),
7350
- field: unref(fields).situationType
7351
- }, null, 8, ["modelValue", "field"]),
7468
+ field: unref(fields).situationType,
7469
+ query: unref(onTypeState)
7470
+ }, null, 8, ["modelValue", "field", "query"]),
7352
7471
  createVNode(unref(OfficeRelation), {
7353
7472
  modelValue: unref(values),
7354
7473
  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(values) ? values.value = $event : null),
7355
7474
  field: unref(fields).situationReportedBy,
7356
- fragment: { id: 1, display: 1, name: 1 }
7475
+ fragment: { id: 1, display: 1, name: 1 },
7476
+ "is-disabled": ""
7357
7477
  }, null, 8, ["modelValue", "field"]),
7358
7478
  createVNode(unref(NeonFields), { md: "grid-cols-4" }, {
7359
7479
  default: withCtx(() => [
@@ -8062,16 +8182,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
8062
8182
  discardChanges
8063
8183
  } = useSingle();
8064
8184
  const authStore = useAuthStore();
8065
- const { userId } = storeToRefs(authStore);
8185
+ storeToRefs(authStore);
8066
8186
  useOperasional();
8067
- onMounted(() => {
8068
- if (id.value === "new") {
8069
- values.value.userId = userId.value;
8070
- }
8071
- if (isChanged) {
8072
- values.value.userId = userId.value;
8073
- }
8074
- });
8075
8187
  function onChangeDateUpdate(date) {
8076
8188
  values.value.estimatedStartDate = date == null ? void 0 : date.start.toISOString();
8077
8189
  values.value.estimatedEndDate = date == null ? void 0 : date.end.toISOString();
@@ -8289,6 +8401,7 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
8289
8401
  __proto__: null,
8290
8402
  CheckInAccess,
8291
8403
  CheckInCollection: _sfc_main$d,
8404
+ CheckInExternal,
8292
8405
  CheckInModel,
8293
8406
  CheckInPresenceCollection,
8294
8407
  CheckInScanError: _sfc_main$g,
@@ -8313,7 +8426,7 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
8313
8426
  TaskSingle: _sfc_main$1,
8314
8427
  TaskWork: _sfc_main,
8315
8428
  TaskWorkButton: _sfc_main$3,
8316
- XxxButton: _sfc_main$l
8429
+ XxxButton: _sfc_main$m
8317
8430
  }, Symbol.toStringTag, { value: "Module" }));
8318
8431
  function registerComponents(app) {
8319
8432
  Object.entries(components).forEach(([name, component]) => {
@@ -8433,6 +8546,7 @@ const qrScannerWorker_min = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object
8433
8546
  export {
8434
8547
  CheckInAccess,
8435
8548
  _sfc_main$d as CheckInCollection,
8549
+ CheckInExternal,
8436
8550
  CheckInModel,
8437
8551
  CheckInPresenceCollection,
8438
8552
  _sfc_main$g as CheckInScanError,
@@ -8460,7 +8574,7 @@ export {
8460
8574
  _sfc_main$1 as TaskSingle,
8461
8575
  _sfc_main as TaskWork,
8462
8576
  _sfc_main$3 as TaskWorkButton,
8463
- _sfc_main$l as XxxButton,
8577
+ _sfc_main$m as XxxButton,
8464
8578
  bus,
8465
8579
  useAttendanceStore,
8466
8580
  useOperasional,
package/build/style.css CHANGED
@@ -3,15 +3,15 @@
3
3
  margin-bottom: 1rem
4
4
  }
5
5
 
6
- #view-checkIns[data-v-6c1902ac] {
6
+ #view-checkIns[data-v-89ba2448] {
7
7
 
8
8
  height: 100%
9
9
  }
10
- #view-checkIns .wrapper[data-v-6c1902ac] {
10
+ #view-checkIns .wrapper[data-v-89ba2448] {
11
11
 
12
12
  height: 100%
13
13
  }
14
- #view-checkIns .header[data-v-6c1902ac] {
14
+ #view-checkIns .header[data-v-89ba2448] {
15
15
 
16
16
  display: flex;
17
17
 
@@ -27,15 +27,15 @@
27
27
 
28
28
  padding-bottom: 0.5rem
29
29
  }
30
- #view-checkIns .header .start[data-v-6c1902ac] {
30
+ #view-checkIns .header .start[data-v-89ba2448] {
31
31
 
32
32
  line-height: 1.25
33
33
  }
34
- #view-checkIns .header .title[data-v-6c1902ac] {
34
+ #view-checkIns .header .title[data-v-89ba2448] {
35
35
 
36
36
  font-weight: 700
37
37
  }
38
- #view-checkIns .header .description[data-v-6c1902ac] {
38
+ #view-checkIns .header .description[data-v-89ba2448] {
39
39
 
40
40
  font-size: 0.875rem;
41
41
 
@@ -43,13 +43,13 @@
43
43
 
44
44
  color: rgb(161 161 170 / var(--tw-text-opacity))
45
45
  }
46
- #view-checkIns .buttons[data-v-6c1902ac] {
46
+ #view-checkIns .buttons[data-v-89ba2448] {
47
47
 
48
48
  display: flex;
49
49
 
50
50
  align-items: center
51
51
  }
52
- #view-checkIns .buttons[data-v-6c1902ac] > :not([hidden]) ~ :not([hidden]) {
52
+ #view-checkIns .buttons[data-v-89ba2448] > :not([hidden]) ~ :not([hidden]) {
53
53
 
54
54
  --tw-space-x-reverse: 0;
55
55
 
@@ -57,11 +57,11 @@
57
57
 
58
58
  margin-left: calc(0.25rem * calc(1 - var(--tw-space-x-reverse)))
59
59
  }
60
- #view-checkIns .buttons[data-v-6c1902ac] {
60
+ #view-checkIns .buttons[data-v-89ba2448] {
61
61
 
62
62
  padding-right: 0.25rem
63
63
  }
64
- #view-checkIns .summary[data-v-6c1902ac] {
64
+ #view-checkIns .summary[data-v-89ba2448] {
65
65
 
66
66
  padding-bottom: 0.5rem
67
67
  }
@@ -70,6 +70,10 @@
70
70
  display: block
71
71
  }
72
72
 
73
+ .neu-checkIn-single[data-v-3c28699a] {
74
+ display: block
75
+ }
76
+
73
77
  .buttons[data-v-d23b6de5] {
74
78
  display: grid;
75
79
  align-items: center;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -1,5 +1,6 @@
1
1
  export { default as CheckInPresenceCollection } from './CheckInPresenceCollection.vue';
2
2
  export { default as CheckInSingle } from './CheckInSingle.vue';
3
+ export { default as CheckInExternal } from './CheckInExternal.vue';
3
4
  export { default as CheckInAccess } from './CheckInAccess.vue';
4
5
  export { default as CheckInScanError } from './CheckInScanError.vue';
5
6
  export { default as CheckInScanner } from './CheckInScanner.vue';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neutron.co.id/operasional-interfaces",
3
- "version": "1.4.3-beta.1",
3
+ "version": "1.4.3-beta.2",
4
4
  "description": "Interface library of Neutron.",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -54,13 +54,13 @@
54
54
  "warm": "nuxt prepare"
55
55
  },
56
56
  "dependencies": {
57
- "@neon.id/context": "0.39.0",
57
+ "@neon.id/context": "0.40.0",
58
58
  "@neon.id/field": "0.15.0",
59
59
  "@neon.id/identitas-interfaces": "1.1.0",
60
60
  "@neon.id/interfaces": "0.154.0",
61
- "@neon.id/office": "0.24.0",
61
+ "@neon.id/office": "0.26.0",
62
62
  "@neon.id/utils": "0.39.0",
63
- "@neutron.co.id/personalia-models": "1.4.1-beta.1",
63
+ "@neutron.co.id/personalia-models": "1.4.1-beta.2",
64
64
  "@neutron.co.id/sentral-interfaces": "1.2.0",
65
65
  "@nuxt/kit": "3.3.1",
66
66
  "qr-scanner": "1.4.1",
@@ -124,17 +124,17 @@
124
124
  "vue-tsc": "1.2.0"
125
125
  },
126
126
  "peerDependencies": {
127
- "@neon.id/context": "^0.39.0",
127
+ "@neon.id/context": "^0.40.0",
128
128
  "@neon.id/identitas-interfaces": "^1.1.0",
129
129
  "@neon.id/interfaces": "^0.154.0",
130
- "@neon.id/office": "^0.24.0",
130
+ "@neon.id/office": "^0.26.0",
131
131
  "@neon.id/utils": "^0.39.0",
132
- "@neutron.co.id/personalia-models": "^1.4.1-beta.1",
132
+ "@neutron.co.id/personalia-models": "^1.4.1-beta.2",
133
133
  "@nuxt/kit": "^3.3.1",
134
134
  "vue": "^3.2.47"
135
135
  },
136
136
  "publishConfig": {
137
137
  "access": "public"
138
138
  },
139
- "build": 80
139
+ "build": 81
140
140
  }