@nepdatejs/datepicker 0.1.0 → 0.1.1
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/dist/index.cjs +16 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16 -9
- package/dist/index.js.map +1 -1
- package/dist/nepdate-datepicker.global.js +1 -1
- package/dist/nepdate-datepicker.global.js.map +1 -1
- package/package.json +2 -2
- package/src/base.ts +10 -5
- package/src/presets.ts +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nepdatejs/datepicker",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Framework-free BS/AD date picker behaviour: typed input, validation, BS/AD switch, single and range values.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nepali",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"node": ">=18"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@nepdatejs/core": "^0.1.
|
|
58
|
+
"@nepdatejs/core": "^0.1.1",
|
|
59
59
|
"@nepdatejs/calendar": "^0.1.0"
|
|
60
60
|
},
|
|
61
61
|
"publishConfig": {
|
package/src/base.ts
CHANGED
|
@@ -106,12 +106,17 @@ export function createEmitter(rebuild: () => void): {
|
|
|
106
106
|
try {
|
|
107
107
|
change();
|
|
108
108
|
} finally {
|
|
109
|
+
// Even after a throw: part of the change may have happened.
|
|
109
110
|
depth--;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
if (depth === 0) {
|
|
112
|
+
const callbacks = queued.splice(0);
|
|
113
|
+
try {
|
|
114
|
+
notify();
|
|
115
|
+
} finally {
|
|
116
|
+
for (const callback of callbacks) {
|
|
117
|
+
callback();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
115
120
|
}
|
|
116
121
|
}
|
|
117
122
|
},
|
package/src/presets.ts
CHANGED
|
@@ -137,7 +137,10 @@ export function describePreset<R, Id extends string>(
|
|
|
137
137
|
|
|
138
138
|
return {
|
|
139
139
|
id: preset,
|
|
140
|
-
|
|
140
|
+
// Unknown ids show as themselves, even ones like "constructor" that objects inherit.
|
|
141
|
+
label: Object.prototype.hasOwnProperty.call(labels, preset)
|
|
142
|
+
? (labels[preset] ?? preset)
|
|
143
|
+
: preset,
|
|
141
144
|
resolve: (context) => resolveBuiltIn(preset, context),
|
|
142
145
|
};
|
|
143
146
|
}
|