@agnos-ui/core 0.10.0-next.2 → 0.10.0-next.3
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-DqnKGmbS.js → accordion-47EpOD36.js} +2 -2
- package/{accordion-DRIm0xHf.cjs → accordion-nxveC0GZ.cjs} +2 -2
- package/{alert-B-jQDQcB.cjs → alert-AhaliJ17.cjs} +1 -1
- package/{alert-gGz2CDS9.js → alert-anMaigvi.js} +1 -1
- package/{collapse-BV4kD3j9.js → collapse-CrfvGo_T.js} +2 -2
- package/{collapse-gLiT080Y.cjs → collapse-Da_27YUU.cjs} +2 -2
- package/{common-D3QcdJ6S.cjs → common-B5jS-Ih_.cjs} +1 -1
- package/{common-DK0ADNTX.js → common-CCxNtFNM.js} +1 -1
- package/components/accordion/index.cjs +1 -1
- package/components/accordion/index.js +1 -1
- package/components/alert/index.cjs +1 -1
- package/components/alert/index.js +1 -1
- package/components/carousel/index.cjs +2 -2
- package/components/carousel/index.js +2 -2
- package/components/collapse/index.cjs +1 -1
- package/components/collapse/index.js +1 -1
- package/components/drawer/drawer.d.ts +32 -25
- package/components/drawer/index.cjs +1 -1
- package/components/drawer/index.js +1 -1
- package/components/modal/index.cjs +1 -1
- package/components/modal/index.js +1 -1
- package/components/pagination/index.cjs +1 -1
- package/components/pagination/index.js +1 -1
- package/components/progressbar/index.cjs +1 -1
- package/components/progressbar/index.js +1 -1
- package/components/rating/index.cjs +1 -1
- package/components/rating/index.js +1 -1
- package/components/select/index.cjs +1 -1
- package/components/select/index.js +1 -1
- package/components/slider/index.cjs +1 -1
- package/components/slider/index.js +1 -1
- package/components/toast/index.cjs +1 -1
- package/components/toast/index.js +1 -1
- package/components/tree/index.cjs +1 -1
- package/components/tree/index.js +1 -1
- package/{dom-C2gi9OCP.cjs → dom-Cm9_uROp.cjs} +76 -6
- package/{dom-Bcg9ORcA.js → dom-DD1hAVZy.js} +76 -6
- package/drawer-Caz4Uypu.js +291 -0
- package/{drawer-DP7UPojk.cjs → drawer-DOi0TqZC.cjs} +131 -91
- package/index.cjs +16 -14
- package/index.js +21 -19
- package/{modal-DiXZXYjR.cjs → modal-B_3Uxplo.cjs} +5 -5
- package/{modal-CAvQW-vo.js → modal-cKd3qUn1.js} +5 -5
- package/package.json +1 -1
- package/{pagination-DvZ2rLsz.cjs → pagination-2Vor6JPZ.cjs} +2 -2
- package/{pagination-BKbMROV6.js → pagination-DlOyP_2C.js} +2 -2
- package/{progressbar-D8zIcm9n.js → progressbar-B5g76eMV.js} +2 -2
- package/{progressbar-i9xfAxb7.cjs → progressbar-DyBRINco.cjs} +2 -2
- package/{rating-DmG4oUkr.cjs → rating-C0y1j4SC.cjs} +2 -2
- package/{rating-DEXTGWCU.js → rating-C7C4-p4B.js} +2 -2
- package/{select-MFjAnIt7.cjs → select-Dhsb9msC.cjs} +1 -1
- package/{select-Bw68Xdu5.js → select-nnl00UWY.js} +1 -1
- package/services/floatingUI.cjs +1 -1
- package/services/floatingUI.js +1 -1
- package/services/focusElement.cjs +1 -1
- package/services/focusElement.js +1 -1
- package/services/focustrack.cjs +1 -1
- package/services/focustrack.js +1 -1
- package/services/matchMedia.cjs +1 -1
- package/services/matchMedia.js +1 -1
- package/services/navManager.cjs +1 -1
- package/services/navManager.js +1 -1
- package/services/pointerdownPosition.cjs +60 -0
- package/services/pointerdownPosition.d.ts +42 -0
- package/services/pointerdownPosition.js +60 -0
- package/services/portal.cjs +1 -1
- package/services/portal.js +1 -1
- package/services/resizeObserver.cjs +40 -20
- package/services/resizeObserver.d.ts +10 -2
- package/services/resizeObserver.js +41 -21
- package/services/siblingsInert.cjs +1 -1
- package/services/siblingsInert.js +1 -1
- package/services/transitions/baseTransitions.cjs +2 -2
- package/services/transitions/baseTransitions.js +2 -2
- package/services/transitions/collapse.cjs +11 -15
- package/services/transitions/collapse.js +11 -15
- package/services/transitions/cssTransitions.cjs +1 -1
- package/services/transitions/cssTransitions.js +1 -1
- package/services/transitions/simpleClassTransition.cjs +1 -1
- package/services/transitions/simpleClassTransition.js +1 -1
- package/{slider-Cx50Eghd.js → slider-B4WrdTeE.js} +121 -170
- package/{slider-Dl4Trh32.cjs → slider-DTO58syz.cjs} +120 -169
- package/{toaster-_p1GTtHI.js → toaster-CRPErgI2.js} +3 -3
- package/{toaster-UDglac7x.cjs → toaster-CT148JSJ.cjs} +3 -3
- package/{tree-rGHtmCnS.cjs → tree-C4l2Wqny.cjs} +2 -2
- package/{tree-DV0tfPlZ.js → tree-CHpFqJPx.js} +2 -2
- package/types.cjs +2 -2
- package/types.d.ts +22 -3
- package/types.js +2 -2
- package/utils/directive.cjs +1 -1
- package/utils/directive.d.ts +2 -2
- package/utils/directive.js +1 -1
- package/utils/internal/ssrHTMLElement.d.ts +7 -1
- package/utils/stores.cjs +1 -1
- package/utils/stores.js +1 -1
- package/utils/writables.cjs +2 -1
- package/utils/writables.d.ts +7 -0
- package/utils/writables.js +6 -5
- package/{writables-DcGT98a7.cjs → writables-Dt68gADJ.cjs} +4 -0
- package/{writables-e0tyaQpe.js → writables-Is1bF1Vt.js} +10 -6
- package/drawer-D5SO73ew.js +0 -251
|
@@ -2,8 +2,8 @@ import { writablesForProps, idWithDefault, stateStores, true$, mergeConfigStores
|
|
|
2
2
|
import { createTransition } from "./services/transitions/baseTransitions.js";
|
|
3
3
|
import { writable, computed, readable, asWritable } from "@amadeus-it-group/tansu";
|
|
4
4
|
import { noop } from "./utils/func.js";
|
|
5
|
-
import {
|
|
6
|
-
import { n as mergeDirectives, p as createAttributesDirective, r as registrationArray, d as directiveSubscribe } from "./dom-
|
|
5
|
+
import { k as createTypeEnum, e as typeString, h as typeFunction, c as typeBoolean } from "./writables-Is1bF1Vt.js";
|
|
6
|
+
import { n as mergeDirectives, p as createAttributesDirective, r as registrationArray, d as directiveSubscribe } from "./dom-DD1hAVZy.js";
|
|
7
7
|
import { createWidgetFactory } from "./utils/widget.js";
|
|
8
8
|
function adjustItemsCloseOthers(items, openItems, oldOpen) {
|
|
9
9
|
let keepOpen;
|
|
@@ -3,8 +3,8 @@ const utils_stores = require("./utils/stores.cjs");
|
|
|
3
3
|
const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
|
|
4
4
|
const tansu = require("@amadeus-it-group/tansu");
|
|
5
5
|
const utils_func = require("./utils/func.cjs");
|
|
6
|
-
const utils_writables = require("./writables-
|
|
7
|
-
const utils_directive = require("./dom-
|
|
6
|
+
const utils_writables = require("./writables-Dt68gADJ.cjs");
|
|
7
|
+
const utils_directive = require("./dom-Cm9_uROp.cjs");
|
|
8
8
|
const utils_widget = require("./utils/widget.cjs");
|
|
9
9
|
function adjustItemsCloseOthers(items, openItems, oldOpen) {
|
|
10
10
|
let keepOpen;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getCommonAlertDefaultConfig, c as createCommonAlert } from "./common-
|
|
1
|
+
import { g as getCommonAlertDefaultConfig, c as createCommonAlert } from "./common-CCxNtFNM.js";
|
|
2
2
|
import { createWidgetFactory } from "./utils/widget.js";
|
|
3
3
|
function getAlertDefaultConfig() {
|
|
4
4
|
return { ...getCommonAlertDefaultConfig() };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createTransition } from "./services/transitions/baseTransitions.js";
|
|
2
2
|
import { writablesForProps, idWithDefault, stateStores } from "./utils/stores.js";
|
|
3
|
-
import { p as createAttributesDirective, n as mergeDirectives } from "./dom-
|
|
4
|
-
import {
|
|
3
|
+
import { p as createAttributesDirective, n as mergeDirectives } from "./dom-DD1hAVZy.js";
|
|
4
|
+
import { h as typeFunction, e as typeString, c as typeBoolean } from "./writables-Is1bF1Vt.js";
|
|
5
5
|
import { computed } from "@amadeus-it-group/tansu";
|
|
6
6
|
import { noop } from "./utils/func.js";
|
|
7
7
|
import { createWidgetFactory } from "./utils/widget.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
|
|
3
3
|
const utils_stores = require("./utils/stores.cjs");
|
|
4
|
-
const utils_directive = require("./dom-
|
|
5
|
-
const utils_writables = require("./writables-
|
|
4
|
+
const utils_directive = require("./dom-Cm9_uROp.cjs");
|
|
5
|
+
const utils_writables = require("./writables-Dt68gADJ.cjs");
|
|
6
6
|
const tansu = require("@amadeus-it-group/tansu");
|
|
7
7
|
const utils_func = require("./utils/func.cjs");
|
|
8
8
|
const utils_widget = require("./utils/widget.cjs");
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
|
|
3
3
|
const utils_func = require("./utils/func.cjs");
|
|
4
4
|
const utils_stores = require("./utils/stores.cjs");
|
|
5
|
-
const utils_writables = require("./writables-
|
|
5
|
+
const utils_writables = require("./writables-Dt68gADJ.cjs");
|
|
6
6
|
const defaultCommonAlertConfig = {
|
|
7
7
|
visible: true,
|
|
8
8
|
dismissible: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createTransition } from "./services/transitions/baseTransitions.js";
|
|
2
2
|
import { noop } from "./utils/func.js";
|
|
3
3
|
import { writablesForProps, stateStores } from "./utils/stores.js";
|
|
4
|
-
import { e as typeString, c as typeBoolean,
|
|
4
|
+
import { e as typeString, c as typeBoolean, h as typeFunction } from "./writables-Is1bF1Vt.js";
|
|
5
5
|
const defaultCommonAlertConfig = {
|
|
6
6
|
visible: true,
|
|
7
7
|
dismissible: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const accordion = require("../../accordion-
|
|
3
|
+
const accordion = require("../../accordion-nxveC0GZ.cjs");
|
|
4
4
|
exports.createAccordion = accordion.createAccordion;
|
|
5
5
|
exports.createAccordionItem = accordion.createAccordionItem;
|
|
6
6
|
exports.factoryCreateAccordion = accordion.factoryCreateAccordion;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const alert = require("../../alert-
|
|
3
|
+
const alert = require("../../alert-AhaliJ17.cjs");
|
|
4
4
|
exports.createAlert = alert.createAlert;
|
|
5
5
|
exports.getAlertDefaultConfig = alert.getAlertDefaultConfig;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const utils_stores = require("../../utils/stores.cjs");
|
|
4
|
-
const utils_directive = require("../../dom-
|
|
4
|
+
const utils_directive = require("../../dom-Cm9_uROp.cjs");
|
|
5
5
|
const EmblaCarousel = require("embla-carousel");
|
|
6
6
|
const tansu = require("@amadeus-it-group/tansu");
|
|
7
|
-
const utils_writables = require("../../writables-
|
|
7
|
+
const utils_writables = require("../../writables-Dt68gADJ.cjs");
|
|
8
8
|
const services_navManager = require("../../services/navManager.cjs");
|
|
9
9
|
const utils_widget = require("../../utils/widget.cjs");
|
|
10
10
|
const defaultConfig = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { writablesForProps, stateStores, true$ } from "../../utils/stores.js";
|
|
2
|
-
import { a as bindDirective, b as browserDirective, p as createAttributesDirective, n as mergeDirectives } from "../../dom-
|
|
2
|
+
import { a as bindDirective, b as browserDirective, p as createAttributesDirective, n as mergeDirectives } from "../../dom-DD1hAVZy.js";
|
|
3
3
|
import EmblaCarousel from "embla-carousel";
|
|
4
4
|
import { writable, computed, asReadable, readable } from "@amadeus-it-group/tansu";
|
|
5
|
-
import {
|
|
5
|
+
import { h as typeFunction, e as typeString, c as typeBoolean, a as typeNumber, k as createTypeEnum, f as typeStringOrNull, j as typeArray } from "../../writables-Is1bF1Vt.js";
|
|
6
6
|
import { createNavManager } from "../../services/navManager.js";
|
|
7
7
|
import { createWidgetFactory } from "../../utils/widget.js";
|
|
8
8
|
const defaultConfig = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const collapse = require("../../collapse-
|
|
3
|
+
const collapse = require("../../collapse-Da_27YUU.cjs");
|
|
4
4
|
exports.createCollapse = collapse.createCollapse;
|
|
5
5
|
exports.getCollapseDefaultConfig = collapse.getCollapseDefaultConfig;
|
|
@@ -42,6 +42,13 @@ interface DrawerCommonPropsAndState extends WidgetsCommonPropsAndState {
|
|
|
42
42
|
* @defaultValue `false`
|
|
43
43
|
*/
|
|
44
44
|
resizable: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Size of the drawer in pixel once the user start interacting.
|
|
47
|
+
* It corresponds to the height or the width depending on the drawer orientation
|
|
48
|
+
*
|
|
49
|
+
* @defaultValue `null`
|
|
50
|
+
*/
|
|
51
|
+
size: number | null;
|
|
45
52
|
}
|
|
46
53
|
/**
|
|
47
54
|
* Interface representing the properties for the Drawer component.
|
|
@@ -92,18 +99,6 @@ export interface DrawerProps extends DrawerCommonPropsAndState {
|
|
|
92
99
|
* @defaultValue `''`
|
|
93
100
|
*/
|
|
94
101
|
ariaDescribedBy: string;
|
|
95
|
-
/**
|
|
96
|
-
* The width of the drawer in pixels.
|
|
97
|
-
*
|
|
98
|
-
* @defaultValue `200`
|
|
99
|
-
*/
|
|
100
|
-
width: number;
|
|
101
|
-
/**
|
|
102
|
-
* The height of the drawer in pixels.
|
|
103
|
-
*
|
|
104
|
-
* @defaultValue `200`
|
|
105
|
-
*/
|
|
106
|
-
height: number;
|
|
107
102
|
/**
|
|
108
103
|
* If `true` displays the backdrop element and disables the body scrolling, otherwise the body of the document is navigable
|
|
109
104
|
*
|
|
@@ -135,38 +130,54 @@ export interface DrawerProps extends DrawerCommonPropsAndState {
|
|
|
135
130
|
*/
|
|
136
131
|
onShown: () => void;
|
|
137
132
|
/**
|
|
138
|
-
* An event emitted when the width
|
|
133
|
+
* An event emitted when the drawer size changes (width or height depending on the orientation).
|
|
139
134
|
*
|
|
140
|
-
* Event payload is equal to the newly selected width.
|
|
135
|
+
* Event payload is equal to the newly selected width or height.
|
|
141
136
|
*
|
|
142
137
|
* @defaultValue
|
|
143
138
|
* ```ts
|
|
144
139
|
* () => {}
|
|
145
140
|
* ```
|
|
146
141
|
*/
|
|
147
|
-
|
|
142
|
+
onSizeChange: (size: number | null) => void;
|
|
148
143
|
/**
|
|
149
|
-
*
|
|
144
|
+
* Event to be triggered when the visible property changes.
|
|
150
145
|
*
|
|
151
|
-
*
|
|
146
|
+
* @param visible - new value of the visible propery
|
|
152
147
|
*
|
|
153
148
|
* @defaultValue
|
|
154
149
|
* ```ts
|
|
155
150
|
* () => {}
|
|
156
151
|
* ```
|
|
157
152
|
*/
|
|
158
|
-
|
|
153
|
+
onVisibleChange: (visible: boolean) => void;
|
|
159
154
|
/**
|
|
160
|
-
* Event to be triggered when the
|
|
155
|
+
* Event to be triggered when the minimized state changes.
|
|
161
156
|
*
|
|
162
|
-
* @
|
|
157
|
+
* @defaultValue
|
|
158
|
+
* ```ts
|
|
159
|
+
* () => {}
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
onMinimizedChange: (isMinimized: boolean) => void;
|
|
163
|
+
/**
|
|
164
|
+
* Event to be triggered when the maximized state changes.
|
|
163
165
|
*
|
|
164
166
|
* @defaultValue
|
|
165
167
|
* ```ts
|
|
166
168
|
* () => {}
|
|
167
169
|
* ```
|
|
168
170
|
*/
|
|
169
|
-
|
|
171
|
+
onMaximizedChange: (isMaximized: boolean) => void;
|
|
172
|
+
/**
|
|
173
|
+
* Event to be triggered when the user starts or stops resizing the drawer.
|
|
174
|
+
*
|
|
175
|
+
* @defaultValue
|
|
176
|
+
* ```ts
|
|
177
|
+
* () => {}
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
onResizingChange: (isResizing: boolean) => void;
|
|
170
181
|
}
|
|
171
182
|
/**
|
|
172
183
|
* Represents the state of a Drawer component.
|
|
@@ -219,10 +230,6 @@ export interface DrawerDirectives {
|
|
|
219
230
|
* Directive to put on the splitter DOM element.
|
|
220
231
|
*/
|
|
221
232
|
splitterDirective: Directive;
|
|
222
|
-
/**
|
|
223
|
-
* Directive to put on the container DOM element in order for the drawer to size correctly.
|
|
224
|
-
*/
|
|
225
|
-
containerDirective: Directive;
|
|
226
233
|
}
|
|
227
234
|
/**
|
|
228
235
|
* Represents a Drawer widget component.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const drawer = require("../../drawer-
|
|
3
|
+
const drawer = require("../../drawer-DOi0TqZC.cjs");
|
|
4
4
|
exports.createDrawer = drawer.createDrawer;
|
|
5
5
|
exports.getDrawerDefaultConfig = drawer.getDrawerDefaultConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const modal = require("../../modal-
|
|
3
|
+
const modal = require("../../modal-B_3Uxplo.cjs");
|
|
4
4
|
exports.createModal = modal.createModal;
|
|
5
5
|
exports.getModalDefaultConfig = modal.getModalDefaultConfig;
|
|
6
6
|
exports.modalCloseButtonClick = modal.modalCloseButtonClick;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const pagination = require("../../pagination-
|
|
3
|
+
const pagination = require("../../pagination-2Vor6JPZ.cjs");
|
|
4
4
|
exports.createPagination = pagination.createPagination;
|
|
5
5
|
exports.getPaginationDefaultConfig = pagination.getPaginationDefaultConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const progressbar = require("../../progressbar-
|
|
3
|
+
const progressbar = require("../../progressbar-DyBRINco.cjs");
|
|
4
4
|
exports.createProgressbar = progressbar.createProgressbar;
|
|
5
5
|
exports.getProgressbarDefaultConfig = progressbar.getProgressbarDefaultConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const rating = require("../../rating-
|
|
3
|
+
const rating = require("../../rating-C0y1j4SC.cjs");
|
|
4
4
|
exports.createRating = rating.createRating;
|
|
5
5
|
exports.getRatingDefaultConfig = rating.getRatingDefaultConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const select = require("../../select-
|
|
3
|
+
const select = require("../../select-Dhsb9msC.cjs");
|
|
4
4
|
exports.createSelect = select.createSelect;
|
|
5
5
|
exports.getSelectDefaultConfig = select.getSelectDefaultConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const slider = require("../../slider-
|
|
3
|
+
const slider = require("../../slider-DTO58syz.cjs");
|
|
4
4
|
exports.createSlider = slider.createSlider;
|
|
5
5
|
exports.getSliderDefaultConfig = slider.getSliderDefaultConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const toaster = require("../../toaster-
|
|
3
|
+
const toaster = require("../../toaster-CT148JSJ.cjs");
|
|
4
4
|
exports.Toaster = toaster.Toaster;
|
|
5
5
|
exports.createToast = toaster.createToast;
|
|
6
6
|
exports.defaultToasterProps = toaster.defaultToasterProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const tree = require("../../tree-
|
|
3
|
+
const tree = require("../../tree-C4l2Wqny.cjs");
|
|
4
4
|
exports.createTree = tree.createTree;
|
|
5
5
|
exports.getTreeDefaultConfig = tree.getTreeDefaultConfig;
|
package/components/tree/index.js
CHANGED
|
@@ -1,12 +1,74 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const esmEnv = require("esm-env");
|
|
3
|
-
const utils_func = require("./utils/func.cjs");
|
|
4
3
|
const tansu = require("@amadeus-it-group/tansu");
|
|
5
|
-
const
|
|
4
|
+
const utils_func = require("./utils/func.cjs");
|
|
5
|
+
const importantSuffixRegExp = /\s*!important$/;
|
|
6
|
+
const withoutImportant = (value) => value?.replace(importantSuffixRegExp, "") ?? "";
|
|
7
|
+
const toKebabCase = (str) => str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
8
|
+
const getStyleKeyFromDirectProp = (str) => {
|
|
9
|
+
if (typeof str !== "string" || str.startsWith("--")) {
|
|
10
|
+
return void 0;
|
|
11
|
+
}
|
|
12
|
+
return toKebabCase(str);
|
|
13
|
+
};
|
|
14
|
+
const getStyleKeyFromMethods = (str) => {
|
|
15
|
+
if (!str.startsWith("--") && str !== toKebabCase(str)) {
|
|
16
|
+
return void 0;
|
|
17
|
+
}
|
|
18
|
+
return str;
|
|
19
|
+
};
|
|
20
|
+
const ssrHTMLElementStyle = /* @__PURE__ */ Symbol("style");
|
|
21
|
+
class SSRStyle {
|
|
22
|
+
// all styles in kebab-case, including custom properties:
|
|
23
|
+
[ssrHTMLElementStyle] = {};
|
|
24
|
+
constructor() {
|
|
25
|
+
return new Proxy(this, {
|
|
26
|
+
get: (target, prop) => {
|
|
27
|
+
const styleKey = prop in target ? void 0 : getStyleKeyFromDirectProp(prop);
|
|
28
|
+
if (styleKey) {
|
|
29
|
+
return withoutImportant(target[ssrHTMLElementStyle][styleKey]);
|
|
30
|
+
} else {
|
|
31
|
+
return target[prop];
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
set: (target, prop, value) => {
|
|
35
|
+
const styleKey = prop in target ? void 0 : getStyleKeyFromDirectProp(prop);
|
|
36
|
+
if (styleKey) {
|
|
37
|
+
target.setProperty(styleKey, value);
|
|
38
|
+
} else {
|
|
39
|
+
target[prop] = value;
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
setProperty(property, value, priority) {
|
|
46
|
+
if (!value) {
|
|
47
|
+
this.removeProperty(property);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const key = getStyleKeyFromMethods(property);
|
|
51
|
+
if (!key || priority !== "important" && priority !== "" && priority != null || importantSuffixRegExp.test(value)) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
this[ssrHTMLElementStyle][key] = value + (priority ? " !important" : "");
|
|
55
|
+
}
|
|
56
|
+
removeProperty(property) {
|
|
57
|
+
const key = getStyleKeyFromMethods(property);
|
|
58
|
+
if (!key) {
|
|
59
|
+
return "";
|
|
60
|
+
}
|
|
61
|
+
const style = this[ssrHTMLElementStyle];
|
|
62
|
+
const value = style[key];
|
|
63
|
+
delete style[key];
|
|
64
|
+
return withoutImportant(value);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const ssrHTMLElementAttributesAndStyle = /* @__PURE__ */ Symbol("attributesAndStyle");
|
|
6
68
|
const spaceRegExp = /\s+/;
|
|
7
69
|
const ssrHTMLElement = () => {
|
|
8
70
|
const attributes = {};
|
|
9
|
-
const style =
|
|
71
|
+
const style = new SSRStyle();
|
|
10
72
|
let classNames = /* @__PURE__ */ new Set();
|
|
11
73
|
const toggleClass = (className, force = !classNames.has(className)) => {
|
|
12
74
|
if (force) {
|
|
@@ -41,10 +103,12 @@ const ssrHTMLElement = () => {
|
|
|
41
103
|
}
|
|
42
104
|
},
|
|
43
105
|
[ssrHTMLElementAttributesAndStyle]() {
|
|
44
|
-
return { attributes: { ...attributes }, classNames: [...classNames], style: { ...style } };
|
|
106
|
+
return { attributes: { ...attributes }, classNames: [...classNames], style: { ...style[ssrHTMLElementStyle] } };
|
|
45
107
|
}
|
|
46
108
|
};
|
|
47
109
|
};
|
|
110
|
+
const cssEscapeStyleName = (styleName) => styleName.replace(/([^\w-])/gi, "\\$1");
|
|
111
|
+
const cssTextFromObject = (style) => Object.entries(style).filter(([, value]) => !!value).map(([name, value]) => `${cssEscapeStyleName(name)}: ${value};`).join("");
|
|
48
112
|
function r(e) {
|
|
49
113
|
var t, f, n = "";
|
|
50
114
|
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
@@ -303,7 +367,7 @@ function directiveAttributes(...directives) {
|
|
|
303
367
|
if (classNames.length) {
|
|
304
368
|
attributes["class"] = classNames.join(" ");
|
|
305
369
|
}
|
|
306
|
-
const stringStyle =
|
|
370
|
+
const stringStyle = cssTextFromObject(style);
|
|
307
371
|
if (stringStyle.length) {
|
|
308
372
|
attributes["style"] = stringStyle;
|
|
309
373
|
}
|
|
@@ -388,10 +452,16 @@ function bindAttribute(node, attributeName, value$) {
|
|
|
388
452
|
const isClass = attributeName === "class";
|
|
389
453
|
return isClass ? classNamesSubscribe(node, value$) : attributeSubscribe(node, attributeName, value$);
|
|
390
454
|
}
|
|
455
|
+
const isCustomProperty = (styleName) => styleName.startsWith("--");
|
|
391
456
|
function bindStyle(node, styleName, value$) {
|
|
392
457
|
return value$.subscribe((value) => {
|
|
393
458
|
const style = node.style;
|
|
394
|
-
|
|
459
|
+
value = "" + (notEmpty(value) ? value : "");
|
|
460
|
+
if (isCustomProperty(styleName)) {
|
|
461
|
+
style.setProperty(styleName, value);
|
|
462
|
+
} else {
|
|
463
|
+
style[styleName] = value;
|
|
464
|
+
}
|
|
395
465
|
});
|
|
396
466
|
}
|
|
397
467
|
function bindClassName(node, className, value$) {
|
|
@@ -1,11 +1,73 @@
|
|
|
1
1
|
import { BROWSER } from "esm-env";
|
|
2
|
-
import { noop } from "./utils/func.js";
|
|
3
2
|
import { readable, batch, asReadable, writable, computed } from "@amadeus-it-group/tansu";
|
|
4
|
-
|
|
3
|
+
import { noop } from "./utils/func.js";
|
|
4
|
+
const importantSuffixRegExp = /\s*!important$/;
|
|
5
|
+
const withoutImportant = (value) => value?.replace(importantSuffixRegExp, "") ?? "";
|
|
6
|
+
const toKebabCase = (str) => str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
7
|
+
const getStyleKeyFromDirectProp = (str) => {
|
|
8
|
+
if (typeof str !== "string" || str.startsWith("--")) {
|
|
9
|
+
return void 0;
|
|
10
|
+
}
|
|
11
|
+
return toKebabCase(str);
|
|
12
|
+
};
|
|
13
|
+
const getStyleKeyFromMethods = (str) => {
|
|
14
|
+
if (!str.startsWith("--") && str !== toKebabCase(str)) {
|
|
15
|
+
return void 0;
|
|
16
|
+
}
|
|
17
|
+
return str;
|
|
18
|
+
};
|
|
19
|
+
const ssrHTMLElementStyle = /* @__PURE__ */ Symbol("style");
|
|
20
|
+
class SSRStyle {
|
|
21
|
+
// all styles in kebab-case, including custom properties:
|
|
22
|
+
[ssrHTMLElementStyle] = {};
|
|
23
|
+
constructor() {
|
|
24
|
+
return new Proxy(this, {
|
|
25
|
+
get: (target, prop) => {
|
|
26
|
+
const styleKey = prop in target ? void 0 : getStyleKeyFromDirectProp(prop);
|
|
27
|
+
if (styleKey) {
|
|
28
|
+
return withoutImportant(target[ssrHTMLElementStyle][styleKey]);
|
|
29
|
+
} else {
|
|
30
|
+
return target[prop];
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
set: (target, prop, value) => {
|
|
34
|
+
const styleKey = prop in target ? void 0 : getStyleKeyFromDirectProp(prop);
|
|
35
|
+
if (styleKey) {
|
|
36
|
+
target.setProperty(styleKey, value);
|
|
37
|
+
} else {
|
|
38
|
+
target[prop] = value;
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
setProperty(property, value, priority) {
|
|
45
|
+
if (!value) {
|
|
46
|
+
this.removeProperty(property);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const key = getStyleKeyFromMethods(property);
|
|
50
|
+
if (!key || priority !== "important" && priority !== "" && priority != null || importantSuffixRegExp.test(value)) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
this[ssrHTMLElementStyle][key] = value + (priority ? " !important" : "");
|
|
54
|
+
}
|
|
55
|
+
removeProperty(property) {
|
|
56
|
+
const key = getStyleKeyFromMethods(property);
|
|
57
|
+
if (!key) {
|
|
58
|
+
return "";
|
|
59
|
+
}
|
|
60
|
+
const style = this[ssrHTMLElementStyle];
|
|
61
|
+
const value = style[key];
|
|
62
|
+
delete style[key];
|
|
63
|
+
return withoutImportant(value);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const ssrHTMLElementAttributesAndStyle = /* @__PURE__ */ Symbol("attributesAndStyle");
|
|
5
67
|
const spaceRegExp = /\s+/;
|
|
6
68
|
const ssrHTMLElement = () => {
|
|
7
69
|
const attributes = {};
|
|
8
|
-
const style =
|
|
70
|
+
const style = new SSRStyle();
|
|
9
71
|
let classNames = /* @__PURE__ */ new Set();
|
|
10
72
|
const toggleClass = (className, force = !classNames.has(className)) => {
|
|
11
73
|
if (force) {
|
|
@@ -40,10 +102,12 @@ const ssrHTMLElement = () => {
|
|
|
40
102
|
}
|
|
41
103
|
},
|
|
42
104
|
[ssrHTMLElementAttributesAndStyle]() {
|
|
43
|
-
return { attributes: { ...attributes }, classNames: [...classNames], style: { ...style } };
|
|
105
|
+
return { attributes: { ...attributes }, classNames: [...classNames], style: { ...style[ssrHTMLElementStyle] } };
|
|
44
106
|
}
|
|
45
107
|
};
|
|
46
108
|
};
|
|
109
|
+
const cssEscapeStyleName = (styleName) => styleName.replace(/([^\w-])/gi, "\\$1");
|
|
110
|
+
const cssTextFromObject = (style) => Object.entries(style).filter(([, value]) => !!value).map(([name, value]) => `${cssEscapeStyleName(name)}: ${value};`).join("");
|
|
47
111
|
function r(e) {
|
|
48
112
|
var t, f, n = "";
|
|
49
113
|
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
@@ -302,7 +366,7 @@ function directiveAttributes(...directives) {
|
|
|
302
366
|
if (classNames.length) {
|
|
303
367
|
attributes["class"] = classNames.join(" ");
|
|
304
368
|
}
|
|
305
|
-
const stringStyle =
|
|
369
|
+
const stringStyle = cssTextFromObject(style);
|
|
306
370
|
if (stringStyle.length) {
|
|
307
371
|
attributes["style"] = stringStyle;
|
|
308
372
|
}
|
|
@@ -387,10 +451,16 @@ function bindAttribute(node, attributeName, value$) {
|
|
|
387
451
|
const isClass = attributeName === "class";
|
|
388
452
|
return isClass ? classNamesSubscribe(node, value$) : attributeSubscribe(node, attributeName, value$);
|
|
389
453
|
}
|
|
454
|
+
const isCustomProperty = (styleName) => styleName.startsWith("--");
|
|
390
455
|
function bindStyle(node, styleName, value$) {
|
|
391
456
|
return value$.subscribe((value) => {
|
|
392
457
|
const style = node.style;
|
|
393
|
-
|
|
458
|
+
value = "" + (notEmpty(value) ? value : "");
|
|
459
|
+
if (isCustomProperty(styleName)) {
|
|
460
|
+
style.setProperty(styleName, value);
|
|
461
|
+
} else {
|
|
462
|
+
style[styleName] = value;
|
|
463
|
+
}
|
|
394
464
|
});
|
|
395
465
|
}
|
|
396
466
|
function bindClassName(node, className, value$) {
|