@design-factory/core 21.1.0 → 22.0.0-next.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/{accordion-D9ba0XYq.js → accordion-DUFLBQkV.js} +90 -28
- package/alert-Db6cG6JE.js +125 -0
- package/{collapse-Bn8iHKrd.js → collapse-D8Jo56k9.js} +2 -2
- package/{common-DFyZvkII.js → common-CP4amR0Z.js} +2 -2
- package/components/accordion/accordion.d.ts +80 -22
- package/components/accordion/index.js +1 -1
- package/components/alert/alert.d.ts +77 -8
- package/components/alert/common.d.ts +9 -9
- package/components/alert/index.js +2 -3
- package/components/carousel/index.js +2 -2
- package/components/collapse/index.js +1 -1
- package/components/drawer/drawer.d.ts +13 -0
- package/components/drawer/index.js +1 -1
- package/components/dropdown/dropdown.d.ts +110 -0
- package/components/dropdown/index.d.ts +1 -0
- package/components/dropdown/index.js +5 -0
- package/components/modal/index.js +1 -1
- package/components/pagination/index.js +1 -1
- package/components/progressbar/index.js +1 -1
- package/components/rating/index.js +1 -1
- package/components/slider/index.js +1 -1
- package/components/slider/slider.d.ts +23 -4
- package/components/toast/index.js +1 -1
- package/components/tooltip/index.d.ts +1 -0
- package/components/tooltip/index.js +174 -0
- package/components/tooltip/tooltip.d.ts +63 -0
- package/components/tree/index.js +1 -1
- package/{directive-CNNSo5Yn.js → directive-CMT2vEDg.js} +7 -4
- package/{drawer-CoBXUPyv.js → drawer-D4xSbhcT.js} +19 -5
- package/dropdown-Bjj2ql6d.js +246 -0
- package/index.d.ts +3 -1
- package/index.js +45 -39
- package/isFocusable-C2iRr0zh.js +72 -0
- package/{modal-BH9nrwVz.js → modal-CQWh2Sm5.js} +3 -3
- package/package.json +1 -1
- package/{pagination-BQWusWXN.js → pagination-DIRcpdRE.js} +2 -2
- package/{progressbar-S1pNn5rM.js → progressbar-Bth8r3Qu.js} +2 -2
- package/{promise-D-RZVPuv.js → promise-CkIc0KKt.js} +3 -3
- package/{rating-DWgGgwk3.js → rating-DLsgFSyB.js} +2 -2
- package/services/extendWidget.d.ts +1 -1
- package/services/focusElement.js +2 -2
- package/services/focustrack.js +2 -2
- package/services/matchMedia.js +1 -1
- package/services/mousetrack.d.ts +34 -0
- package/services/mousetrack.js +41 -0
- package/services/navManager.js +2 -2
- package/services/pointerdownPosition.js +1 -1
- package/services/portal.js +1 -1
- package/services/positioning.d.ts +101 -0
- package/services/positioning.js +104 -0
- package/services/resizeObserver.js +1 -1
- package/services/siblingsInert.js +1 -1
- package/services/transitions/baseTransitions.js +8 -8
- package/services/transitions/collapse.d.ts +4 -0
- package/services/transitions/collapse.js +23 -19
- package/services/transitions/cssTransitions.js +2 -2
- package/services/transitions/simpleClassTransition.js +1 -1
- package/{slider-Br_Qiopx.js → slider-tH5g55yQ.js} +132 -97
- package/{toaster-BUBzFeJM.js → toaster-BS9qeRLF.js} +3 -3
- package/{tree-vD7ZkV8Z.js → tree-DW6iLxdw.js} +2 -2
- package/types.d.ts +8 -1
- package/utils/debounceSignal.d.ts +11 -0
- package/utils/debounceSignal.js +18 -0
- package/utils/directive.js +1 -1
- package/utils/edgeState.d.ts +23 -0
- package/utils/edgeState.js +43 -0
- package/utils/internal/isFocusable.d.ts +40 -0
- package/utils/stores.d.ts +2 -16
- package/utils/stores.js +5 -24
- package/utils/writables.d.ts +27 -13
- package/utils/writables.js +12 -11
- package/{writables-DYGjj5T3.js → writables-_7BriMb2.js} +37 -12
- package/accordion-B0vs8JWM.cjs +0 -314
- package/alert-AhaliJ17.cjs +0 -9
- package/alert-Cb9FhbFQ.js +0 -10
- package/collapse-BnWw4Hnc.cjs +0 -94
- package/common-B5jS-Ih_.cjs +0 -73
- package/components/accordion/index.cjs +0 -7
- package/components/alert/index.cjs +0 -5
- package/components/carousel/index.cjs +0 -292
- package/components/collapse/index.cjs +0 -5
- package/components/drawer/index.cjs +0 -5
- package/components/modal/index.cjs +0 -8
- package/components/pagination/index.cjs +0 -5
- package/components/progressbar/index.cjs +0 -5
- package/components/rating/index.cjs +0 -5
- package/components/slider/index.cjs +0 -5
- package/components/toast/index.cjs +0 -7
- package/components/tree/index.cjs +0 -5
- package/config.cjs +0 -36
- package/directive-DyTodNPd.cjs +0 -523
- package/drawer-Ca_ktkEs.cjs +0 -328
- package/index.cjs +0 -134
- package/isFocusable-Ckwus82R.js +0 -32
- package/isFocusable-DfzDLeAN.cjs +0 -31
- package/modal-Dxdw2Pkv.cjs +0 -252
- package/pagination-BLVa1UsZ.cjs +0 -254
- package/progressbar-RopgvVeA.cjs +0 -86
- package/promise-CxCD3NYv.cjs +0 -118
- package/rating-DZ3OQgtt.cjs +0 -183
- package/scrollbars-f651ntzz.cjs +0 -33
- package/services/extendWidget.cjs +0 -41
- package/services/floatingUI.cjs +0 -111
- package/services/floatingUI.d.ts +0 -76
- package/services/floatingUI.js +0 -111
- package/services/focusElement.cjs +0 -46
- package/services/focustrack.cjs +0 -47
- package/services/hash.cjs +0 -15
- package/services/intersection.cjs +0 -53
- package/services/matchMedia.cjs +0 -14
- package/services/navManager.cjs +0 -166
- package/services/pointerdownPosition.cjs +0 -60
- package/services/portal.cjs +0 -42
- package/services/resizeObserver.cjs +0 -54
- package/services/siblingsInert.cjs +0 -44
- package/services/transitions/baseTransitions.cjs +0 -186
- package/services/transitions/collapse.cjs +0 -40
- package/services/transitions/cssTransitions.cjs +0 -32
- package/services/transitions/simpleClassTransition.cjs +0 -37
- package/slider-pgDq1V5r.cjs +0 -807
- package/textDirection-zqcZ5-eK.cjs +0 -3
- package/toaster-Dlube4Ya.cjs +0 -161
- package/tree-Chcy4ulJ.cjs +0 -228
- package/types.cjs +0 -6
- package/utils/directive.cjs +0 -28
- package/utils/func.cjs +0 -7
- package/utils/id.cjs +0 -5
- package/utils/stores.cjs +0 -172
- package/utils/widget.cjs +0 -8
- package/utils/writables.cjs +0 -16
- package/writables-Dt68gADJ.cjs +0 -102
package/writables-Dt68gADJ.cjs
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const types = require("./types.cjs");
|
|
3
|
-
function isNumber(value) {
|
|
4
|
-
return typeof value === "number" && !isNaN(value) && Number.isFinite(value);
|
|
5
|
-
}
|
|
6
|
-
function isBoolean(value) {
|
|
7
|
-
return value === true || value === false;
|
|
8
|
-
}
|
|
9
|
-
function isFunction(value) {
|
|
10
|
-
return typeof value === "function";
|
|
11
|
-
}
|
|
12
|
-
function isString(value) {
|
|
13
|
-
return typeof value === "string";
|
|
14
|
-
}
|
|
15
|
-
const isArray = Array.isArray;
|
|
16
|
-
function clamp(value, max, min = 0) {
|
|
17
|
-
return Math.max(Math.min(value, max), min);
|
|
18
|
-
}
|
|
19
|
-
const isHTMLElement = (value) => value instanceof HTMLElement;
|
|
20
|
-
const allowNull = (isType) => (value) => value === null || isType(value);
|
|
21
|
-
function isFromEnum(list) {
|
|
22
|
-
return (value) => list.includes(value);
|
|
23
|
-
}
|
|
24
|
-
const testToNormalizeValue = (filter) => (value) => filter(value) ? value : types.INVALID_VALUE;
|
|
25
|
-
const numberNormalizeFn = testToNormalizeValue(isNumber);
|
|
26
|
-
const typeNumber = {
|
|
27
|
-
normalizeValue: numberNormalizeFn
|
|
28
|
-
};
|
|
29
|
-
function typeNumberInRangeFactory(min, max, options = {}) {
|
|
30
|
-
const { strict = false, useClamp = true } = options;
|
|
31
|
-
return {
|
|
32
|
-
normalizeValue: (value) => {
|
|
33
|
-
let normalizedNumber = numberNormalizeFn(value);
|
|
34
|
-
if (normalizedNumber !== types.INVALID_VALUE) {
|
|
35
|
-
if (!strict && useClamp) {
|
|
36
|
-
normalizedNumber = clamp(normalizedNumber, max, min);
|
|
37
|
-
}
|
|
38
|
-
if (normalizedNumber >= min && normalizedNumber <= max) {
|
|
39
|
-
if (!strict || normalizedNumber !== min && normalizedNumber !== max) {
|
|
40
|
-
return normalizedNumber;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return types.INVALID_VALUE;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
const typeBoolean = {
|
|
49
|
-
normalizeValue: testToNormalizeValue(isBoolean)
|
|
50
|
-
};
|
|
51
|
-
const typeBooleanOrNull = {
|
|
52
|
-
normalizeValue: testToNormalizeValue(allowNull(isBoolean))
|
|
53
|
-
};
|
|
54
|
-
const typeString = {
|
|
55
|
-
normalizeValue: testToNormalizeValue(isString)
|
|
56
|
-
};
|
|
57
|
-
const typeStringOrNull = {
|
|
58
|
-
normalizeValue: testToNormalizeValue(allowNull(isString))
|
|
59
|
-
};
|
|
60
|
-
const typeNumberOrNull = {
|
|
61
|
-
normalizeValue: testToNormalizeValue(allowNull(isNumber))
|
|
62
|
-
};
|
|
63
|
-
const typeFunction = {
|
|
64
|
-
normalizeValue: testToNormalizeValue(isFunction),
|
|
65
|
-
equal: Object.is
|
|
66
|
-
};
|
|
67
|
-
const typeHTMLElementOrNull = {
|
|
68
|
-
normalizeValue: testToNormalizeValue(allowNull(isHTMLElement)),
|
|
69
|
-
equal: Object.is
|
|
70
|
-
};
|
|
71
|
-
const typeArray = {
|
|
72
|
-
normalizeValue: testToNormalizeValue(isArray),
|
|
73
|
-
equal: (a, b) => {
|
|
74
|
-
if (a === b) {
|
|
75
|
-
return true;
|
|
76
|
-
} else {
|
|
77
|
-
if (a?.length !== b?.length) {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
return a.every((val, index) => val === b[index]);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
function createTypeEnum(enumList) {
|
|
85
|
-
return {
|
|
86
|
-
normalizeValue: testToNormalizeValue(isFromEnum(enumList))
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
exports.clamp = clamp;
|
|
90
|
-
exports.createTypeEnum = createTypeEnum;
|
|
91
|
-
exports.isNumber = isNumber;
|
|
92
|
-
exports.testToNormalizeValue = testToNormalizeValue;
|
|
93
|
-
exports.typeArray = typeArray;
|
|
94
|
-
exports.typeBoolean = typeBoolean;
|
|
95
|
-
exports.typeBooleanOrNull = typeBooleanOrNull;
|
|
96
|
-
exports.typeFunction = typeFunction;
|
|
97
|
-
exports.typeHTMLElementOrNull = typeHTMLElementOrNull;
|
|
98
|
-
exports.typeNumber = typeNumber;
|
|
99
|
-
exports.typeNumberInRangeFactory = typeNumberInRangeFactory;
|
|
100
|
-
exports.typeNumberOrNull = typeNumberOrNull;
|
|
101
|
-
exports.typeString = typeString;
|
|
102
|
-
exports.typeStringOrNull = typeStringOrNull;
|