@neutron.co.id/operasional-interfaces 1.16.0-beta.1 → 1.16.0-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/@common/composables/index.d.ts +1 -0
- package/build/@common/composables/index.mjs +1 -0
- package/build/@common/composables/period.use.d.ts +9 -0
- package/build/@common/composables/period.use.mjs +40 -0
- package/build/@common/config.d.ts +5 -0
- package/build/@common/config.mjs +16 -0
- package/build/@common/index.d.ts +1 -0
- package/build/@common/index.mjs +1 -0
- package/build/module.json +1 -1
- package/build/nuxt.json +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './period.use';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./period.use.mjs";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Query } from '@neon.id/query';
|
|
2
|
+
export declare function usePeriod(): {
|
|
3
|
+
query: import("vue").ComputedRef<Query>;
|
|
4
|
+
isLoading: import("vue").Ref<boolean>;
|
|
5
|
+
date: import("vue").Ref<Date>;
|
|
6
|
+
header: import("vue").ComputedRef<string>;
|
|
7
|
+
startedAt: import("vue").ComputedRef<Date | undefined>;
|
|
8
|
+
endedAt: import("vue").ComputedRef<Date | undefined>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Query } from "@neon.id/query";
|
|
2
|
+
import { DateUtil } from "@neon.id/utils/date";
|
|
3
|
+
import { PeriodUtil } from "@neon.id/utils/period";
|
|
4
|
+
import { computed, ref } from "vue";
|
|
5
|
+
import { useOperasional } from "../../../@package/@office/common";
|
|
6
|
+
export function usePeriod() {
|
|
7
|
+
const { staff } = useOperasional();
|
|
8
|
+
const isLoading = ref(false);
|
|
9
|
+
const date = ref(/* @__PURE__ */ new Date());
|
|
10
|
+
const startedAt = computed(() => DateUtil.startOfWeek(date.value));
|
|
11
|
+
const endedAt = computed(() => DateUtil.endOfWeek(date.value));
|
|
12
|
+
const header = computed(() => {
|
|
13
|
+
const options = { pattern: "eeee, dd MMMM yyyy" };
|
|
14
|
+
const start = DateUtil.format(startedAt.value, options);
|
|
15
|
+
const end = DateUtil.format(endedAt.value, options);
|
|
16
|
+
return `Sesi Tanggal: ${start} - ${end}`;
|
|
17
|
+
});
|
|
18
|
+
const query = computed(() => {
|
|
19
|
+
const period = PeriodUtil.period(
|
|
20
|
+
"startedAt",
|
|
21
|
+
startedAt.value,
|
|
22
|
+
endedAt.value
|
|
23
|
+
);
|
|
24
|
+
const filter = {
|
|
25
|
+
...period,
|
|
26
|
+
shiftingStaffId: staff.value?.id
|
|
27
|
+
};
|
|
28
|
+
return Query.define({
|
|
29
|
+
filter
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
query,
|
|
34
|
+
isLoading,
|
|
35
|
+
date,
|
|
36
|
+
header,
|
|
37
|
+
startedAt,
|
|
38
|
+
endedAt
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CoreInterface, type TCoreInterfaceSelector } from '@neon.id/context/helpers';
|
|
2
|
+
export type TCommonFeature = string;
|
|
3
|
+
export interface TOperasionalCommonInterfaceOptions extends TCoreInterfaceSelector<TCommonFeature> {
|
|
4
|
+
}
|
|
5
|
+
export declare const config: CoreInterface<string>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CoreInterface
|
|
3
|
+
} from "@neon.id/context/helpers";
|
|
4
|
+
export const config = CoreInterface.define({
|
|
5
|
+
components: {
|
|
6
|
+
common: [],
|
|
7
|
+
features: {}
|
|
8
|
+
},
|
|
9
|
+
imports: {
|
|
10
|
+
common: [
|
|
11
|
+
// Composables
|
|
12
|
+
"usePeriod"
|
|
13
|
+
],
|
|
14
|
+
features: {}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './composables';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./composables/index.mjs";
|
package/build/module.json
CHANGED
package/build/nuxt.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neutron.co.id/operasional-interfaces",
|
|
3
|
-
"version": "1.16.0-beta.
|
|
3
|
+
"version": "1.16.0-beta.2",
|
|
4
4
|
"description": "Interface library of Neutron Operasional.",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css"
|
|
@@ -160,5 +160,5 @@
|
|
|
160
160
|
"publishConfig": {
|
|
161
161
|
"access": "public"
|
|
162
162
|
},
|
|
163
|
-
"build":
|
|
163
|
+
"build": 168
|
|
164
164
|
}
|