@blukavantui/community 1.0.1 → 1.2.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/README.md +11 -5
- package/dist/build-audit.json +234 -44
- package/dist/checkbox.css +1 -0
- package/dist/checkbox.d.ts +2 -0
- package/dist/checkbox.js +1 -0
- package/dist/chunk-2BSBXDOT.js +1 -0
- package/dist/chunk-4LHIQROI.js +0 -0
- package/dist/chunk-5ENZVZGF.js +0 -0
- package/dist/chunk-6T677NSC.js +1 -0
- package/dist/chunk-7CEOCZ5L.js +0 -0
- package/dist/chunk-7DXFNK7C.js +1 -0
- package/dist/chunk-AL2ETLJV.js +1 -0
- package/dist/chunk-BN3PDE5G.js +0 -0
- package/dist/chunk-CNIIMGT3.js +0 -0
- package/dist/chunk-CSTCEBEK.js +1 -0
- package/dist/chunk-DRZM2AL3.js +0 -0
- package/dist/chunk-EOKNLCNS.js +1 -0
- package/dist/chunk-EPPETNK6.js +1 -0
- package/dist/chunk-EPPSBHZR.js +1 -0
- package/dist/chunk-EPZGLHPD.js +0 -0
- package/dist/chunk-FNX33PDD.js +0 -0
- package/dist/{chunk-NTFHNL7T.js → chunk-G6OW4OZM.js} +1 -1
- package/dist/chunk-GS67ZBLI.js +1 -0
- package/dist/chunk-HO6CYWED.js +0 -0
- package/dist/{chunk-6EHKOVZK.js → chunk-HVR2UDFX.js} +1 -1
- package/dist/chunk-IJ62ILKE.js +0 -0
- package/dist/chunk-IKYBFMHI.js +1 -0
- package/dist/chunk-IO22GWON.js +0 -0
- package/dist/chunk-KVOA55NE.js +0 -0
- package/dist/{chunk-MZBB5ROJ.js → chunk-LF2HELEZ.js} +1 -1
- package/dist/chunk-MYVLBALF.js +1 -0
- package/dist/{chunk-UEOCR2C3.js → chunk-OLDA73XG.js} +2 -2
- package/dist/chunk-RWBLICYX.js +0 -0
- package/dist/chunk-RYD6RHRX.js +0 -0
- package/dist/chunk-T45FJNEQ.js +1 -0
- package/dist/chunk-TZSX4OTV.js +1 -0
- package/dist/chunk-UN2SLVFG.js +1 -0
- package/dist/{chunk-GK3INPAZ.js → chunk-V2YPIC6Z.js} +1 -1
- package/dist/chunk-V4ZQLQ7L.js +0 -0
- package/dist/chunk-VAM3FPCS.js +0 -0
- package/dist/chunk-VJVFHL6P.js +0 -0
- package/dist/chunk-VSTKXZYY.js +0 -0
- package/dist/chunk-W3H7XTA7.js +1 -0
- package/dist/chunk-WG4US4JH.js +1 -0
- package/dist/chunk-WGSTNXAQ.js +0 -0
- package/dist/chunk-WJHCVECU.js +1 -0
- package/dist/chunk-XVMJG26X.js +1 -0
- package/dist/chunk-Y4AXWTAD.js +0 -0
- package/dist/chunk-YCLR3IE3.js +0 -0
- package/dist/chunk-YLFXSHKZ.js +0 -0
- package/dist/chunk-ZDGZGAYG.js +0 -0
- package/dist/columns2.css +1 -0
- package/dist/columns2.d.ts +2 -0
- package/dist/columns2.js +1 -0
- package/dist/columns3.css +1 -0
- package/dist/columns3.d.ts +2 -0
- package/dist/columns3.js +1 -0
- package/dist/columns4.css +1 -0
- package/dist/columns4.d.ts +2 -0
- package/dist/columns4.js +1 -0
- package/dist/command-palette.js +1 -1
- package/dist/component-motion.css +39 -0
- package/dist/component-motion.d.ts +45 -0
- package/dist/component-motion.js +1 -0
- package/dist/content.js +1 -1
- package/dist/core.css +8 -0
- package/dist/core.js +1 -1
- package/dist/data-motion.css +4 -0
- package/dist/data-motion.d.ts +23 -0
- package/dist/data-motion.js +1 -0
- package/dist/data.css +63 -0
- package/dist/data.d.ts +1 -0
- package/dist/data.js +1 -1
- package/dist/date-picker.css +5 -5
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker.css +5 -5
- package/dist/date-range-picker.js +1 -1
- package/dist/date-time-picker.css +5 -5
- package/dist/date-time-picker.js +1 -1
- package/dist/draft-components.json +77 -0
- package/dist/drawer.js +1 -1
- package/dist/essentials.css +8 -0
- package/dist/feedback.js +1 -1
- package/dist/form-field.css +1 -0
- package/dist/form-field.d.ts +2 -0
- package/dist/form-field.js +1 -0
- package/dist/form-layout/choice.d.ts +15 -0
- package/dist/form-layout/layout.d.ts +12 -0
- package/dist/form-layout/select.d.ts +3 -0
- package/dist/form-layout/shared.d.ts +21 -0
- package/dist/form-layout/table.d.ts +20 -0
- package/dist/form-layout/text.d.ts +3 -0
- package/dist/form-layout/types.d.ts +151 -0
- package/dist/form-layout.css +62 -0
- package/dist/form-layout.d.ts +12 -0
- package/dist/form-layout.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/inputs.css +83 -20
- package/dist/inputs.d.ts +8 -0
- package/dist/inputs.js +1 -1
- package/dist/layout.css +63 -0
- package/dist/layout.d.ts +3 -0
- package/dist/layout.js +1 -1
- package/dist/modal.js +1 -1
- package/dist/motion/action-feedback.d.ts +14 -0
- package/dist/motion/border-glow.d.ts +12 -0
- package/dist/motion/button.d.ts +11 -0
- package/dist/motion/component-settings.d.ts +51 -0
- package/dist/motion/controller.d.ts +33 -0
- package/dist/motion/effects.d.ts +30 -0
- package/dist/motion/feedback.d.ts +6 -0
- package/dist/motion/loading.d.ts +9 -0
- package/dist/motion/optional.d.ts +35 -0
- package/dist/motion/photo.d.ts +7 -0
- package/dist/motion/presence.d.ts +12 -0
- package/dist/motion/scene.d.ts +10 -0
- package/dist/motion/screen.d.ts +6 -0
- package/dist/motion/scroll-reveal.d.ts +13 -0
- package/dist/motion/settings-group.d.ts +14 -0
- package/dist/motion/stagger.d.ts +12 -0
- package/dist/motion/structure.d.ts +18 -0
- package/dist/motion/tabs.d.ts +19 -0
- package/dist/motion/tokens.d.ts +11 -0
- package/dist/motion/value.d.ts +21 -0
- package/dist/motion/view-transition.d.ts +14 -0
- package/dist/motion-enhancers.d.ts +12 -0
- package/dist/motion-enhancers.js +1 -0
- package/dist/motion-settings.d.ts +3 -0
- package/dist/motion-settings.js +1 -0
- package/dist/motion.css +1076 -0
- package/dist/motion.d.ts +20 -0
- package/dist/motion.js +1 -0
- package/dist/native/date-picker.js +1 -1
- package/dist/native/date-range-picker.js +1 -1
- package/dist/native/date-time-picker.js +1 -1
- package/dist/native/form-layout.js +1 -0
- package/dist/native/time-picker.js +1 -1
- package/dist/native-components/form-layout.d.ts +1 -0
- package/dist/native-motion-components.d.ts +3 -0
- package/dist/native-motion-content.d.ts +1 -0
- package/dist/native-motion-foundations.d.ts +3 -0
- package/dist/native-motion-layout.d.ts +3 -0
- package/dist/native-motion-pilot.d.ts +34 -0
- package/dist/native-motion.d.ts +71 -0
- package/dist/notification.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/radio-button.css +1 -0
- package/dist/radio-button.d.ts +2 -0
- package/dist/radio-button.js +1 -0
- package/dist/radio-group.css +1 -0
- package/dist/radio-group.d.ts +2 -0
- package/dist/radio-group.js +1 -0
- package/dist/select.css +1 -0
- package/dist/select.d.ts +2 -0
- package/dist/select.js +1 -0
- package/dist/sidebar.js +1 -1
- package/dist/sizes.json +416 -112
- package/dist/skeleton.css +8 -0
- package/dist/styles.css +1213 -20
- package/dist/switch.css +1 -0
- package/dist/switch.d.ts +2 -0
- package/dist/switch.js +1 -0
- package/dist/table.css +1 -0
- package/dist/table.d.ts +2 -0
- package/dist/table.js +1 -0
- package/dist/text-area.css +1 -0
- package/dist/text-area.d.ts +2 -0
- package/dist/text-area.js +1 -0
- package/dist/text-input.css +1 -0
- package/dist/text-input.d.ts +2 -0
- package/dist/text-input.js +1 -0
- package/dist/time-picker.css +5 -5
- package/dist/time-picker.js +1 -1
- package/dist/tree-view.js +1 -1
- package/dist/web-motion/chip-ripple.d.ts +6 -0
- package/dist/web-motion/choice-ripple.d.ts +6 -0
- package/dist/web-motion/content.d.ts +9 -0
- package/dist/web-motion/data-rows.d.ts +12 -0
- package/dist/web-motion/fields.d.ts +6 -0
- package/dist/web-motion/navigation.d.ts +6 -0
- package/dist/web-motion/notifications.d.ts +6 -0
- package/dist/web-motion/select-ripple.d.ts +6 -0
- package/dist/web-motion/statistic.d.ts +13 -0
- package/dist/web-motion/surfaces.d.ts +10 -0
- package/dist/web-motion/tree.d.ts +6 -0
- package/docs/FORM-LAYOUT-ESSENTIALS.md +122 -0
- package/docs/PUBLISHING.md +129 -25
- package/draft-components.json +77 -0
- package/edition.json +44 -7
- package/npm-shrinkwrap.json +2 -2
- package/package.json +102 -10
- package/scripts/build-motion-css.mjs +36 -0
- package/scripts/build-motion-styles.mjs +29 -0
- package/scripts/build.mjs +20 -8
- package/scripts/motion-entries.mjs +2 -0
- package/src/checkbox.ts +2 -0
- package/src/columns2.ts +2 -0
- package/src/columns3.ts +2 -0
- package/src/columns4.ts +2 -0
- package/src/component-motion.ts +101 -0
- package/src/data-motion.ts +60 -0
- package/src/data.ts +1 -0
- package/src/form-field.ts +2 -0
- package/src/form-layout/choice.ts +82 -0
- package/src/form-layout/layout.ts +40 -0
- package/src/form-layout/select.ts +97 -0
- package/src/form-layout/shared.ts +57 -0
- package/src/form-layout/table.ts +86 -0
- package/src/form-layout/text.ts +73 -0
- package/src/form-layout/types.ts +59 -0
- package/src/form-layout.ts +12 -0
- package/src/index.ts +2 -0
- package/src/inputs.ts +8 -0
- package/src/layout.ts +3 -0
- package/src/motion/action-feedback.ts +38 -0
- package/src/motion/border-glow.ts +41 -0
- package/src/motion/button.ts +56 -0
- package/src/motion/component-settings.ts +147 -0
- package/src/motion/controller.ts +191 -0
- package/src/motion/effects.ts +75 -0
- package/src/motion/feedback.ts +41 -0
- package/src/motion/loading.ts +40 -0
- package/src/motion/optional.ts +123 -0
- package/src/motion/photo.ts +19 -0
- package/src/motion/presence.ts +44 -0
- package/src/motion/scene.ts +103 -0
- package/src/motion/screen.ts +15 -0
- package/src/motion/scroll-reveal.ts +49 -0
- package/src/motion/settings-group.ts +28 -0
- package/src/motion/stagger.ts +26 -0
- package/src/motion/structure.ts +75 -0
- package/src/motion/tabs.ts +105 -0
- package/src/motion/tokens.ts +2 -0
- package/src/motion/value.ts +61 -0
- package/src/motion/view-transition.ts +57 -0
- package/src/motion-enhancers.ts +12 -0
- package/src/motion-settings.ts +3 -0
- package/src/motion.ts +20 -0
- package/src/native-components/form-layout.ts +21 -0
- package/src/native-motion-components.ts +76 -0
- package/src/native-motion-content.ts +10 -0
- package/src/native-motion-foundations.ts +56 -0
- package/src/native-motion-layout.ts +35 -0
- package/src/native-motion-pilot.ts +151 -0
- package/src/native-motion.ts +188 -0
- package/src/radio-button.ts +2 -0
- package/src/radio-group.ts +2 -0
- package/src/runtime/date-picker.js +21 -12
- package/src/runtime/date-range-picker.js +21 -12
- package/src/runtime/date-time-picker.js +21 -12
- package/src/runtime/time-picker.js +21 -12
- package/src/select.ts +2 -0
- package/src/switch.ts +2 -0
- package/src/table.ts +2 -0
- package/src/text-area.ts +2 -0
- package/src/text-input.ts +2 -0
- package/src/types.ts +0 -12
- package/src/web-motion/chip-ripple.ts +31 -0
- package/src/web-motion/choice-ripple.ts +30 -0
- package/src/web-motion/content.ts +74 -0
- package/src/web-motion/data-rows.ts +106 -0
- package/src/web-motion/fields.ts +52 -0
- package/src/web-motion/navigation.ts +62 -0
- package/src/web-motion/notifications.ts +67 -0
- package/src/web-motion/select-ripple.ts +23 -0
- package/src/web-motion/statistic.ts +23 -0
- package/src/web-motion/surfaces.ts +137 -0
- package/src/web-motion/tree.ts +44 -0
- package/styles/checkbox.css +1 -0
- package/styles/columns2.css +1 -0
- package/styles/columns3.css +1 -0
- package/styles/columns4.css +1 -0
- package/styles/component-motion.css +39 -0
- package/styles/data-motion.css +4 -0
- package/styles/date-picker.css +5 -5
- package/styles/date-range-picker.css +5 -5
- package/styles/date-time-picker.css +5 -5
- package/styles/form-field.css +1 -0
- package/styles/form-layout.css +62 -0
- package/styles/motion-optional.css +15 -0
- package/styles/motion-presets.css +92 -0
- package/styles/motion-tokens.css +6 -0
- package/styles/motion.css +125 -0
- package/styles/radio-button.css +1 -0
- package/styles/radio-group.css +1 -0
- package/styles/select.css +1 -0
- package/styles/skeleton.css +8 -0
- package/styles/switch.css +1 -0
- package/styles/table.css +1 -0
- package/styles/text-area.css +1 -0
- package/styles/text-input.css +1 -0
- package/styles/time-picker.css +5 -5
- package/test/component-motion-settings.test.mjs +35 -0
- package/test/content-overlay-motion.test.mjs +36 -0
- package/test/form-layout.test.mjs +28 -0
- package/test/isolation.test.mjs +2 -2
- package/test/motion.test.mjs +215 -0
- package/dist/chunk-2TCNAQC6.js +0 -1
- package/dist/chunk-CTLZIWMX.js +0 -1
- package/dist/chunk-MHHJZYXW.js +0 -1
- package/dist/chunk-XDYBNO4P.js +0 -1
- /package/dist/{chunk-H7ETPJVW.js → chunk-3PODK22R.js} +0 -0
- /package/dist/{chunk-SIU7DSOA.js → chunk-KBWB4OIF.js} +0 -0
package/edition.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"edition": "Community",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"license": "BluKavantUI Community Free Use, Official Distribution Licence 1.2",
|
|
5
5
|
"distribution": "Official @blukavantui/community npm package, official BluKavantUI Web downloads and official OutSystems Forge listing when published",
|
|
6
6
|
"redistribution": "No republishing, mirroring or resale of the reusable components, including modified copies; see LICENSE.txt for permitted private work, application delivery and third-party rights.",
|
|
@@ -60,7 +60,19 @@
|
|
|
60
60
|
"HeroSection",
|
|
61
61
|
"SplitSection",
|
|
62
62
|
"LogoCloud",
|
|
63
|
-
"BluGridBasic"
|
|
63
|
+
"BluGridBasic",
|
|
64
|
+
"Checkbox",
|
|
65
|
+
"TextInput",
|
|
66
|
+
"TextArea",
|
|
67
|
+
"RadioButton",
|
|
68
|
+
"RadioGroup",
|
|
69
|
+
"Switch",
|
|
70
|
+
"Select",
|
|
71
|
+
"FormField",
|
|
72
|
+
"Columns2",
|
|
73
|
+
"Columns3",
|
|
74
|
+
"Columns4",
|
|
75
|
+
"Table"
|
|
64
76
|
],
|
|
65
77
|
"gridFeatures": [
|
|
66
78
|
"client-side rows",
|
|
@@ -118,7 +130,10 @@
|
|
|
118
130
|
"Splitter",
|
|
119
131
|
"AppLayout",
|
|
120
132
|
"PageLayout",
|
|
121
|
-
"ShapeMask"
|
|
133
|
+
"ShapeMask",
|
|
134
|
+
"Columns2",
|
|
135
|
+
"Columns3",
|
|
136
|
+
"Columns4"
|
|
122
137
|
],
|
|
123
138
|
"BluKavantUi_Community_Inputs": [
|
|
124
139
|
"TreeSelect",
|
|
@@ -128,7 +143,15 @@
|
|
|
128
143
|
"DatePicker",
|
|
129
144
|
"TimePicker",
|
|
130
145
|
"DateTimePicker",
|
|
131
|
-
"DateRangePicker"
|
|
146
|
+
"DateRangePicker",
|
|
147
|
+
"Checkbox",
|
|
148
|
+
"TextInput",
|
|
149
|
+
"TextArea",
|
|
150
|
+
"RadioButton",
|
|
151
|
+
"RadioGroup",
|
|
152
|
+
"Switch",
|
|
153
|
+
"Select",
|
|
154
|
+
"FormField"
|
|
132
155
|
],
|
|
133
156
|
"BluKavantUi_Community_Feedback": [
|
|
134
157
|
"CommandPalette",
|
|
@@ -151,7 +174,8 @@
|
|
|
151
174
|
"Descriptions",
|
|
152
175
|
"Sparkline",
|
|
153
176
|
"DashboardCanvas",
|
|
154
|
-
"DashboardPanel"
|
|
177
|
+
"DashboardPanel",
|
|
178
|
+
"Table"
|
|
155
179
|
],
|
|
156
180
|
"BluKavantUi_Community_Content": [
|
|
157
181
|
"VideoPlayer",
|
|
@@ -240,6 +264,19 @@
|
|
|
240
264
|
"FontProvider": "font-provider",
|
|
241
265
|
"ShapeMask": "shape-mask",
|
|
242
266
|
"ChipGroup": "chip-group",
|
|
243
|
-
"BluGridBasic": "grid-basic"
|
|
244
|
-
|
|
267
|
+
"BluGridBasic": "grid-basic",
|
|
268
|
+
"Checkbox": "checkbox",
|
|
269
|
+
"TextInput": "text-input",
|
|
270
|
+
"TextArea": "text-area",
|
|
271
|
+
"RadioButton": "radio-button",
|
|
272
|
+
"RadioGroup": "radio-group",
|
|
273
|
+
"Switch": "switch",
|
|
274
|
+
"Select": "select",
|
|
275
|
+
"FormField": "form-field",
|
|
276
|
+
"Columns2": "columns2",
|
|
277
|
+
"Columns3": "columns3",
|
|
278
|
+
"Columns4": "columns4",
|
|
279
|
+
"Table": "table"
|
|
280
|
+
},
|
|
281
|
+
"nativeVerification": "18 new Blocks verified in a compiled OutSystems development consumer on 2026-10-24. Native packages are distributed separately."
|
|
245
282
|
}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blukavantui/community",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@blukavantui/community",
|
|
9
|
-
"version": "1.0
|
|
9
|
+
"version": "1.2.0",
|
|
10
10
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"ag-grid-community": "36.2.0"
|
package/package.json
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blukavantui/community",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "BluKavantUI Community:
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "BluKavantUI Community: 67 Web components. OutSystems integration available separately.",
|
|
5
5
|
"homepage": "https://blukavantui.blutekmedia.com/community",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://blutekmedia.com/contact"
|
|
8
8
|
},
|
|
9
|
-
"author":
|
|
10
|
-
"name": "BluTek Media",
|
|
11
|
-
"url": "https://blutekmedia.com"
|
|
12
|
-
},
|
|
9
|
+
"author": "Blutek Media",
|
|
13
10
|
"keywords": [
|
|
14
11
|
"blukavantui",
|
|
15
12
|
"typescript",
|
|
@@ -352,7 +349,95 @@
|
|
|
352
349
|
"import": "./dist/content.js"
|
|
353
350
|
},
|
|
354
351
|
"./content.css": "./dist/content.css",
|
|
355
|
-
"./marketing-template-layout.css": "./dist/marketing-template-layout.css"
|
|
352
|
+
"./marketing-template-layout.css": "./dist/marketing-template-layout.css",
|
|
353
|
+
"./checkbox": {
|
|
354
|
+
"types": "./dist/checkbox.d.ts",
|
|
355
|
+
"import": "./dist/checkbox.js"
|
|
356
|
+
},
|
|
357
|
+
"./checkbox.css": "./dist/checkbox.css",
|
|
358
|
+
"./text-input": {
|
|
359
|
+
"types": "./dist/text-input.d.ts",
|
|
360
|
+
"import": "./dist/text-input.js"
|
|
361
|
+
},
|
|
362
|
+
"./text-input.css": "./dist/text-input.css",
|
|
363
|
+
"./text-area": {
|
|
364
|
+
"types": "./dist/text-area.d.ts",
|
|
365
|
+
"import": "./dist/text-area.js"
|
|
366
|
+
},
|
|
367
|
+
"./text-area.css": "./dist/text-area.css",
|
|
368
|
+
"./radio-button": {
|
|
369
|
+
"types": "./dist/radio-button.d.ts",
|
|
370
|
+
"import": "./dist/radio-button.js"
|
|
371
|
+
},
|
|
372
|
+
"./radio-button.css": "./dist/radio-button.css",
|
|
373
|
+
"./radio-group": {
|
|
374
|
+
"types": "./dist/radio-group.d.ts",
|
|
375
|
+
"import": "./dist/radio-group.js"
|
|
376
|
+
},
|
|
377
|
+
"./radio-group.css": "./dist/radio-group.css",
|
|
378
|
+
"./switch": {
|
|
379
|
+
"types": "./dist/switch.d.ts",
|
|
380
|
+
"import": "./dist/switch.js"
|
|
381
|
+
},
|
|
382
|
+
"./switch.css": "./dist/switch.css",
|
|
383
|
+
"./select": {
|
|
384
|
+
"types": "./dist/select.d.ts",
|
|
385
|
+
"import": "./dist/select.js"
|
|
386
|
+
},
|
|
387
|
+
"./select.css": "./dist/select.css",
|
|
388
|
+
"./form-field": {
|
|
389
|
+
"types": "./dist/form-field.d.ts",
|
|
390
|
+
"import": "./dist/form-field.js"
|
|
391
|
+
},
|
|
392
|
+
"./form-field.css": "./dist/form-field.css",
|
|
393
|
+
"./columns2": {
|
|
394
|
+
"types": "./dist/columns2.d.ts",
|
|
395
|
+
"import": "./dist/columns2.js"
|
|
396
|
+
},
|
|
397
|
+
"./columns2.css": "./dist/columns2.css",
|
|
398
|
+
"./columns3": {
|
|
399
|
+
"types": "./dist/columns3.d.ts",
|
|
400
|
+
"import": "./dist/columns3.js"
|
|
401
|
+
},
|
|
402
|
+
"./columns3.css": "./dist/columns3.css",
|
|
403
|
+
"./columns4": {
|
|
404
|
+
"types": "./dist/columns4.d.ts",
|
|
405
|
+
"import": "./dist/columns4.js"
|
|
406
|
+
},
|
|
407
|
+
"./columns4.css": "./dist/columns4.css",
|
|
408
|
+
"./table": {
|
|
409
|
+
"types": "./dist/table.d.ts",
|
|
410
|
+
"import": "./dist/table.js"
|
|
411
|
+
},
|
|
412
|
+
"./table.css": "./dist/table.css",
|
|
413
|
+
"./form-layout": {
|
|
414
|
+
"types": "./dist/form-layout.d.ts",
|
|
415
|
+
"import": "./dist/form-layout.js"
|
|
416
|
+
},
|
|
417
|
+
"./form-layout.css": "./dist/form-layout.css",
|
|
418
|
+
"./motion": {
|
|
419
|
+
"types": "./dist/motion.d.ts",
|
|
420
|
+
"import": "./dist/motion.js"
|
|
421
|
+
},
|
|
422
|
+
"./motion.css": "./dist/motion.css",
|
|
423
|
+
"./component-motion": {
|
|
424
|
+
"types": "./dist/component-motion.d.ts",
|
|
425
|
+
"import": "./dist/component-motion.js"
|
|
426
|
+
},
|
|
427
|
+
"./data-motion": {
|
|
428
|
+
"types": "./dist/data-motion.d.ts",
|
|
429
|
+
"import": "./dist/data-motion.js"
|
|
430
|
+
},
|
|
431
|
+
"./motion/settings": {
|
|
432
|
+
"types": "./dist/motion-settings.d.ts",
|
|
433
|
+
"import": "./dist/motion-settings.js"
|
|
434
|
+
},
|
|
435
|
+
"./motion/enhancers": {
|
|
436
|
+
"types": "./dist/motion-enhancers.d.ts",
|
|
437
|
+
"import": "./dist/motion-enhancers.js"
|
|
438
|
+
},
|
|
439
|
+
"./component-motion.css": "./dist/component-motion.css",
|
|
440
|
+
"./data-motion.css": "./dist/data-motion.css"
|
|
356
441
|
},
|
|
357
442
|
"files": [
|
|
358
443
|
"dist",
|
|
@@ -368,19 +453,26 @@
|
|
|
368
453
|
"test",
|
|
369
454
|
"npm-shrinkwrap.json",
|
|
370
455
|
"docs/PUBLISHING.md",
|
|
371
|
-
"assets"
|
|
456
|
+
"assets",
|
|
457
|
+
"draft-components.json",
|
|
458
|
+
"docs/FORM-LAYOUT-ESSENTIALS.md",
|
|
459
|
+
"scripts/build-motion-css.mjs",
|
|
460
|
+
"scripts/build-motion-styles.mjs",
|
|
461
|
+
"scripts/motion-entries.mjs"
|
|
372
462
|
],
|
|
373
463
|
"sideEffects": [
|
|
374
464
|
"**/*.css",
|
|
375
465
|
"./src/theme-runtime.ts",
|
|
376
|
-
"./dist/theme.js"
|
|
466
|
+
"./dist/theme.js",
|
|
467
|
+
"./dist/chunk-*.js"
|
|
377
468
|
],
|
|
378
469
|
"scripts": {
|
|
379
470
|
"build": "node scripts/build.mjs",
|
|
380
471
|
"test": "node --test test/*.test.mjs",
|
|
381
472
|
"check": "tsc --noEmit",
|
|
382
473
|
"prepack": "npm run check && npm run build && npm test",
|
|
383
|
-
"verify:package": "node scripts/verify-package.mjs"
|
|
474
|
+
"verify:package": "node scripts/verify-package.mjs",
|
|
475
|
+
"preview:essentials": "node scripts/preview-essentials.mjs"
|
|
384
476
|
},
|
|
385
477
|
"dependencies": {
|
|
386
478
|
"ag-grid-community": "36.2.0"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Web-only utility generation from the same presets as WAAPI. Does not touch native/release artifacts. */
|
|
2
|
+
import { build } from 'esbuild';
|
|
3
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
const root = fileURLToPath(new URL('../', import.meta.url));
|
|
6
|
+
const result = await build({ absWorkingDir: root, entryPoints: ['src/motion/effects.ts'], bundle: true, format: 'esm', platform: 'node', write: false });
|
|
7
|
+
const { motionEffects, motionEasings, motionFrames, motionClass, motionEasingClass, motionOrigins } = await import('data:text/javascript;base64,' + Buffer.from(result.outputFiles[0].text).toString('base64'));
|
|
8
|
+
const lines = ['/* Generated by scripts/build-motion-css.mjs. Edit src/motion/effects.ts, then regenerate. */'];
|
|
9
|
+
for (const effect of motionEffects) {
|
|
10
|
+
for (const phase of ['enter', 'exit']) {
|
|
11
|
+
const name = motionClass(effect, phase);
|
|
12
|
+
const aliases = effect === 'fade' ? [`.blu-motion-fade-${phase === 'enter' ? 'in' : 'out'}`]
|
|
13
|
+
: phase === 'enter' && effect === 'slide-up' ? ['.blu-motion-slide-up']
|
|
14
|
+
: phase === 'enter' && effect === 'zoom-in' ? ['.blu-motion-scale-in'] : [];
|
|
15
|
+
lines.push([`.${name}`, ...aliases].join(', ') + ` { animation: ${name} var(--blu-motion-duration) var(--blu-motion-ease) var(--blu-motion-delay) both; }`);
|
|
16
|
+
const frames = motionFrames(effect, phase, 'var(--blu-motion-distance)');
|
|
17
|
+
lines.push(`@keyframes ${name} { ${frames.map((frame, index) => {
|
|
18
|
+
const percent = (frame.offset ?? index / (frames.length - 1)) * 100;
|
|
19
|
+
return `${percent}% { ${Object.entries(frame).filter(([key]) => key !== 'offset').map(([key, value]) => `${key.replace(/[A-Z]/g, letter => "-" + letter.toLowerCase())}: ${value};`).join(' ')} }`;
|
|
20
|
+
}).join(' ')} }`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
for (const [name, curve] of Object.entries(motionEasings)) lines.push(`.${motionEasingClass(name)} { --blu-motion-ease: ${curve}; }`);
|
|
24
|
+
for (const [name, origin] of Object.entries(motionOrigins)) lines.push(`.blu-motion-origin-${name} { transform-origin: ${origin}; }`);
|
|
25
|
+
// Exit utilities do not manage hidden/inert. Owners must do that after animationend or use createMotionPresence.
|
|
26
|
+
const css = lines.join('\n') + '\n';
|
|
27
|
+
const target = new URL('../styles/motion-presets.css', import.meta.url);
|
|
28
|
+
if (process.argv.includes('--check')) {
|
|
29
|
+
if (await readFile(target, 'utf8') !== css) throw Error('Motion CSS is stale. Run node scripts/build-motion-css.mjs.');
|
|
30
|
+
} else await writeFile(target, css);
|
|
31
|
+
|
|
32
|
+
const tokenBuild = await build({absWorkingDir:root,entryPoints:['src/motion/tokens.ts'],bundle:true,format:'esm',platform:'node',write:false});
|
|
33
|
+
const {motionTiming} = await import('data:text/javascript;base64,'+Buffer.from(tokenBuild.outputFiles[0].text).toString('base64'));
|
|
34
|
+
const tokenCSS = '/* Generated from src/motion/tokens.ts. */\n:root {\n'+['fast','normal','slow'].map(key=>` --blu-motion-${key}: ${motionTiming[key]}ms;`).join('\n')+'\n}\n';
|
|
35
|
+
const tokenTarget = new URL('../styles/motion-tokens.css',import.meta.url);
|
|
36
|
+
if(process.argv.includes('--check')) {if(await readFile(tokenTarget,'utf8')!==tokenCSS)throw Error('Motion tokens CSS is stale.');} else await writeFile(tokenTarget,tokenCSS);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { build } from 'esbuild';
|
|
2
|
+
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { resolve } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
6
|
+
/** The same stylesheet is used by the package build and local documentation. */
|
|
7
|
+
export async function buildMotionStyles(outdir) {
|
|
8
|
+
const root = fileURLToPath(new URL('../', import.meta.url));
|
|
9
|
+
const result = await build({ absWorkingDir: root, entryPoints: ['styles/motion.css'],
|
|
10
|
+
bundle: true, write: false, target: ['safari16.4', 'chrome110'], legalComments: 'inline' });
|
|
11
|
+
const css = result.outputFiles[0].text;
|
|
12
|
+
await mkdir(outdir, { recursive: true });
|
|
13
|
+
await writeFile(resolve(outdir, 'motion.css'), css);
|
|
14
|
+
return css;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Call after generating the base full stylesheet; used by the normal release build. */
|
|
18
|
+
export async function includeMotionStyles(outdir) {
|
|
19
|
+
const base = await readFile(resolve(outdir, 'styles.css'), 'utf8');
|
|
20
|
+
const motion = await buildMotionStyles(outdir);
|
|
21
|
+
let combined = motion;
|
|
22
|
+
for (const name of ['component-motion', 'data-motion']) {
|
|
23
|
+
const css = await readFile(new URL('../styles/' + name + '.css', import.meta.url), 'utf8');
|
|
24
|
+
await writeFile(resolve(outdir, name + '.css'), css);
|
|
25
|
+
combined += '\n' + css;
|
|
26
|
+
}
|
|
27
|
+
await writeFile(resolve(outdir, 'styles.css'), base + '\n' + combined);
|
|
28
|
+
return motion;
|
|
29
|
+
}
|
package/scripts/build.mjs
CHANGED
|
@@ -1,33 +1,45 @@
|
|
|
1
|
+
import './build-motion-css.mjs';
|
|
2
|
+
import { motionEntries } from './motion-entries.mjs';
|
|
3
|
+
import { includeMotionStyles } from './build-motion-styles.mjs';
|
|
1
4
|
import {build} from 'esbuild';
|
|
2
5
|
import {readFile,writeFile,mkdir,rm,cp} from 'node:fs/promises';
|
|
3
6
|
import {execFileSync} from 'node:child_process';
|
|
4
7
|
import {gzipSync} from 'node:zlib';
|
|
5
8
|
const edition=JSON.parse(await readFile('edition.json','utf8'));
|
|
9
|
+
const draft=JSON.parse(await readFile('draft-components.json','utf8'));
|
|
6
10
|
const slug=n=>edition.componentEntries?.[n]||n.replace(/([a-z])([A-Z])/g,'$1-$2').toLowerCase();
|
|
7
11
|
const essentials=['button','badge','chip','chip-group','card','skeleton','empty-state'];
|
|
8
|
-
const
|
|
12
|
+
const handwritten=new Set(draft.components.map(c=>c.slug));
|
|
13
|
+
const additions=edition.components.map(slug).filter(n=>!essentials.includes(n)&&n!=='grid-basic'&&!handwritten.has(n));
|
|
9
14
|
const groups=Object.fromEntries(Object.entries(edition.nativeModules).map(([k,v])=>[k.split('_').at(-1).toLowerCase(),v.map(slug)]));
|
|
10
|
-
const entries=[...new Set(['index','grid-basic','essentials','theme',...essentials,...additions,...Object.keys(groups)])];
|
|
15
|
+
const entries=[...new Set(['index','grid-basic','essentials','theme','form-layout',...motionEntries,...draft.components.map(c=>c.slug),...essentials,...additions,...Object.keys(groups)])];
|
|
11
16
|
await rm('dist',{recursive:true,force:true});await mkdir('dist');
|
|
12
|
-
const web=await build({entryPoints:entries.map(n=>'src/'+n+'.ts'),bundle:true,splitting:true,format:'esm',target:'es2020',minify:true,outdir:'dist',metafile:true});
|
|
13
|
-
const nativeEntries={'bluui-community':'src/native.ts','bluui-community-grid':'src/native-grid.ts'};
|
|
17
|
+
const web=await build({entryPoints:entries.map(n=>'src/'+n+'.ts'),bundle:true,splitting:true,format:'esm',target:'es2020',minify:true,outdir:'dist',metafile:true,preserveSymlinks:true});
|
|
18
|
+
const nativeEntries={'bluui-community':'src/native.ts','bluui-community-grid':'src/native-grid.ts','native/form-layout':'src/native-components/form-layout.ts'};
|
|
14
19
|
for(const name of additions){
|
|
15
20
|
const source=await readFile('src/component-factories/'+name+'.ts','utf8');
|
|
16
21
|
const installs=[...source.matchAll(/import \{(install\w+)\} from ['"]\.\.\/runtime\/([^'"]+)\.js['"]/g)];
|
|
17
22
|
if(installs.length){const code=installs.map(m=>`import {${m[1]}} from '../runtime/${m[2]}.js';\n${m[1]}();`).join('\n');await mkdir('src/native-components',{recursive:true});await writeFile('src/native-components/'+name+'.ts',code+'\n');nativeEntries['native/'+name]='src/native-components/'+name+'.ts';}
|
|
18
23
|
}
|
|
19
|
-
const native=await build({entryPoints:nativeEntries,bundle:true,format:'iife',target:'es2018',minify:true,outdir:'dist',metafile:true});
|
|
24
|
+
const native=await build({entryPoints:nativeEntries,bundle:true,format:'iife',target:'es2018',minify:true,outdir:'dist',metafile:true,preserveSymlinks:true});
|
|
20
25
|
execFileSync('node',['node_modules/typescript/bin/tsc'],{stdio:'inherit'});
|
|
21
26
|
const sheets={};for(const name of edition.components.map(slug)){sheets[name]=await readFile(`styles/${name}.css`,'utf8');await cp(`styles/${name}.css`,`dist/${name}.css`);}
|
|
22
27
|
await cp('styles/theme.css','dist/theme.css');
|
|
23
28
|
await cp('styles/marketing-template-layout.css','dist/marketing-template-layout.css');
|
|
24
29
|
await cp('assets/fonts','dist/fonts',{recursive:true});
|
|
25
30
|
await writeFile('dist/essentials.css',essentials.map(n=>sheets[n]).join('\n'));
|
|
26
|
-
for(const[name,members]of Object.entries(groups))await writeFile('dist/'+name+'.css',members.map(n=>sheets[n]).join('\n'));
|
|
27
|
-
await writeFile('dist/styles.css',await readFile('styles/theme.css','utf8')+'\n'+Object.
|
|
31
|
+
for(const[name,members]of Object.entries(groups))await writeFile('dist/'+name+'.css',members.filter(n=>!handwritten.has(n)).map(n=>sheets[n]).join('\n'));
|
|
32
|
+
await writeFile('dist/styles.css',await readFile('styles/theme.css','utf8')+'\n'+Object.entries(sheets).filter(([n])=>!handwritten.has(n)).map(([,s])=>s).join('\n'));
|
|
33
|
+
const draftStyles=await readFile('styles/form-layout.css','utf8');
|
|
34
|
+
await cp('styles/form-layout.css','dist/form-layout.css');
|
|
35
|
+
for(const c of draft.components)await cp(`styles/${c.slug}.css`,`dist/${c.slug}.css`);
|
|
36
|
+
for(const group of new Set(draft.components.map(c=>c.group)))await writeFile('dist/'+group+'.css',await readFile('dist/'+group+'.css','utf8')+'\n'+draftStyles);
|
|
37
|
+
await writeFile('dist/styles.css',await readFile('dist/styles.css','utf8')+'\n'+draftStyles);
|
|
38
|
+
await includeMotionStyles('dist');
|
|
39
|
+
await cp('draft-components.json','dist/draft-components.json');
|
|
28
40
|
const inputs=[...new Set([...Object.keys(web.metafile.inputs),...Object.keys(native.metafile.inputs)])];
|
|
29
41
|
for(const file of inputs)if(!file.startsWith('src/')&&!file.startsWith('node_modules/ag-grid-community/')&&!file.startsWith('node_modules/ag-stack/'))throw Error('Unexpected source in Community bundle: '+file);
|
|
30
|
-
await writeFile('dist/build-audit.json',JSON.stringify({inputs,outputs:Object.keys({...web.metafile.outputs,...native.metafile.outputs}),sourcePolicy:edition.sourcePolicy},null,2));
|
|
42
|
+
await writeFile('dist/build-audit.json',JSON.stringify({inputs,outputs:Object.keys({...web.metafile.outputs,...native.metafile.outputs}),sourcePolicy:edition.sourcePolicy,draft},null,2));
|
|
31
43
|
const sizes={version:edition.version,typescript:{},native:{}};
|
|
32
44
|
for(const file of ['bluui-community.js','bluui-community-grid.js','styles.css','grid-basic.css','essentials.css','theme.css',...Object.keys(nativeEntries).filter(n=>n.startsWith('native/')).map(n=>n+'.js')]){const b=await readFile('dist/'+file);const measure={bytes:b.length,gzipBytes:gzipSync(b).length};if(file.startsWith('native/'))sizes.native[file]=measure;else sizes[file]=measure;}
|
|
33
45
|
for(const entry of entries){const seen=new Set();const visit=file=>{if(seen.has(file))return;seen.add(file);for(const im of web.metafile.outputs[file]?.imports||[])if(!im.external)visit(im.path);};visit('dist/'+entry+'.js');let bytes=0,gzipBytes=0;for(const f of seen){const b=await readFile(f);bytes+=b.length;gzipBytes+=gzipSync(b).length;}sizes.typescript[entry]={files:[...seen].map(f=>f.slice(5)),bytes,gzipBytes};}
|
package/src/checkbox.ts
ADDED
package/src/columns2.ts
ADDED
package/src/columns3.ts
ADDED
package/src/columns4.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/** Local, opt-in web integration. Import after the component styles plus component-motion.css.
|
|
2
|
+
* Create the controller on a scope containing every component host (normally document.body).
|
|
3
|
+
* Dispose this collection before disposing its controller. No native entry points import this file.
|
|
4
|
+
*/
|
|
5
|
+
import type { MotionController } from './motion/controller.js';
|
|
6
|
+
import { createComponentMotionScope, validateComponentMotion } from './motion/component-settings.js';
|
|
7
|
+
import type { ComponentMotionSettings, ComponentMotionHandle } from './motion/component-settings.js';
|
|
8
|
+
export type { ComponentMotionSettings, ComponentMotionHandle } from './motion/component-settings.js';
|
|
9
|
+
import { createMotionButton } from './motion/button.js';
|
|
10
|
+
import { createPressFeedback } from './motion/feedback.js';
|
|
11
|
+
import { createModal } from './component-factories/modal.js';
|
|
12
|
+
import { createDrawer } from './component-factories/drawer.js';
|
|
13
|
+
import { createCommandPalette } from './component-factories/command-palette.js';
|
|
14
|
+
import { createTextInput } from './text-input.js';
|
|
15
|
+
import { createTextArea } from './text-area.js';
|
|
16
|
+
import { createCheckbox } from './checkbox.js';
|
|
17
|
+
import { createSwitch } from './switch.js';
|
|
18
|
+
import { createRadioButton } from './radio-button.js';
|
|
19
|
+
import { createRadioGroup } from './radio-group.js';
|
|
20
|
+
import { createSelect } from './select.js';
|
|
21
|
+
import { createFormField } from './form-field.js';
|
|
22
|
+
import { observeSurface } from './web-motion/surfaces.js';
|
|
23
|
+
import { enhanceField } from './web-motion/fields.js';
|
|
24
|
+
import { createDatePicker } from './component-factories/date-picker.js';
|
|
25
|
+
import { createTimePicker } from './component-factories/time-picker.js';
|
|
26
|
+
import { createDateTimePicker } from './component-factories/date-time-picker.js';
|
|
27
|
+
import { createDateRangePicker } from './component-factories/date-range-picker.js';
|
|
28
|
+
import { createTreeView } from './component-factories/tree-view.js';
|
|
29
|
+
import { createNotification } from './component-factories/notification.js';
|
|
30
|
+
import { enhanceTree } from './web-motion/tree.js';
|
|
31
|
+
import { enhanceNotifications } from './web-motion/notifications.js';
|
|
32
|
+
import { createSidebar } from './component-factories/sidebar.js';
|
|
33
|
+
import { createPagination } from './component-factories/pagination.js';
|
|
34
|
+
import { enhanceNavigation } from './web-motion/navigation.js';
|
|
35
|
+
|
|
36
|
+
type Instance = { element: HTMLElement; destroy(): void };
|
|
37
|
+
type Enhancement = { destroy(): void };
|
|
38
|
+
export function createMotionComponents(motion: MotionController, initial: ComponentMotionSettings = {}) {
|
|
39
|
+
let defaults = validateComponentMotion(initial), disposed = false;
|
|
40
|
+
const instances = new Set<Instance>();
|
|
41
|
+
const configurations = new Map<Instance, () => void>();
|
|
42
|
+
function decorate<A extends unknown[], C extends Instance>(factory: (...args: A) => C, enhance: (component: C, local: MotionController) => Enhancement) {
|
|
43
|
+
return (...args: A): C & ComponentMotionHandle => {
|
|
44
|
+
if (disposed) throw Error('Motion components are destroyed.');
|
|
45
|
+
const component = factory(...args);
|
|
46
|
+
const scoped = createComponentMotionScope(component.element, motion, defaults);
|
|
47
|
+
let extra: Enhancement;
|
|
48
|
+
try { extra = enhance(component, scoped.motion); } catch (error) { scoped.destroy(); component.destroy(); throw error; }
|
|
49
|
+
const destroy = component.destroy.bind(component); let dead = false, overrides: ComponentMotionSettings = {};
|
|
50
|
+
const apply = () => scoped.update({ ...defaults, ...overrides });
|
|
51
|
+
const result = Object.assign(component, { setMotion(settings: ComponentMotionSettings = {}) {
|
|
52
|
+
if (dead) throw Error('Component is destroyed.');
|
|
53
|
+
overrides = validateComponentMotion(settings);
|
|
54
|
+
if (overrides.mode === 'inherit') delete overrides.mode;
|
|
55
|
+
apply();
|
|
56
|
+
} });
|
|
57
|
+
component.destroy = () => { if (dead) return; dead = true; extra.destroy(); scoped.destroy(); destroy(); instances.delete(component); configurations.delete(component); };
|
|
58
|
+
configurations.set(component, apply); instances.add(component); return result;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const field = (component: Instance, local: MotionController) => enhanceField(component.element, local);
|
|
62
|
+
const surface = (kind: 'modal' | 'drawer' | 'palette') => (component: Instance, local: MotionController) => observeSurface(component.element, local, kind);
|
|
63
|
+
const picker = (component: Instance, local: MotionController) => observeSurface(component.element, local, 'picker');
|
|
64
|
+
return {
|
|
65
|
+
createSidebar: decorate(createSidebar, (component, local) => enhanceNavigation(component.element, local, 'sidebar')),
|
|
66
|
+
createPagination: decorate(createPagination, (component, local) => enhanceNavigation(component.element, local, 'pagination')),
|
|
67
|
+
createDatePicker: decorate(createDatePicker, picker),
|
|
68
|
+
createTimePicker: decorate(createTimePicker, picker),
|
|
69
|
+
createDateTimePicker: decorate(createDateTimePicker, picker),
|
|
70
|
+
createDateRangePicker: decorate(createDateRangePicker, picker),
|
|
71
|
+
createTreeView: decorate(createTreeView, (component, local) => enhanceTree(component.element, local)),
|
|
72
|
+
createNotification: decorate(createNotification, (component, local) => enhanceNotifications(component.element, local)),
|
|
73
|
+
createButton: decorate(createMotionButton, (component, local) => {
|
|
74
|
+
const button = component.element.querySelector('button')!;
|
|
75
|
+
const press = createPressFeedback(button, local), update = component.update.bind(component);
|
|
76
|
+
component.update = patch => { update(patch); button.classList.add('blu-motion-press'); };
|
|
77
|
+
return press;
|
|
78
|
+
}),
|
|
79
|
+
createModal: decorate(createModal, surface('modal')),
|
|
80
|
+
createDrawer: decorate(createDrawer, surface('drawer')),
|
|
81
|
+
createCommandPalette: decorate(createCommandPalette, surface('palette')),
|
|
82
|
+
createTextInput: decorate(createTextInput, field),
|
|
83
|
+
createTextArea: decorate(createTextArea, field),
|
|
84
|
+
createCheckbox: decorate(createCheckbox, field),
|
|
85
|
+
createSwitch: decorate(createSwitch, field),
|
|
86
|
+
createRadioButton: decorate(createRadioButton, field),
|
|
87
|
+
createRadioGroup: decorate(createRadioGroup, field),
|
|
88
|
+
createFormField: decorate(createFormField, field),
|
|
89
|
+
createSelect: decorate(createSelect, (component, local) => {
|
|
90
|
+
const feedback = field(component, local), menu = observeSurface(component.element, local, 'select');
|
|
91
|
+
return { destroy() { menu.destroy(); feedback.destroy(); } };
|
|
92
|
+
}),
|
|
93
|
+
/** Replace collection defaults. Existing per-component overrides stay in place. */
|
|
94
|
+
configure(settings: ComponentMotionSettings = {}) {
|
|
95
|
+
if (disposed) throw Error('Motion components are destroyed.');
|
|
96
|
+
defaults = validateComponentMotion(settings);
|
|
97
|
+
for (const apply of configurations.values()) apply();
|
|
98
|
+
},
|
|
99
|
+
destroy() { if (disposed) return; disposed = true; for (const component of Array.from(instances).reverse()) component.destroy(); },
|
|
100
|
+
};
|
|
101
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** Local opt-in data entry. Existing Table/Grid defaults and native entries are unchanged. */
|
|
2
|
+
import { createTable as baseTable, tableRows } from './form-layout/table.js';
|
|
3
|
+
import type { TableOptions, TableEvents } from './form-layout/types.js';
|
|
4
|
+
import { createGridBasic as baseGrid } from './grid-basic.js';
|
|
5
|
+
import type { GridBasicOptions, GridBasicEvents } from './grid-basic.js';
|
|
6
|
+
import type { MotionController } from './motion/controller.js';
|
|
7
|
+
import { enhanceDataRows } from './web-motion/data-rows.js';
|
|
8
|
+
|
|
9
|
+
import { createComponentMotionScope, type ComponentMotionSettings } from './motion/component-settings.js';
|
|
10
|
+
import { createMotionSettingsGroup } from './motion/settings-group.js';
|
|
11
|
+
|
|
12
|
+
export function createMotionData(motion: MotionController, defaults: ComponentMotionSettings = {}) {
|
|
13
|
+
const settings = createMotionSettingsGroup(defaults);
|
|
14
|
+
const instances = new Set<{ destroy(): void }>(); let dead = false;
|
|
15
|
+
function own<C extends { destroy(): void }>(component: C, extra: { destroy(): void }, scope: ReturnType<typeof createComponentMotionScope>) {
|
|
16
|
+
const binding = settings.bind(scope.update);
|
|
17
|
+
const destroy = component.destroy.bind(component); let disposed = false;
|
|
18
|
+
component.destroy = () => { if (disposed) return; disposed = true; binding.destroy(); extra.destroy(); scope.destroy(); destroy(); instances.delete(component); };
|
|
19
|
+
instances.add(component); return Object.assign(component, {setMotion: binding.setMotion});
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
configure(next: ComponentMotionSettings = {}) { if (dead) throw Error('Motion data components are destroyed.'); settings.configure(next); },
|
|
23
|
+
createTable<Row extends object>(host: HTMLElement, initial: TableOptions<Row>, events: TableEvents<Row> = {}) {
|
|
24
|
+
if (dead) throw Error('Motion data components are destroyed.');
|
|
25
|
+
let options = initial;
|
|
26
|
+
function validate(p: TableOptions<Row>) {
|
|
27
|
+
if (!p.RowKey) throw Error('Animated tables require a stable RowKey.');
|
|
28
|
+
const ids = p.Rows.map(row => row[p.RowKey!]);
|
|
29
|
+
if (ids.some(id => !['string', 'number'].includes(typeof id) || String(id) === '') || new Set(ids.map(String)).size !== ids.length) throw Error('Animated tables require unique, nonempty row keys.');
|
|
30
|
+
}
|
|
31
|
+
validate(options);
|
|
32
|
+
const component = baseTable(host, initial, events), update = component.update;
|
|
33
|
+
const scope = createComponentMotionScope(component.element, motion, settings.settings);
|
|
34
|
+
const extra = enhanceDataRows(component.element, scope.motion, () => {
|
|
35
|
+
const rows = options.Loading ? [] : tableRows({ ...options, ...component.getState() }).rows;
|
|
36
|
+
const elements = [...component.element.querySelectorAll<HTMLTableRowElement>('tbody > tr')];
|
|
37
|
+
return rows.map((row, index) => ({ key: String(row[options.RowKey!]), element: elements[index], cells: [...elements[index].cells], cellKeys: [...options.Columns.map(c => c.Key), '__actions'] }));
|
|
38
|
+
});
|
|
39
|
+
component.update = patch => {
|
|
40
|
+
const next = { ...options, ...patch }; validate(next); extra.capture();
|
|
41
|
+
const focused = document.activeElement instanceof HTMLElement && component.element.contains(document.activeElement) ? document.activeElement : null;
|
|
42
|
+
update(patch); options = next;
|
|
43
|
+
if (focused && !focused.isConnected && document.activeElement === document.body) component.element.querySelector<HTMLElement>('.blu-table__scroll')!.focus({ preventScroll: true });
|
|
44
|
+
};
|
|
45
|
+
return own(component, extra, scope);
|
|
46
|
+
},
|
|
47
|
+
createGridBasic(host: HTMLElement, initial: GridBasicOptions, events: GridBasicEvents = {}) {
|
|
48
|
+
if (dead) throw Error('Motion data components are destroyed.');
|
|
49
|
+
const component = baseGrid(host, initial, events), update = component.update;
|
|
50
|
+
const scope = createComponentMotionScope(component.element, motion, settings.settings);
|
|
51
|
+
const extra = enhanceDataRows(component.element, scope.motion, () => [...component.element.querySelectorAll<HTMLElement>('.ag-center-cols-container > .ag-row[row-id], .ag-grid-scrolling-container > .ag-row[row-id]')].map(element => {
|
|
52
|
+
const cells = [...element.querySelectorAll<HTMLElement>('.ag-cell')];
|
|
53
|
+
return { key: element.getAttribute('row-id')!, element, cells, cellKeys: cells.map(cell => cell.getAttribute('col-id')!) };
|
|
54
|
+
}));
|
|
55
|
+
component.update = patch => { extra.capture(); update(patch); };
|
|
56
|
+
return own(component, extra, scope);
|
|
57
|
+
},
|
|
58
|
+
destroy() { if (dead) return; dead = true; for (const component of [...instances]) component.destroy(); },
|
|
59
|
+
};
|
|
60
|
+
}
|
package/src/data.ts
CHANGED