ember-power-calendar 1.0.1 → 1.0.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.
|
@@ -23,7 +23,7 @@ function findCalendarGuid(selector) {
|
|
|
23
23
|
if (maybeCalendar.classList.contains('ember-power-calendar')) {
|
|
24
24
|
return maybeCalendar.id;
|
|
25
25
|
} else {
|
|
26
|
-
return maybeCalendar.dataset['
|
|
26
|
+
return maybeCalendar.dataset['powerCalendarId'];
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
function findComponentInstance(selector) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../src/test-support/helpers.ts"],"sourcesContent":["import { run } from '@ember/runloop';\nimport { assert } from '@ember/debug';\nimport { click, settled, find } from '@ember/test-helpers';\nimport { formatDate } from '../utils.ts';\nimport type PowerCalendarMultipleComponent from '../components/power-calendar-multiple.ts';\nimport type PowerCalendarComponent from '../components/power-calendar.ts';\nimport type PowerCalendarRangeComponent from '../components/power-calendar-range.ts';\n\nexport default {};\n\nexport * from '../utils.ts';\n\nfunction findCalendarElement(selector: string): Element | null | undefined {\n const target = find(selector);\n\n if (target) {\n if (target.classList.contains('ember-power-calendar')) {\n return target;\n } else {\n return (\n target.querySelector('.ember-power-calendar') ||\n target.querySelector('[data-power-calendar-id]')\n );\n }\n }\n}\n\nfunction findCalendarGuid(selector: string): string | undefined {\n const maybeCalendar = findCalendarElement(selector);\n if (!maybeCalendar) {\n return;\n }\n if (maybeCalendar.classList.contains('ember-power-calendar')) {\n return maybeCalendar.id;\n } else {\n return (maybeCalendar as HTMLElement).dataset['
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../src/test-support/helpers.ts"],"sourcesContent":["import { run } from '@ember/runloop';\nimport { assert } from '@ember/debug';\nimport { click, settled, find } from '@ember/test-helpers';\nimport { formatDate } from '../utils.ts';\nimport type PowerCalendarMultipleComponent from '../components/power-calendar-multiple.ts';\nimport type PowerCalendarComponent from '../components/power-calendar.ts';\nimport type PowerCalendarRangeComponent from '../components/power-calendar-range.ts';\n\nexport default {};\n\nexport * from '../utils.ts';\n\nfunction findCalendarElement(selector: string): Element | null | undefined {\n const target = find(selector);\n\n if (target) {\n if (target.classList.contains('ember-power-calendar')) {\n return target;\n } else {\n return (\n target.querySelector('.ember-power-calendar') ||\n target.querySelector('[data-power-calendar-id]')\n );\n }\n }\n}\n\nfunction findCalendarGuid(selector: string): string | undefined {\n const maybeCalendar = findCalendarElement(selector);\n if (!maybeCalendar) {\n return;\n }\n if (maybeCalendar.classList.contains('ember-power-calendar')) {\n return maybeCalendar.id;\n } else {\n return (maybeCalendar as HTMLElement).dataset['powerCalendarId'];\n }\n}\n\nfunction findComponentInstance(\n selector: string,\n):\n | PowerCalendarComponent\n | PowerCalendarMultipleComponent\n | PowerCalendarRangeComponent {\n const calendarGuid = findCalendarGuid(selector);\n assert(\n `Could not find a calendar using selector: \"${selector}\"`,\n calendarGuid,\n );\n // @ts-expect-error Property '__powerCalendars'\n return window.__powerCalendars[calendarGuid];\n}\n\nexport async function calendarCenter(\n selector: string,\n newCenter: Date,\n): Promise<void> {\n assert(\n '`calendarCenter` expect a Date object as second argument',\n newCenter instanceof Date,\n );\n const calendarComponent = findComponentInstance(selector);\n const onCenterChange = calendarComponent.args.onCenterChange;\n assert(\n \"You cannot call `calendarCenter` on a component that doesn't has an `@onCenterChange` action\",\n !!onCenterChange,\n );\n const publicAPI = calendarComponent.publicAPI;\n run(() =>\n publicAPI.actions.changeCenter!(newCenter, publicAPI, {} as MouseEvent),\n );\n return settled();\n}\n\nexport async function calendarSelect(\n selector: string,\n selected: Date,\n): Promise<void> {\n assert('`calendarSelect` expect a Date object as second argument', selected);\n const calendarElement = findCalendarElement(selector);\n const daySelector = `${selector} [data-date=\"${formatDate(\n selected,\n 'YYYY-MM-DD',\n )}\"]`;\n const dayElement = calendarElement?.querySelector(daySelector);\n if (!dayElement) {\n await calendarCenter(selector, selected);\n }\n return click(daySelector);\n}\n"],"names":["findCalendarElement","selector","target","find","classList","contains","querySelector","findCalendarGuid","maybeCalendar","id","dataset","findComponentInstance","calendarGuid","assert","window","__powerCalendars","calendarCenter","newCenter","Date","calendarComponent","onCenterChange","args","publicAPI","run","actions","changeCenter","settled","calendarSelect","selected","calendarElement","daySelector","formatDate","dayElement","click"],"mappings":";;;;;;AAQA,cAAe,EAAE,CAAA;AAIjB,SAASA,mBAAmBA,CAACC,QAAgB,EAA8B;AACzE,EAAA,MAAMC,MAAM,GAAGC,IAAI,CAACF,QAAQ,CAAC,CAAA;AAE7B,EAAA,IAAIC,MAAM,EAAE;IACV,IAAIA,MAAM,CAACE,SAAS,CAACC,QAAQ,CAAC,sBAAsB,CAAC,EAAE;AACrD,MAAA,OAAOH,MAAM,CAAA;AACf,KAAC,MAAM;AACL,MAAA,OACEA,MAAM,CAACI,aAAa,CAAC,uBAAuB,CAAC,IAC7CJ,MAAM,CAACI,aAAa,CAAC,0BAA0B,CAAC,CAAA;AAEpD,KAAA;AACF,GAAA;AACF,CAAA;AAEA,SAASC,gBAAgBA,CAACN,QAAgB,EAAsB;AAC9D,EAAA,MAAMO,aAAa,GAAGR,mBAAmB,CAACC,QAAQ,CAAC,CAAA;EACnD,IAAI,CAACO,aAAa,EAAE;AAClB,IAAA,OAAA;AACF,GAAA;EACA,IAAIA,aAAa,CAACJ,SAAS,CAACC,QAAQ,CAAC,sBAAsB,CAAC,EAAE;IAC5D,OAAOG,aAAa,CAACC,EAAE,CAAA;AACzB,GAAC,MAAM;AACL,IAAA,OAAQD,aAAa,CAAiBE,OAAO,CAAC,iBAAiB,CAAC,CAAA;AAClE,GAAA;AACF,CAAA;AAEA,SAASC,qBAAqBA,CAC5BV,QAAgB,EAIc;AAC9B,EAAA,MAAMW,YAAY,GAAGL,gBAAgB,CAACN,QAAQ,CAAC,CAAA;AAC/CY,EAAAA,MAAM,CACH,CAA6CZ,2CAAAA,EAAAA,QAAS,CAAE,CAAA,C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json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-power-calendar",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Powerful and customizable calendar component for Ember",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -71,24 +71,24 @@
|
|
|
71
71
|
"@ember/render-modifiers": "^2.1.0",
|
|
72
72
|
"@embroider/macros": "^1.15.0",
|
|
73
73
|
"ember-assign-helper": "^0.5.0",
|
|
74
|
-
"ember-element-helper": "^0.8.
|
|
74
|
+
"ember-element-helper": "^0.8.6",
|
|
75
75
|
"ember-truth-helpers": "^4.0.3"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@babel/core": "^7.24.
|
|
79
|
-
"@babel/runtime": "^7.24.
|
|
80
|
-
"@babel/plugin-transform-typescript": "^7.
|
|
78
|
+
"@babel/core": "^7.24.3",
|
|
79
|
+
"@babel/runtime": "^7.24.1",
|
|
80
|
+
"@babel/plugin-transform-typescript": "^7.24.1",
|
|
81
81
|
"@babel/preset-typescript": "^7.23.3",
|
|
82
82
|
"@ember/test-helpers": "^3.2.1",
|
|
83
83
|
"@embroider/addon-dev": "^4.1.3",
|
|
84
|
-
"@glint/core": "^1.
|
|
85
|
-
"@glint/environment-ember-loose": "^1.
|
|
86
|
-
"@glint/environment-ember-template-imports": "^1.
|
|
87
|
-
"@glint/template": "^1.
|
|
84
|
+
"@glint/core": "^1.4.0",
|
|
85
|
+
"@glint/environment-ember-loose": "^1.4.0",
|
|
86
|
+
"@glint/environment-ember-template-imports": "^1.4.0",
|
|
87
|
+
"@glint/template": "^1.4.0",
|
|
88
88
|
"@glimmer/component": "^1.1.2",
|
|
89
89
|
"@glimmer/tracking": "^1.1.2",
|
|
90
90
|
"@rollup/plugin-babel": "^6.0.4",
|
|
91
|
-
"@tsconfig/ember": "^3.0.
|
|
91
|
+
"@tsconfig/ember": "^3.0.6",
|
|
92
92
|
"@types/ember": "^4.0.11",
|
|
93
93
|
"@types/ember__application": "^4.0.11",
|
|
94
94
|
"@types/ember__array": "^4.0.10",
|
|
@@ -109,11 +109,11 @@
|
|
|
109
109
|
"@types/ember__template": "^4.0.7",
|
|
110
110
|
"@types/ember__test": "^4.0.6",
|
|
111
111
|
"@types/ember__utils": "^4.0.7",
|
|
112
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
113
|
-
"@typescript-eslint/parser": "^7.
|
|
112
|
+
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
|
113
|
+
"@typescript-eslint/parser": "^7.4.0",
|
|
114
114
|
"babel-plugin-ember-template-compilation": "^2.2.1",
|
|
115
115
|
"concurrently": "^8.2.2",
|
|
116
|
-
"ember-concurrency": "^4.0.
|
|
116
|
+
"ember-concurrency": "^4.0.2",
|
|
117
117
|
"ember-source": "~5.7.0",
|
|
118
118
|
"ember-template-lint": "^5.13.0",
|
|
119
119
|
"eslint": "^8.57.0",
|
|
@@ -122,15 +122,15 @@
|
|
|
122
122
|
"eslint-plugin-n": "^16.6.2",
|
|
123
123
|
"eslint-plugin-prettier": "^5.1.3",
|
|
124
124
|
"node-sass": "^9.0.0",
|
|
125
|
-
"postcss": "^8.4.
|
|
125
|
+
"postcss": "^8.4.38",
|
|
126
126
|
"prettier": "^3.2.2",
|
|
127
|
-
"prettier-plugin-ember-template-tag": "^2.0.
|
|
128
|
-
"rollup": "^4.
|
|
127
|
+
"prettier-plugin-ember-template-tag": "^2.0.1",
|
|
128
|
+
"rollup": "^4.13.2",
|
|
129
129
|
"rollup-plugin-styles": "^4.0.0",
|
|
130
130
|
"rsvp": "^4.8.5",
|
|
131
|
-
"sass": "^1.
|
|
132
|
-
"typescript": "^5.
|
|
133
|
-
"webpack": "^5.
|
|
131
|
+
"sass": "^1.72.0",
|
|
132
|
+
"typescript": "^5.4.3",
|
|
133
|
+
"webpack": "^5.91.0"
|
|
134
134
|
},
|
|
135
135
|
"publishConfig": {
|
|
136
136
|
"registry": "https://registry.npmjs.org"
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"@ember/test-helpers": "^2.9.4 || ^3.2.1",
|
|
161
161
|
"@glimmer/component": "^1.1.2",
|
|
162
162
|
"@glimmer/tracking": "^1.1.2",
|
|
163
|
-
"ember-concurrency": "^4.0.
|
|
163
|
+
"ember-concurrency": "^4.0.2",
|
|
164
164
|
"ember-source": "^3.28.0 || ^4.0.0 || >=5.0.0"
|
|
165
165
|
}
|
|
166
166
|
}
|