@linagora/linid-im-front-corelib 0.0.64 → 0.0.66

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.
@@ -0,0 +1,10 @@
1
+ export declare const DEFAULT_DATE_FORMAT = "YYYY-MM-DD";
2
+ /**
3
+ * Composable exposing dayjs utility functions.
4
+ * @returns An object containing dayjs helper methods.
5
+ */
6
+ export declare function useDayjs(): {
7
+ maxDate: (dates: unknown[], format?: string) => import("dayjs").Dayjs | null;
8
+ minDate: (dates: unknown[], format?: string) => import("dayjs").Dayjs | null;
9
+ toDayjs: (value: unknown, format?: string) => import("dayjs").Dayjs;
10
+ };
@@ -15,5 +15,8 @@ export declare function useFieldValidation(i18nScope: string): {
15
15
  pattern: (value: string, pattern: string) => true | string;
16
16
  unique: (value: unknown, items: unknown[]) => true | string;
17
17
  validDate: (value: unknown, format?: string) => true | string;
18
- dateNotInPast: (value: unknown, format?: string) => true | string;
18
+ afterDate: (value: unknown, compareTo: unknown, format?: string) => true | string;
19
+ beforeDate: (value: unknown, compareTo: unknown, format?: string) => true | string;
20
+ fromDate: (value: unknown, compareTo: unknown, format?: string) => true | string;
21
+ upToDate: (value: unknown, compareTo: unknown, format?: string) => true | string;
19
22
  };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Composable exposing utility functions for working with Nunjucks templates.
3
+ * It provides a method to recursively render all string properties of an object as Nunjucks templates using a shared Nunjucks environment.
4
+ * The Nunjucks environment must be initialized and set in the `nunjucksService` before using this composable.
5
+ *
6
+ * **Security note:** XSS safety of the rendered output depends entirely on the Nunjucks environment
7
+ * provided by the caller. If the output is injected into the DOM as raw HTML (e.g. Via `v-html`),
8
+ * ensure the environment is configured with `autoescape: true`. Template strings (`value`) must be
9
+ * developer-controlled; passing user-supplied strings as templates is not supported and may introduce
10
+ * template injection risks.
11
+ * @returns An object containing utility methods for rendering Nunjucks templates within objects.
12
+ */
13
+ export declare function useNunjucks(): {
14
+ render: <T>(value: T, context: Record<string, unknown>) => T;
15
+ };
@@ -0,0 +1,10 @@
1
+ export declare const QDATE_DEFAULT_MASK = "YYYY/MM/DD";
2
+ /**
3
+ * Composable for date handling compatible with Quasar framework.
4
+ * Provides utility functions to convert date strings between arbitrary formats and the Quasar date component format.
5
+ * @returns An object containing date utility methods for Quasar.
6
+ */
7
+ export declare function useQuasarDate(): {
8
+ toQDateFormat: (date: string, format?: string) => string;
9
+ formatQDate: (date: unknown, format?: string) => string;
10
+ };
@@ -14,5 +14,8 @@ export declare function useQuasarFieldValidation(i18nScope: string): {
14
14
  pattern: (patternValue: string) => (value: string) => string | true;
15
15
  unique: (items: unknown[]) => (value: unknown) => string | true;
16
16
  validDate: (format?: string) => (value: unknown) => string | true;
17
- dateNotInPast: (format?: string) => (value: unknown) => string | true;
17
+ afterDate: (compareTo: string, format?: string) => (value: unknown) => string | true;
18
+ beforeDate: (compareTo: string, format?: string) => (value: unknown) => string | true;
19
+ fromDate: (compareTo: string, format?: string) => (value: unknown) => string | true;
20
+ upToDate: (compareTo: string, format?: string) => (value: unknown) => string | true;
18
21
  };
@@ -1,17 +1,21 @@
1
1
  export { default as LinidZoneRenderer } from './components/LinidZoneRenderer.vue';
2
+ export { DEFAULT_DATE_FORMAT, useDayjs } from './composables/useDayjs';
2
3
  export { useDialog } from './composables/useDialog';
3
4
  export { useFieldValidation } from './composables/useFieldValidation';
4
5
  export { useNotify } from './composables/useNotify';
