@zag-js/number-input 1.46.0 → 1.48.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.
- package/dist/cursor.d.mts +8 -10
- package/dist/cursor.d.ts +8 -10
- package/dist/cursor.js +65 -104
- package/dist/cursor.mjs +59 -77
- package/dist/index.d.mts +6 -9
- package/dist/index.d.ts +6 -9
- package/dist/index.js +12 -38
- package/dist/index.mjs +2 -7
- package/dist/number-input.anatomy.d.mts +2 -6
- package/dist/number-input.anatomy.d.ts +2 -6
- package/dist/number-input.anatomy.js +8 -42
- package/dist/number-input.anatomy.mjs +4 -16
- package/dist/number-input.connect.d.mts +3 -8
- package/dist/number-input.connect.d.ts +3 -8
- package/dist/number-input.connect.js +310 -310
- package/dist/number-input.connect.mjs +304 -284
- package/dist/number-input.dom.d.mts +28 -32
- package/dist/number-input.dom.d.ts +28 -32
- package/dist/number-input.dom.js +96 -138
- package/dist/number-input.dom.mjs +76 -97
- package/dist/number-input.machine.d.mts +2 -8
- package/dist/number-input.machine.d.ts +2 -8
- package/dist/number-input.machine.js +484 -460
- package/dist/number-input.machine.mjs +478 -440
- package/dist/number-input.props.d.mts +3 -9
- package/dist/number-input.props.d.ts +3 -9
- package/dist/number-input.props.js +40 -65
- package/dist/number-input.props.mjs +36 -39
- package/dist/number-input.translations.d.mts +3 -8
- package/dist/number-input.translations.d.ts +3 -8
- package/dist/number-input.translations.js +8 -31
- package/dist/number-input.translations.mjs +4 -6
- package/dist/number-input.types.d.mts +298 -300
- package/dist/number-input.types.d.ts +298 -300
- package/dist/number-input.types.js +4 -18
- package/dist/number-input.types.mjs +1 -0
- package/dist/number-input.utils.d.mts +9 -12
- package/dist/number-input.utils.d.ts +9 -12
- package/dist/number-input.utils.js +28 -57
- package/dist/number-input.utils.mjs +20 -28
- package/package.json +8 -8
package/dist/cursor.d.mts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { Scope } from
|
|
2
|
-
|
|
1
|
+
import { Scope } from "@zag-js/core";
|
|
3
2
|
interface Selection {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
value: string;
|
|
7
6
|
}
|
|
8
|
-
declare function recordCursor(inputEl: HTMLInputElement | null, scope: Scope): Selection | undefined;
|
|
9
|
-
declare function restoreCursor(inputEl: HTMLInputElement | null, selection: Selection | undefined, scope: Scope): void;
|
|
10
|
-
declare function getNextCursorPosition(oldValue: string, newValue: string, oldPosition: number): number;
|
|
11
|
-
|
|
12
|
-
export { getNextCursorPosition, recordCursor, restoreCursor };
|
|
7
|
+
export declare function recordCursor(inputEl: HTMLInputElement | null, scope: Scope): Selection | undefined;
|
|
8
|
+
export declare function restoreCursor(inputEl: HTMLInputElement | null, selection: Selection | undefined, scope: Scope): void;
|
|
9
|
+
export declare function getNextCursorPosition(oldValue: string, newValue: string, oldPosition: number): number;
|
|
10
|
+
export {};
|
package/dist/cursor.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { Scope } from
|
|
2
|
-
|
|
1
|
+
import { Scope } from "@zag-js/core";
|
|
3
2
|
interface Selection {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
value: string;
|
|
7
6
|
}
|
|
8
|
-
declare function recordCursor(inputEl: HTMLInputElement | null, scope: Scope): Selection | undefined;
|
|
9
|
-
declare function restoreCursor(inputEl: HTMLInputElement | null, selection: Selection | undefined, scope: Scope): void;
|
|
10
|
-
declare function getNextCursorPosition(oldValue: string, newValue: string, oldPosition: number): number;
|
|
11
|
-
|
|
12
|
-
export { getNextCursorPosition, recordCursor, restoreCursor };
|
|
7
|
+
export declare function recordCursor(inputEl: HTMLInputElement | null, scope: Scope): Selection | undefined;
|
|
8
|
+
export declare function restoreCursor(inputEl: HTMLInputElement | null, selection: Selection | undefined, scope: Scope): void;
|
|
9
|
+
export declare function getNextCursorPosition(oldValue: string, newValue: string, oldPosition: number): number;
|
|
10
|
+
export {};
|
package/dist/cursor.js
CHANGED
|
@@ -1,111 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/cursor.ts
|
|
21
|
-
var cursor_exports = {};
|
|
22
|
-
__export(cursor_exports, {
|
|
23
|
-
getNextCursorPosition: () => getNextCursorPosition,
|
|
24
|
-
recordCursor: () => recordCursor,
|
|
25
|
-
restoreCursor: () => restoreCursor
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
26
4
|
});
|
|
27
|
-
|
|
5
|
+
// src/cursor.ts
|
|
28
6
|
function recordCursor(inputEl, scope) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
7
|
+
if (!inputEl || !scope.isActiveElement(inputEl)) return;
|
|
8
|
+
try {
|
|
9
|
+
const { selectionStart: start, selectionEnd: end, value } = inputEl;
|
|
10
|
+
if (start == null || end == null) return void 0;
|
|
11
|
+
return {
|
|
12
|
+
start,
|
|
13
|
+
end,
|
|
14
|
+
value
|
|
15
|
+
};
|
|
16
|
+
} catch {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
37
19
|
}
|
|
38
20
|
function restoreCursor(inputEl, selection, scope) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
21
|
+
if (!inputEl || !scope.isActiveElement(inputEl)) return;
|
|
22
|
+
if (!selection) {
|
|
23
|
+
const len = inputEl.value.length;
|
|
24
|
+
inputEl.setSelectionRange(len, len);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const newValue = inputEl.value;
|
|
29
|
+
const { start, end, value: oldValue } = selection;
|
|
30
|
+
if (newValue === oldValue) {
|
|
31
|
+
inputEl.setSelectionRange(start, end);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const newStart = getNextCursorPosition(oldValue, newValue, start);
|
|
35
|
+
const newEnd = start === end ? newStart : getNextCursorPosition(oldValue, newValue, end);
|
|
36
|
+
const clampedStart = Math.max(0, Math.min(newStart, newValue.length));
|
|
37
|
+
const clampedEnd = Math.max(clampedStart, Math.min(newEnd, newValue.length));
|
|
38
|
+
inputEl.setSelectionRange(clampedStart, clampedEnd);
|
|
39
|
+
} catch {
|
|
40
|
+
const len = inputEl.value.length;
|
|
41
|
+
inputEl.setSelectionRange(len, len);
|
|
42
|
+
}
|
|
61
43
|
}
|
|
62
44
|
function getNextCursorPosition(oldValue, newValue, oldPosition) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
if (suffixLength >= afterCursor.length) {
|
|
89
|
-
return newValue.length - suffixLength;
|
|
90
|
-
}
|
|
91
|
-
if (prefixLength > 0) {
|
|
92
|
-
return prefixLength;
|
|
93
|
-
}
|
|
94
|
-
if (suffixLength > 0) {
|
|
95
|
-
return newValue.length - suffixLength;
|
|
96
|
-
}
|
|
97
|
-
if (oldPosition === 0 && prefixLength === 0 && suffixLength === 0) {
|
|
98
|
-
return newValue.length;
|
|
99
|
-
}
|
|
100
|
-
if (oldValue.length > 0) {
|
|
101
|
-
const ratio = oldPosition / oldValue.length;
|
|
102
|
-
return Math.round(ratio * newValue.length);
|
|
103
|
-
}
|
|
104
|
-
return newValue.length;
|
|
45
|
+
const beforeCursor = oldValue.slice(0, oldPosition);
|
|
46
|
+
const afterCursor = oldValue.slice(oldPosition);
|
|
47
|
+
let prefixLength = 0;
|
|
48
|
+
const maxPrefixLength = Math.min(beforeCursor.length, newValue.length);
|
|
49
|
+
for (let i = 0; i < maxPrefixLength; i++) if (beforeCursor[i] === newValue[i]) prefixLength = i + 1;
|
|
50
|
+
else break;
|
|
51
|
+
let suffixLength = 0;
|
|
52
|
+
const maxSuffixLength = Math.min(afterCursor.length, newValue.length - prefixLength);
|
|
53
|
+
for (let i = 0; i < maxSuffixLength; i++) {
|
|
54
|
+
const oldIndex = afterCursor.length - 1 - i;
|
|
55
|
+
const newIndex = newValue.length - 1 - i;
|
|
56
|
+
if (afterCursor[oldIndex] === newValue[newIndex]) suffixLength = i + 1;
|
|
57
|
+
else break;
|
|
58
|
+
}
|
|
59
|
+
if (beforeCursor.length > 0 && prefixLength >= beforeCursor.length) return prefixLength;
|
|
60
|
+
if (suffixLength >= afterCursor.length) return newValue.length - suffixLength;
|
|
61
|
+
if (prefixLength > 0) return prefixLength;
|
|
62
|
+
if (suffixLength > 0) return newValue.length - suffixLength;
|
|
63
|
+
if (oldPosition === 0 && prefixLength === 0 && suffixLength === 0) return newValue.length;
|
|
64
|
+
if (oldValue.length > 0) {
|
|
65
|
+
const ratio = oldPosition / oldValue.length;
|
|
66
|
+
return Math.round(ratio * newValue.length);
|
|
67
|
+
}
|
|
68
|
+
return newValue.length;
|
|
105
69
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
recordCursor,
|
|
110
|
-
restoreCursor
|
|
111
|
-
});
|
|
70
|
+
exports.getNextCursorPosition = getNextCursorPosition;
|
|
71
|
+
exports.recordCursor = recordCursor;
|
|
72
|
+
exports.restoreCursor = restoreCursor;
|
package/dist/cursor.mjs
CHANGED
|
@@ -1,84 +1,66 @@
|
|
|
1
1
|
// src/cursor.ts
|
|
2
2
|
function recordCursor(inputEl, scope) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
if (!inputEl || !scope.isActiveElement(inputEl)) return;
|
|
4
|
+
try {
|
|
5
|
+
const { selectionStart: start, selectionEnd: end, value } = inputEl;
|
|
6
|
+
if (start == null || end == null) return void 0;
|
|
7
|
+
return {
|
|
8
|
+
start,
|
|
9
|
+
end,
|
|
10
|
+
value
|
|
11
|
+
};
|
|
12
|
+
} catch {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
11
15
|
}
|
|
12
16
|
function restoreCursor(inputEl, selection, scope) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
if (!inputEl || !scope.isActiveElement(inputEl)) return;
|
|
18
|
+
if (!selection) {
|
|
19
|
+
const len = inputEl.value.length;
|
|
20
|
+
inputEl.setSelectionRange(len, len);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
const newValue = inputEl.value;
|
|
25
|
+
const { start, end, value: oldValue } = selection;
|
|
26
|
+
if (newValue === oldValue) {
|
|
27
|
+
inputEl.setSelectionRange(start, end);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const newStart = getNextCursorPosition(oldValue, newValue, start);
|
|
31
|
+
const newEnd = start === end ? newStart : getNextCursorPosition(oldValue, newValue, end);
|
|
32
|
+
const clampedStart = Math.max(0, Math.min(newStart, newValue.length));
|
|
33
|
+
const clampedEnd = Math.max(clampedStart, Math.min(newEnd, newValue.length));
|
|
34
|
+
inputEl.setSelectionRange(clampedStart, clampedEnd);
|
|
35
|
+
} catch {
|
|
36
|
+
const len = inputEl.value.length;
|
|
37
|
+
inputEl.setSelectionRange(len, len);
|
|
38
|
+
}
|
|
35
39
|
}
|
|
36
40
|
function getNextCursorPosition(oldValue, newValue, oldPosition) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
if (suffixLength >= afterCursor.length) {
|
|
63
|
-
return newValue.length - suffixLength;
|
|
64
|
-
}
|
|
65
|
-
if (prefixLength > 0) {
|
|
66
|
-
return prefixLength;
|
|
67
|
-
}
|
|
68
|
-
if (suffixLength > 0) {
|
|
69
|
-
return newValue.length - suffixLength;
|
|
70
|
-
}
|
|
71
|
-
if (oldPosition === 0 && prefixLength === 0 && suffixLength === 0) {
|
|
72
|
-
return newValue.length;
|
|
73
|
-
}
|
|
74
|
-
if (oldValue.length > 0) {
|
|
75
|
-
const ratio = oldPosition / oldValue.length;
|
|
76
|
-
return Math.round(ratio * newValue.length);
|
|
77
|
-
}
|
|
78
|
-
return newValue.length;
|
|
41
|
+
const beforeCursor = oldValue.slice(0, oldPosition);
|
|
42
|
+
const afterCursor = oldValue.slice(oldPosition);
|
|
43
|
+
let prefixLength = 0;
|
|
44
|
+
const maxPrefixLength = Math.min(beforeCursor.length, newValue.length);
|
|
45
|
+
for (let i = 0; i < maxPrefixLength; i++) if (beforeCursor[i] === newValue[i]) prefixLength = i + 1;
|
|
46
|
+
else break;
|
|
47
|
+
let suffixLength = 0;
|
|
48
|
+
const maxSuffixLength = Math.min(afterCursor.length, newValue.length - prefixLength);
|
|
49
|
+
for (let i = 0; i < maxSuffixLength; i++) {
|
|
50
|
+
const oldIndex = afterCursor.length - 1 - i;
|
|
51
|
+
const newIndex = newValue.length - 1 - i;
|
|
52
|
+
if (afterCursor[oldIndex] === newValue[newIndex]) suffixLength = i + 1;
|
|
53
|
+
else break;
|
|
54
|
+
}
|
|
55
|
+
if (beforeCursor.length > 0 && prefixLength >= beforeCursor.length) return prefixLength;
|
|
56
|
+
if (suffixLength >= afterCursor.length) return newValue.length - suffixLength;
|
|
57
|
+
if (prefixLength > 0) return prefixLength;
|
|
58
|
+
if (suffixLength > 0) return newValue.length - suffixLength;
|
|
59
|
+
if (oldPosition === 0 && prefixLength === 0 && suffixLength === 0) return newValue.length;
|
|
60
|
+
if (oldValue.length > 0) {
|
|
61
|
+
const ratio = oldPosition / oldValue.length;
|
|
62
|
+
return Math.round(ratio * newValue.length);
|
|
63
|
+
}
|
|
64
|
+
return newValue.length;
|
|
79
65
|
}
|
|
80
|
-
export {
|
|
81
|
-
getNextCursorPosition,
|
|
82
|
-
recordCursor,
|
|
83
|
-
restoreCursor
|
|
84
|
-
};
|
|
66
|
+
export { getNextCursorPosition, recordCursor, restoreCursor };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import '@zag-js/types';
|
|
8
|
-
import '@zag-js/core';
|
|
9
|
-
import '@internationalized/number';
|
|
1
|
+
import { anatomy } from "./number-input.anatomy.mjs";
|
|
2
|
+
import { connect } from "./number-input.connect.mjs";
|
|
3
|
+
import { machine } from "./number-input.machine.mjs";
|
|
4
|
+
import { props, splitProps } from "./number-input.props.mjs";
|
|
5
|
+
import { ElementIds, FocusChangeDetails, HintValue, InputMode, IntlTranslations, NumberInputApi, NumberInputMachine, NumberInputProps, NumberInputService, ValidityState, ValueChangeDetails, ValueInvalidDetails } from "./number-input.types.mjs";
|
|
6
|
+
export { type NumberInputApi as Api, type ElementIds, type FocusChangeDetails, type HintValue, type InputMode, type IntlTranslations, type NumberInputMachine as Machine, type NumberInputProps as Props, type NumberInputService as Service, type ValidityState, type ValueChangeDetails, type ValueInvalidDetails, anatomy, connect, machine, props, splitProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import '@zag-js/types';
|
|
8
|
-
import '@zag-js/core';
|
|
9
|
-
import '@internationalized/number';
|
|
1
|
+
import { anatomy } from "./number-input.anatomy.js";
|
|
2
|
+
import { connect } from "./number-input.connect.js";
|
|
3
|
+
import { machine } from "./number-input.machine.js";
|
|
4
|
+
import { props, splitProps } from "./number-input.props.js";
|
|
5
|
+
import { ElementIds, FocusChangeDetails, HintValue, InputMode, IntlTranslations, NumberInputApi, NumberInputMachine, NumberInputProps, NumberInputService, ValidityState, ValueChangeDetails, ValueInvalidDetails } from "./number-input.types.js";
|
|
6
|
+
export { type NumberInputApi as Api, type ElementIds, type FocusChangeDetails, type HintValue, type InputMode, type IntlTranslations, type NumberInputMachine as Machine, type NumberInputProps as Props, type NumberInputService as Service, type ValidityState, type ValueChangeDetails, type ValueInvalidDetails, anatomy, connect, machine, props, splitProps };
|
package/dist/index.js
CHANGED
|
@@ -1,39 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/index.ts
|
|
22
|
-
var index_exports = {};
|
|
23
|
-
__export(index_exports, {
|
|
24
|
-
anatomy: () => import_number_input.anatomy,
|
|
25
|
-
connect: () => import_number_input2.connect,
|
|
26
|
-
machine: () => import_number_input3.machine
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(index_exports);
|
|
29
|
-
var import_number_input = require("./number-input.anatomy.js");
|
|
30
|
-
var import_number_input2 = require("./number-input.connect.js");
|
|
31
|
-
var import_number_input3 = require("./number-input.machine.js");
|
|
32
|
-
__reExport(index_exports, require("./number-input.props.js"), module.exports);
|
|
33
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
-
0 && (module.exports = {
|
|
35
|
-
anatomy,
|
|
36
|
-
connect,
|
|
37
|
-
machine,
|
|
38
|
-
...require("./number-input.props.js")
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
39
4
|
});
|
|
5
|
+
const require_number_input_anatomy = require("./number-input.anatomy.js");
|
|
6
|
+
const require_number_input_connect = require("./number-input.connect.js");
|
|
7
|
+
const require_number_input_machine = require("./number-input.machine.js");
|
|
8
|
+
const require_number_input_props = require("./number-input.props.js");
|
|
9
|
+
exports.anatomy = require_number_input_anatomy.anatomy;
|
|
10
|
+
exports.connect = require_number_input_connect.connect;
|
|
11
|
+
exports.machine = require_number_input_machine.machine;
|
|
12
|
+
exports.props = require_number_input_props.props;
|
|
13
|
+
exports.splitProps = require_number_input_props.splitProps;
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
// src/index.ts
|
|
2
1
|
import { anatomy } from "./number-input.anatomy.mjs";
|
|
3
2
|
import { connect } from "./number-input.connect.mjs";
|
|
4
3
|
import { machine } from "./number-input.machine.mjs";
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
anatomy,
|
|
8
|
-
connect,
|
|
9
|
-
machine
|
|
10
|
-
};
|
|
4
|
+
import { props, splitProps } from "./number-input.props.mjs";
|
|
5
|
+
export { anatomy, connect, machine, props, splitProps };
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const anatomy: _zag_js_anatomy.AnatomyInstance<"root" | "label" | "input" | "control" | "valueText" | "incrementTrigger" | "decrementTrigger" | "scrubber">;
|
|
4
|
-
declare const parts: Record<"root" | "label" | "input" | "control" | "valueText" | "incrementTrigger" | "decrementTrigger" | "scrubber", _zag_js_anatomy.AnatomyPart>;
|
|
5
|
-
|
|
6
|
-
export { anatomy, parts };
|
|
1
|
+
export declare const anatomy: import("@zag-js/anatomy").AnatomyInstance<"control" | "decrementTrigger" | "incrementTrigger" | "input" | "label" | "root" | "scrubber" | "valueText">;
|
|
2
|
+
export declare const parts: Record<"control" | "decrementTrigger" | "incrementTrigger" | "input" | "label" | "root" | "scrubber" | "valueText", import("@zag-js/anatomy").AnatomyPart>;
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const anatomy: _zag_js_anatomy.AnatomyInstance<"root" | "label" | "input" | "control" | "valueText" | "incrementTrigger" | "decrementTrigger" | "scrubber">;
|
|
4
|
-
declare const parts: Record<"root" | "label" | "input" | "control" | "valueText" | "incrementTrigger" | "decrementTrigger" | "scrubber", _zag_js_anatomy.AnatomyPart>;
|
|
5
|
-
|
|
6
|
-
export { anatomy, parts };
|
|
1
|
+
export declare const anatomy: import("@zag-js/anatomy").AnatomyInstance<"control" | "decrementTrigger" | "incrementTrigger" | "input" | "label" | "root" | "scrubber" | "valueText">;
|
|
2
|
+
export declare const parts: Record<"control" | "decrementTrigger" | "incrementTrigger" | "input" | "label" | "root" | "scrubber" | "valueText", import("@zag-js/anatomy").AnatomyPart>;
|
|
@@ -1,43 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/number-input.anatomy.ts
|
|
21
|
-
var number_input_anatomy_exports = {};
|
|
22
|
-
__export(number_input_anatomy_exports, {
|
|
23
|
-
anatomy: () => anatomy,
|
|
24
|
-
parts: () => parts
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(number_input_anatomy_exports);
|
|
27
|
-
var import_anatomy = require("@zag-js/anatomy");
|
|
28
|
-
var anatomy = (0, import_anatomy.createAnatomy)("numberInput").parts(
|
|
29
|
-
"root",
|
|
30
|
-
"label",
|
|
31
|
-
"input",
|
|
32
|
-
"control",
|
|
33
|
-
"valueText",
|
|
34
|
-
"incrementTrigger",
|
|
35
|
-
"decrementTrigger",
|
|
36
|
-
"scrubber"
|
|
37
|
-
);
|
|
38
|
-
var parts = anatomy.build();
|
|
39
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
-
0 && (module.exports = {
|
|
41
|
-
anatomy,
|
|
42
|
-
parts
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
43
4
|
});
|
|
5
|
+
// src/number-input.anatomy.ts
|
|
6
|
+
const anatomy = (0, require("@zag-js/anatomy").createAnatomy)("numberInput").parts("root", "label", "input", "control", "valueText", "incrementTrigger", "decrementTrigger", "scrubber");
|
|
7
|
+
const parts = anatomy.build();
|
|
8
|
+
exports.anatomy = anatomy;
|
|
9
|
+
exports.parts = parts;
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
// src/number-input.anatomy.ts
|
|
2
1
|
import { createAnatomy } from "@zag-js/anatomy";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"control",
|
|
8
|
-
"valueText",
|
|
9
|
-
"incrementTrigger",
|
|
10
|
-
"decrementTrigger",
|
|
11
|
-
"scrubber"
|
|
12
|
-
);
|
|
13
|
-
var parts = anatomy.build();
|
|
14
|
-
export {
|
|
15
|
-
anatomy,
|
|
16
|
-
parts
|
|
17
|
-
};
|
|
2
|
+
// src/number-input.anatomy.ts
|
|
3
|
+
const anatomy = createAnatomy("numberInput").parts("root", "label", "input", "control", "valueText", "incrementTrigger", "decrementTrigger", "scrubber");
|
|
4
|
+
const parts = anatomy.build();
|
|
5
|
+
export { anatomy, parts };
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import '@zag-js/core';
|
|
5
|
-
|
|
6
|
-
declare function connect<T extends PropTypes>(service: NumberInputService, normalize: NormalizeProps<T>): NumberInputApi<T>;
|
|
7
|
-
|
|
8
|
-
export { connect };
|
|
1
|
+
import { NumberInputApi, NumberInputService } from "./number-input.types.mjs";
|
|
2
|
+
import { NormalizeProps, PropTypes } from "@zag-js/types";
|
|
3
|
+
export declare function connect<T extends PropTypes>(service: NumberInputService, normalize: NormalizeProps<T>): NumberInputApi<T>;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import '@zag-js/core';
|
|
5
|
-
|
|
6
|
-
declare function connect<T extends PropTypes>(service: NumberInputService, normalize: NormalizeProps<T>): NumberInputApi<T>;
|
|
7
|
-
|
|
8
|
-
export { connect };
|
|
1
|
+
import { NumberInputApi, NumberInputService } from "./number-input.types.js";
|
|
2
|
+
import { NormalizeProps, PropTypes } from "@zag-js/types";
|
|
3
|
+
export declare function connect<T extends PropTypes>(service: NumberInputService, normalize: NormalizeProps<T>): NumberInputApi<T>;
|