@limetech/lime-web-components 5.2.1 → 5.3.0

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,53 @@
1
+ import { DateTimeType } from './types';
2
+ /**
3
+ * Options for `DateTimeFormatter.format()`.
4
+ *
5
+ * @alpha
6
+ * @group Localization
7
+ */
8
+ export interface DateTimeFormatterOptions {
9
+ /**
10
+ * The type to format the date as.
11
+ */
12
+ type: DateTimeType;
13
+ /**
14
+ * The locale to use for formatting. A service implementing the
15
+ * `DateTimeFormatter` is free to choose the default value for this.
16
+ * For example, it may use the value from the user's browser or OS,
17
+ * or it may use a value from user configured preferences.
18
+ *
19
+ * **Note**<br>
20
+ * For a consistent user experience, it is recommended to _not_ set this
21
+ * property, and instead allow the service to use its own default value.
22
+ */
23
+ locale?: string;
24
+ }
25
+ /**
26
+ * Service for formatting date and time values.
27
+ *
28
+ * @alpha
29
+ * @group Localization
30
+ */
31
+ export interface DateTimeFormatter {
32
+ /**
33
+ * Format the given date as the given type.
34
+ *
35
+ * **Note**<br>
36
+ * If a `string` is supplied to the `date` parameter, it may be converted
37
+ * to a `Date` object before formatting. Note that, unless the string
38
+ * includes date, time, and timezone in an unambiguous format—like
39
+ * `'2022-05-23T00:00:00.000Z'`—this may have unexpected consequences.
40
+ *
41
+ * For example, calling `DateTimeFormatter.format('2022-05-23', 'time')`
42
+ * may very well return a nicely formatted time, but the value will
43
+ * obviously be nonsense, as there was no time data in the string provided
44
+ * in the first place.
45
+ *
46
+ * @param date - The date to format.
47
+ * @param options - Either a string specifying the type to format the date
48
+ * as, or a `DateTimeFormatterOptions` object.
49
+ * @returns A string representation of the date.
50
+ */
51
+ format(date: Date | string, options: DateTimeType | DateTimeFormatterOptions): string;
52
+ }
53
+ //# sourceMappingURL=datetimeformatter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetimeformatter.d.ts","sourceRoot":"","sources":["../../src/datetimeformatter/datetimeformatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACrC;;OAEG;IACH,IAAI,EAAE,YAAY,CAAC;IAEnB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CACF,IAAI,EAAE,IAAI,GAAG,MAAM,EACnB,OAAO,EAAE,YAAY,GAAG,wBAAwB,GACjD,MAAM,CAAC;CACb"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './datetimeformatter';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/datetimeformatter/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './datetimeformatter';
2
+ export * from './types';
@@ -0,0 +1,23 @@
1
+ import { DateTimeFormatter } from './datetimeformatter';
2
+ import { DateTimePropertyType } from '../limetype';
3
+ declare const SERVICE_NAME = "datetimeformatter";
4
+ declare module '../core/platform' {
5
+ interface PlatformServiceNameType {
6
+ /**
7
+ * @see {@link DateTimeFormatter}
8
+ */
9
+ DateTimeFormatter: typeof SERVICE_NAME;
10
+ }
11
+ interface LimeWebComponentPlatform {
12
+ get(name: PlatformServiceNameType['DateTimeFormatter']): DateTimeFormatter;
13
+ }
14
+ }
15
+ /**
16
+ * The possible types a date can be formatted as.
17
+ *
18
+ * @alpha
19
+ * @group Localization
20
+ */
21
+ export type DateTimeType = 'week' | DateTimePropertyType;
22
+ export {};
23
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/datetimeformatter/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,QAAA,MAAM,YAAY,sBAAsB,CAAC;AAIzC,OAAO,QAAQ,kBAAkB,CAAC;IAC9B,UAAU,uBAAuB;QAC7B;;WAEG;QACH,iBAAiB,EAAE,OAAO,YAAY,CAAC;KAC1C;IAED,UAAU,wBAAwB;QAC9B,GAAG,CACC,IAAI,EAAE,uBAAuB,CAAC,mBAAmB,CAAC,GACnD,iBAAiB,CAAC;KACxB;CACJ;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,oBAAoB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { PlatformServiceName } from '../core/platform';
2
+ const SERVICE_NAME = 'datetimeformatter';
3
+ PlatformServiceName.DateTimeFormatter = SERVICE_NAME;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./datetimeformatter"), exports);
5
+ tslib_1.__exportStar(require("./types"), exports);
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var platform_1 = require("../core/platform");
4
+ var SERVICE_NAME = 'datetimeformatter';
5
+ platform_1.PlatformServiceName.DateTimeFormatter = SERVICE_NAME;
package/dist/es5/index.js CHANGED
@@ -21,3 +21,4 @@ tslib_1.__exportStar(require("./filter"), exports);
21
21
  tslib_1.__exportStar(require("./userdata"), exports);