6
+ export { useNunjucks } from './composables/useNunjucks';
5
7
  export { usePagination } from './composables/usePagination';
8
+ export { QDATE_DEFAULT_MASK, useQuasarDate } from './composables/useQuasarDate';
6
9
  export { useQuasarFieldValidation } from './composables/useQuasarFieldValidation';
7
10
  export { useQuasarRules } from './composables/useQuasarRules';
8
11
  export { useScopedI18n } from './composables/useScopedI18n';
9
- export { useUiDesign } from './composables/useUiDesign';
10
12
  export { useTree } from './composables/useTree';
13
+ export { useUiDesign } from './composables/useUiDesign';
11
14
  export { useLinidConfigurationStore } from './stores/linidConfigurationStore';
12
15
  export { useLinidUiStore } from './stores/linidUiStore';
13
- export { useLinidZoneStore } from './stores/linidZoneStore';
14
16
  export { useLinidUserStore } from './stores/linidUserStore';
17
+ export { useLinidZoneStore } from './stores/linidZoneStore';
18
+ export { getDayjsInstance, setDayjsInstance } from './services/dayjsService';
15
19
  export { getModuleFederation, loadAsyncComponent, setModuleFederation, } from './services/federationService';
16
20
  export { getHttpClient, setHttpClient } from './services/httpClientService';
17
21
  export { getI18nInstance, setI18nInstance } from './services/i18nService';
@@ -0,0 +1,13 @@
1
+ import type dayjs from 'dayjs';
2
+ /**
3
+ * Initializes the shared Dayjs instance.
4
+ * Should be called once by the host application during boot.
5
+ * @param instance - The Dayjs instance to use as the shared instance.
6
+ */
7
+ export declare function setDayjsInstance(instance: typeof dayjs): void;
8
+ /**
9
+ * Returns the shared Dayjs instance.
10
+ * Must be called after initialization via `setDayjsInstance()`.
11
+ * @returns The shared Dayjs instance.
12
+ */
13
+ export declare function getDayjsInstance(): typeof dayjs;
@@ -3,4 +3,4 @@
3
3
  * These validators read their parameters from the `inputSettings` property
4
4
  * of `LinidAttributeConfiguration`.
5
5
  */
6
- export type ValidatorName = 'email' | 'dateNotInPast' | 'min' | 'max' | 'minLength' | 'maxLength' | 'pattern' | 'unique' | 'validDate';
6
+ export type ValidatorName = 'email' | 'min' | 'max' | 'minLength' | 'maxLength' | 'pattern' | 'unique';
@@ -2,7 +2,7 @@
2
2
  * Supported UI input types for attribute rendering.
3
3
  * Each type corresponds to a specific form component.
4
4
  */
5
- export type AttributeInputType = 'Text' | 'Number' | 'Boolean' | 'Date' | 'List' | 'DynamicList';
5
+ export type AttributeInputType = 'Text' | 'Number' | 'Boolean' | 'Date' | 'List' | 'DynamicList' | 'Textarea';
6
6
  /**
7
7
  * Describes a single attribute of an entity.
8
8
  * Corresponds to `AttributeDescription` from the backend API.
@@ -143,7 +143,7 @@ declare const Q_TREE_PROPS: readonly ["tickStrategy", "noSelectionUnset", "defau
143
143
  /**
144
144
  * List of QSplitterProps keys for type-safe UI design retrieval.
145
145
  */
146
- declare const Q_SPLITTER_PROPS: readonly ["horizontal", "limits", "reverse", "unit", "disable", "beforeClass", "afterClass", "separatorClass", "separatorStyle", "dark"];
146
+ declare const Q_SPLITTER_PROPS: readonly ["horizontal", "limits", "modelValue", "reverse", "unit", "disable", "beforeClass", "afterClass", "separatorClass", "separatorStyle", "dark"];
147
147
  /**
148
148
  * Maps Quasar component names to their respective props keys for UI design retrieval.
149
149
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linagora/linid-im-front-corelib",
3
- "version": "0.0.64",
3
+ "version": "0.0.66",
4
4
  "description": "Core library of the LinID Identity Manager project. Provides shared types, services, components, and utilities for front-end and plugin, enabling consistent integration across the LinID ecosystem.",
5
5
  "type": "module",
6
6
  "files": [