@drayman/elements 1.11.1 → 1.13.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,24 @@
1
+ export interface DraymanCalendar {
2
+ /**
3
+ * Array of events to be displayed in the calendar.
4
+ */
5
+ events?: {
6
+ title: string;
7
+ id: any;
8
+ color: string;
9
+ start: string;
10
+ end?: string;
11
+ }[];
12
+ /**
13
+ * Executed when user clicks on an event.
14
+ */
15
+ onEventClick?: ElementEvent<{
16
+ id: any;
17
+ }>;
18
+ /**
19
+ * Executed when user clicks on a day.
20
+ */
21
+ onDayClick?: ElementEvent<{
22
+ date: string;
23
+ }>;
24
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drayman/elements",
3
- "version": "1.11.1",
3
+ "version": "1.13.0",
4
4
  "description": "A collection of web components for Drayman.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -12,8 +12,9 @@
12
12
  "build:types": "tsc -p ./tsconfig.types.json",
13
13
  "typedoc": "npm run build:types && typedoc --tsconfig ./tsconfig.types.json",
14
14
  "lint": "ng lint",
15
- "build": "npm run build:code-editor && npm run build:button && npm run build:text-field && npm run build:claviz-charts && npm run build:file-uploader && npm run build:number-field && npm run build:select && npm run build:table && npm run build:checkbox && npm run build:textarea-field && npm run build:radio-group && npm run build:datepicker && npm run build:timepicker && npm run build:pdf-viewer && npm run build:ngx-charts && npm run build:menu && npm run build:ngx-graph && npm run build:youtube-player && npm run build:nebula && npm run build:grid && npm run build:picasso && npm run typedoc",
15
+ "build": "npm run build:calendar && npm run build:code-editor && npm run build:button && npm run build:text-field && npm run build:claviz-charts && npm run build:file-uploader && npm run build:number-field && npm run build:select && npm run build:table && npm run build:checkbox && npm run build:textarea-field && npm run build:radio-group && npm run build:datepicker && npm run build:timepicker && npm run build:pdf-viewer && npm run build:ngx-charts && npm run build:menu && npm run build:ngx-graph && npm run build:youtube-player && npm run build:nebula && npm run build:grid && npm run build:picasso && npm run typedoc",
16
16
  "build:code-editor": "ng build code-editor --prod --single-bundle --output-hashing=none",
17
+ "build:calendar": "ng build calendar --prod --single-bundle --output-hashing=none",
17
18
  "build:button": "ng build button --prod --single-bundle --output-hashing=none",
18
19
  "build:text-field": "ng build text-field --prod --single-bundle --output-hashing=none",
19
20
  "build:claviz-charts": "ng build claviz-charts --prod --single-bundle --output-hashing=none",
@@ -47,6 +48,9 @@
47
48
  "drayman-button": {
48
49
  "script": "./dist/button/main.js"
49
50
  },
51
+ "drayman-calendar": {
52
+ "script": "./dist/calendar/main.js"
53
+ },
50
54
  "drayman-code-editor": {
51
55
  "script": "./dist/code-editor/main.js"
52
56
  },
@@ -132,12 +136,14 @@
132
136
  "@types/multer": "^1.4.4",
133
137
  "@types/node": "latest",
134
138
  "@types/shortid": "0.0.29",
139
+ "angular-calendar": "0.28.28",
135
140
  "angular-resize-event": "^2.0.1",
136
141
  "babel-loader": "^8.1.0",
137
142
  "claviz-charts": "0.5.0",
138
143
  "codelyzer": "6.0.0",
139
144
  "codemirror": "^5.65.2",
140
145
  "d3-require": "^1.2.4",
146
+ "date-fns": "^2.29.2",
141
147
  "dayjs": "^1.9.6",
142
148
  "deepmerge": "4.2.2",
143
149
  "dot-object": "2.1.3",
@@ -165,6 +171,7 @@
165
171
  "react-is": "^16.13.1",
166
172
  "rxjs": "6.6.2",
167
173
  "shortid": "^2.2.16",
174
+ "tinycolor2": "^1.4.2",
168
175
  "ts-jest": "^26.3.0",
169
176
  "ts-node": "9.0.0",
170
177
  "tslib": "2.0.1",
package/types/index.d.ts CHANGED
@@ -18,12 +18,50 @@ import { DraymanYoutubePlayer } from '../dist/types/youtube-player/src/app/model
18
18
  import { DraymanNebula } from '../dist/types/nebula/src/app/models/nebula-options';
19
19
  import { DraymanGrid } from '../dist/types/grid/src/app/models/grid-options';
20
20
  import { DraymanCodeEditor } from '../dist/types/code-editor/src/app/models/code-editor-options';
21
+ import { DraymanCalendar } from '../dist/types/calendar/src/app/models/calendar-options';
21
22
 
22
23
  declare global {
23
24
  interface DraymanElementsProps {
24
25
  style?: CSS;
25
26
  ref?: string;
26
27
  }
28
+ /**
29
+ * # <drayman-calendar \/>
30
+ * Calendar powered by [angular-calendar](https://mattlewis92.github.io/) library.
31
+ *
32
+ * ## Example of usage
33
+ *
34
+ * ![](media://drayman-calendar.gif)
35
+ *
36
+ * ```typescript
37
+ * export const component: DraymanComponent = async ({ forceUpdate }) => {
38
+ *
39
+ * return () => {
40
+ *
41
+ * return (
42
+ * <drayman-calendar
43
+ * events={[
44
+ * {
45
+ * title: 'Event 1',
46
+ * start: new Date().toISOString(),
47
+ * end: new Date('2023-01-01').toISOString(),
48
+ * id: 'event_1',
49
+ * color: 'blue',
50
+ * }
51
+ * ]}
52
+ * onEventClick={async ({ id }) => {
53
+ * console.log(id);
54
+ * }}
55
+ * onDayClick={async ({ date }) => {
56
+ * console.log(date);
57
+ * }}
58
+ * />
59
+ * );
60
+ * }
61
+ * }
62
+ * ```
63
+ */
64
+ interface DraymanCalendarProps extends DraymanCalendar, DraymanElementsProps { }
27
65
  /**
28
66
  * # <drayman-button \/>
29
67
  * Button powered by [Angular Material](https://material.angular.io/) library.
@@ -1168,6 +1206,7 @@ declare global {
1168
1206
  'drayman-nebula': DraymanNebulaProps;
1169
1207
  'drayman-grid': DraymanGridProps;
1170
1208
  'drayman-code-editor': DraymanCodeEditorProps;
1209
+ 'drayman-calendar': DraymanCalendarProps;
1171
1210
  }
1172
1211
  }
1173
1212
  }