22
22
  tslib_1.__exportStar(require("./application"), exports);
23
23
  tslib_1.__exportStar(require("./userpreferences"), exports);
24
+ tslib_1.__exportStar(require("./datetimeformatter"), exports);
@@ -89,7 +89,7 @@ export interface HttpHeaders {
89
89
  */
90
90
  export type HttpResponseType = 'text' | 'json' | 'arraybuffer' | 'blob';
91
91
  /**
92
- * Exceptiopn thrown by {@link HttpClient} when an error occurs while sending a
92
+ * Exception thrown by {@link HttpClient} when an error occurs while sending a
93
93
  * request
94
94
  * @public
95
95
  */
package/dist/index.d.ts CHANGED
@@ -40,4 +40,5 @@ export * from './filter';
40
40
  export * from './userdata';
41
41
  export * from './application';
42
42
  export * from './userpreferences';
43
+ export * from './datetimeformatter';
43
44
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -40,3 +40,4 @@ export * from './filter';
40
40
  export * from './userdata';
41
41
  export * from './application';
42
42
  export * from './userpreferences';
43
+ export * from './datetimeformatter';
@@ -36,7 +36,12 @@ export interface Option {
36
36
  * @public
37
37
  * @group Lime types
38
38
  */
39
- export type PropertyType = 'string' | 'text' | 'phone' | 'integer' | 'decimal' | 'percent' | 'time' | 'timeofday' | 'date' | 'year' | 'quarter' | 'month' | 'yesno' | 'link' | 'user' | 'xml' | 'option' | 'set' | 'file' | 'hasone' | 'hasmany' | 'belongsto' | 'hasandbelongstomany' | 'system';
39
+ export type DateTimePropertyType = 'time' | 'timeofday' | 'date' | 'year' | 'quarter' | 'month';
40
+ /**
41
+ * @public
42
+ * @group Lime types
43
+ */
44
+ export type PropertyType = 'string' | 'text' | 'phone' | 'integer' | 'decimal' | 'percent' | 'yesno' | 'link' | 'user' | 'xml' | 'option' | 'set' | 'file' | 'hasone' | 'hasmany' | 'belongsto' | 'hasandbelongstomany' | 'system' | DateTimePropertyType;
40
45
  /**
41
46
  * @public
42
47
  * @group Lime types
@@ -1 +1 @@
1
- {"version":3,"file":"property.d.ts","sourceRoot":"","sources":["../../src/limetype/property.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;GAGG;AACH,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N,KAAK,GACL,QAAQ,GACR,KAAK,GACL,MAAM,GACN,QAAQ,GACR,SAAS,GACT,WAAW,GACX,qBAAqB,GACrB,QAAQ,GACR,oBAAoB,CAAC;AAE3B;;;GAGG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,YAAY,WAShD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,WAItD;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,YAAY,WAW5C;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,YAAY,WAI9C;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,YAAY,WAI7C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-web-components",
3
- "version": "5.2.1",
3
+ "version": "5.3.0",
4
4
  "description": "Lime Web Components",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -31,22 +31,22 @@
31
31
  "dependencies": {
32
32
  "@stencil/core": "^2.22.1",
33
33
  "rxjs": "^7.8.0",
34
- "tslib": "^2.4.1"
34
+ "tslib": "^2.5.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@commitlint/config-conventional": "^16.2.4",
38
- "@microsoft/api-extractor": "^7.33.7",
38
+ "@microsoft/api-extractor": "^7.34.1",
39
39
  "@types/jest": "^27.5.0",
40
40
  "@typescript-eslint/eslint-plugin": "^5.49.0",
41
41
  "@typescript-eslint/parser": "^5.49.0",
42
- "commitizen": "^4.2.6",
42
+ "commitizen": "^4.3.0",
43
43
  "cz-conventional-changelog": "^3.3.0",
44
44
  "eslint": "^8.32.0",
45
45
  "eslint-config-prettier": "^8.6.0",
46
46
  "eslint-plugin-ban": "^1.6.0",
47
47
  "eslint-plugin-prefer-arrow": "^1.2.3",
48
48
  "eslint-plugin-prettier": "^4.2.1",
49
- "eslint-plugin-react": "^7.32.1",
49
+ "eslint-plugin-react": "^7.32.2",
50
50
  "eslint-plugin-sonarjs": "^0.18.0",
51
51
  "eslint-plugin-tsdoc": "^0.2.17",
52
52
  "jest": "^27.5.1",
@@ -56,7 +56,7 @@
56
56
  "shelljs": "0.8.5",
57
57
  "typedoc": "^0.23.24",
58
58
  "typedoc-plugin-markdown": "~2.4.2",
59
- "typescript": "^4.9.4",
59
+ "typescript": "^4.9.5",
60
60
  "yargs": "^17.6.2"
61
61
  },
62
62
  "keywords": [