amotify 0.1.60 → 0.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/dist/@declaration/index.d.ts +2 -2
- package/dist/@declaration/property.d.ts +9 -9
- package/dist/@styles/componentClasses/index.css +46 -149
- package/dist/@styles/componentClasses/index.js +35 -49
- package/dist/@styles/index.css +46 -149
- package/dist/@styles/index.js +35 -49
- package/dist/@styles/style.css +46 -149
- package/dist/@styles/style.js +35 -49
- package/dist/@utils/GenerateClassName.d.ts +2 -2
- package/dist/@utils/GenerateClassName.js +1 -1
- package/dist/@utils/LaunchReactApp.d.ts +11 -11
- package/dist/@utils/LaunchReactApp.js +1 -1
- package/dist/@utils/config.d.ts +6 -1
- package/dist/@utils/config.js +1 -1
- package/dist/@utils/index.d.ts +2 -2
- package/dist/@utils/index.js +1 -1
- package/dist/@utils/pageRouter.d.ts +15 -0
- package/dist/@utils/pageRouter.js +1 -0
- package/dist/@utils/useRecycle.js +1 -1
- package/dist/@utils/useRouterEffect.d.ts +16 -0
- package/dist/@utils/useRouterEffect.js +1 -0
- package/dist/@utils/useStore.d.ts +2 -10
- package/dist/@utils/useStore.js +1 -1
- package/dist/atoms/FAI.d.ts +1 -1
- package/dist/atoms/FAI.js +1 -1
- package/dist/atoms/Flex.js +1 -1
- package/dist/atoms/Logo.d.ts +14 -14
- package/dist/atoms/Logo.js +3 -3
- package/dist/fn/Button.d.ts +4 -4
- package/dist/fn/Button.js +1 -1
- package/dist/fn/Cropper.d.ts +1 -1
- package/dist/fn/Cropper.js +1 -1
- package/dist/fn/Effect/Pudding.js +1 -1
- package/dist/fn/Effect/Ripple.js +3 -3
- package/dist/fn/Input/AutoHeightText.d.ts +1 -1
- package/dist/fn/Input/AutoHeightText.js +1 -1
- package/dist/fn/Input/Checker.d.ts +3 -3
- package/dist/fn/Input/Checker.js +1 -1
- package/dist/fn/Input/Chips/Selector.d.ts +3 -3
- package/dist/fn/Input/Chips/Selector.js +1 -1
- package/dist/fn/Input/Chips/index.js +1 -1
- package/dist/fn/Input/Contenteditable.js +1 -1
- package/dist/fn/Input/DigitCharacters.d.ts +1 -1
- package/dist/fn/Input/DigitCharacters.js +1 -1
- package/dist/fn/Input/Filer.d.ts +3 -3
- package/dist/fn/Input/Filer.js +1 -1
- package/dist/fn/Input/Hidden.d.ts +1 -1
- package/dist/fn/Input/Hidden.js +1 -1
- package/dist/fn/Input/List.d.ts +5 -5
- package/dist/fn/Input/List.js +1 -1
- package/dist/fn/Input/Parts.d.ts +1 -1
- package/dist/fn/Input/Parts.js +1 -1
- package/dist/fn/Input/Plain.d.ts +2 -2
- package/dist/fn/Input/Plain.js +1 -1
- package/dist/fn/Input/RichSelect.d.ts +3 -3
- package/dist/fn/Input/RichSelect.js +1 -1
- package/dist/fn/Input/Search.d.ts +1 -1
- package/dist/fn/Input/Segmented.d.ts +8 -8
- package/dist/fn/Input/Segmented.js +1 -1
- package/dist/fn/Input/Select.d.ts +1 -1
- package/dist/fn/Input/Select.js +1 -1
- package/dist/fn/Input/Slider.js +1 -1
- package/dist/fn/Input/Switch.js +1 -1
- package/dist/fn/Input/Text.js +1 -1
- package/dist/fn/Input/TextArea.js +1 -1
- package/dist/fn/Input/Time/Picker.js +1 -1
- package/dist/fn/Input/Time/index.d.ts +1 -1
- package/dist/fn/Input/Time/index.js +1 -1
- package/dist/fn/Input/core.d.ts +11 -11
- package/dist/fn/Input/core.js +1 -1
- package/dist/fn/Input/index.d.ts +4 -4
- package/dist/fn/Input/index.js +1 -1
- package/dist/fn/Loader/corner.js +1 -1
- package/dist/fn/Loader/index.d.ts +1 -5
- package/dist/fn/Loader/index.js +1 -1
- package/dist/fn/Loader/mini.d.ts +1 -1
- package/dist/fn/Loader/mini.js +1 -1
- package/dist/fn/PageNotFound.js +1 -0
- package/dist/fn/{Layout/PageViewController.d.ts → PageViewController.d.ts} +1 -1
- package/dist/fn/PageViewController.js +1 -0
- package/dist/fn/{Layout/Plate.d.ts → Plate.d.ts} +1 -1
- package/dist/fn/Plate.js +1 -0
- package/dist/fn/{Layout/RootViewController.d.ts → RootViewController.d.ts} +10 -10
- package/dist/fn/RootViewController.js +1 -0
- package/dist/fn/Sheet.d.ts +11 -10
- package/dist/fn/Sheet.js +1 -1
- package/dist/fn/Snackbar.d.ts +1 -1
- package/dist/fn/Snackbar.js +1 -1
- package/dist/fn/{Layout/SwipeView.d.ts → SwipeView.d.ts} +2 -2
- package/dist/fn/SwipeView.js +1 -0
- package/dist/fn/{Layout/TabBar.d.ts → TabBar.d.ts} +1 -1
- package/dist/fn/TabBar.js +1 -0
- package/dist/fn/Table/Data.d.ts +2 -2
- package/dist/fn/Table/Data.js +1 -1
- package/dist/fn/Table/Drag.d.ts +1 -1
- package/dist/fn/Table/Drag.js +1 -1
- package/dist/fn/Table/Normal.d.ts +1 -1
- package/dist/fn/Table/Normal.js +1 -1
- package/dist/fn/Table/Wrapper.d.ts +1 -1
- package/dist/fn/Table/Wrapper.js +1 -1
- package/dist/fn/Table/cellStyling.d.ts +2 -2
- package/dist/fn/Table/cellStyling.js +1 -1
- package/dist/fn/Table/index.d.ts +3 -3
- package/dist/fn/Table/index.js +1 -1
- package/dist/fn/Tooltips.d.ts +1 -1
- package/dist/fn/index.d.ts +6 -1
- package/dist/fn/index.js +1 -1
- package/dist/index.d.ts +17 -6
- package/dist/mols/Accordion.js +1 -1
- package/dist/mols/List.js +1 -1
- package/dist/mols/Text.js +1 -1
- package/dist/temps/designBook.d.ts +0 -2
- package/dist/temps/designBook.js +10 -10
- package/package.json +3 -8
- package/dist/@utils/fin.d.ts +0 -1
- package/dist/@utils/fin.js +0 -1
- package/dist/@utils/pageTransit.d.ts +0 -11
- package/dist/@utils/pageTransit.js +0 -1
- package/dist/fn/Layout/PageNotFound.js +0 -1
- package/dist/fn/Layout/PageRouter.d.ts +0 -27
- package/dist/fn/Layout/PageRouter.js +0 -1
- package/dist/fn/Layout/PageViewController.js +0 -1
- package/dist/fn/Layout/Plate.js +0 -1
- package/dist/fn/Layout/RootViewController.js +0 -1
- package/dist/fn/Layout/SwipeView.js +0 -1
- package/dist/fn/Layout/TabBar.js +0 -1
- package/dist/fn/Layout/index.d.ts +0 -27
- package/dist/fn/Layout/index.js +0 -1
- package/dist/fn/Loader/top.d.ts +0 -2
- package/dist/fn/Loader/top.js +0 -1
- /package/dist/fn/{Layout/PageNotFound.d.ts → PageNotFound.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../chunk-VY3566IV.js";import{useState as n,useEffect as a,useRef as i}from"react";import s from"../fn/Sheet";import{RootViewController as u}from"../fn/RootViewController";const m=e=>{let[r,f]=n(e.pathname),t=!0;r!==e.pathname&&(t=!1,f(e.pathname));const o=i(!1);a(()=>{t&&(o.current?(s.closeAll(!0),u.fn.updateCSSProperty.reset()):o.current=!0)},[r]),t&&e.beforeCB&&e.beforeCB(location.href),a(()=>{t&&e.afterFirstCB&&e.afterFirstCB(location.href)},[]),a(()=>{t&&(setTimeout(()=>{window.dispatchEvent(new Event("resize"))},200),e.afterCB&&e.afterCB(location.href))},[r])};export{m as useRouterEffect};
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
declare namespace useStore {
|
|
2
2
|
type Methods = {
|
|
3
|
-
set(
|
|
4
|
-
|
|
5
|
-
value: any;
|
|
6
|
-
privateKey?: string;
|
|
7
|
-
}): boolean;
|
|
8
|
-
update(para: {
|
|
9
|
-
key: string;
|
|
10
|
-
value: any;
|
|
11
|
-
privateKey?: string;
|
|
12
|
-
}): boolean;
|
|
3
|
+
set(p: plainObject, privateKey?: string): boolean;
|
|
4
|
+
update(p: plainObject, privateKey?: string): boolean;
|
|
13
5
|
get(key: string, privateKey?: string): any;
|
|
14
6
|
delete(key: string, privateKey?: string): boolean;
|
|
15
7
|
};
|
package/dist/@utils/useStore.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{b as n,c as o}from"../chunk-VY3566IV.js";const t={},u={set:(r,a)=>{let e=!0;return Object.entries(r).forEach(([i,l])=>{let s=t[i]||{};s&&s.privateKey&&s.privateKey!=a&&(e=!1),t[i]={privateKey:a,value:l}}),e},update:(r,a)=>{let e=!0;return Object.entries(r).forEach(([i,l])=>{var p;let s=t[i]||{};s&&s.privateKey&&s.privateKey!=a&&(e=!1),t[i]=o(n({},t[i]),{value:n(n({},(p=t[i])==null?void 0:p.value),l)})}),e},get:(r,a)=>{let e=t[r];if(!(e&&e.privateKey&&e.privateKey!=a))return e==null?void 0:e.value},delete:(r,a)=>{let e=t[r];return e&&e.privateKey&&e.privateKey!=a?!1:(delete t[r],!0)}};export{u as default,u as useStore};
|
package/dist/atoms/FAI.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
|
6
6
|
declare namespace FAI {
|
|
7
7
|
type ComponentInput = TagProperty.BasicElement & {
|
|
8
8
|
icon: IconProp | IconDefinition | any;
|
|
9
|
-
|
|
9
|
+
iconProps?: Omit<FontAwesomeIconProps, 'icon'>;
|
|
10
10
|
};
|
|
11
11
|
type Shortcuts = {
|
|
12
12
|
[key in ShortCutNames]: React.FC<Omit<ComponentInput, 'icon'>>;
|
package/dist/atoms/FAI.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as r,c as i,d as f}from"../chunk-VY3566IV.js";import{jsx as n}from"react/jsx-runtime";import l from"./Box";import{FontAwesomeIcon as s}from"@fortawesome/react-fontawesome";import{faTimes as h}from"@fortawesome/free-solid-svg-icons/faTimes";import{faAngleRight as C}from"@fortawesome/free-solid-svg-icons/faAngleRight";import{faAngleLeft as A}from"@fortawesome/free-solid-svg-icons/faAngleLeft";import{faAngleUp as g}from"@fortawesome/free-solid-svg-icons/faAngleUp";import{faAngleDown as w}from"@fortawesome/free-solid-svg-icons/faAngleDown";import{faChevronLeft as R}from"@fortawesome/free-solid-svg-icons/faChevronLeft";import{faChevronRight as u}from"@fortawesome/free-solid-svg-icons/faChevronRight";import{faChevronUp as L}from"@fortawesome/free-solid-svg-icons/faChevronUp";import{faChevronDown as S}from"@fortawesome/free-solid-svg-icons/faChevronDown";import{faCaretLeft as E}from"@fortawesome/free-solid-svg-icons/faCaretLeft";import{faCaretRight as x}from"@fortawesome/free-solid-svg-icons/faCaretRight";import{faCaretUp as I}from"@fortawesome/free-solid-svg-icons/faCaretUp";import{faCaretDown as P}from"@fortawesome/free-solid-svg-icons/faCaretDown";import{faArrowLeft as D}from"@fortawesome/free-solid-svg-icons/faArrowLeft";import{faArrowRight as d}from"@fortawesome/free-solid-svg-icons/faArrowRight";import{faArrowUp as k}from"@fortawesome/free-solid-svg-icons/faArrowUp";import{faArrowDown as y}from"@fortawesome/free-solid-svg-icons/faArrowDown";import{faRotate as U}from"@fortawesome/free-solid-svg-icons/faRotate";import{faRedo as F}from"@fortawesome/free-solid-svg-icons/faRedo";import{faCheck as v}from"@fortawesome/free-solid-svg-icons/faCheck";import{faQuestion as T}from"@fortawesome/free-solid-svg-icons/faQuestion";import{faExclamation as H}from"@fortawesome/free-solid-svg-icons/faExclamation";import{faExclamationTriangle as B}from"@fortawesome/free-solid-svg-icons/faExclamationTriangle";import{faHome as Q}from"@fortawesome/free-solid-svg-icons/faHome";import{faShare as M}from"@fortawesome/free-solid-svg-icons/faShare";import{faSearch as G}from"@fortawesome/free-solid-svg-icons/faSearch";import{faYenSign as V}from"@fortawesome/free-solid-svg-icons/faYenSign";import{faPen as Y}from"@fortawesome/free-solid-svg-icons/faPen";import{faBars as N}from"@fortawesome/free-solid-svg-icons/faBars";import{faDownload as O}from"@fortawesome/free-solid-svg-icons/faDownload";import{faLink as W}from"@fortawesome/free-solid-svg-icons/faLink";import{faLinkSlash as z}from"@fortawesome/free-solid-svg-icons/faLinkSlash";import{faExternalLinkAlt as b}from"@fortawesome/free-solid-svg-icons/faExternalLinkAlt";import{faGear as q}from"@fortawesome/free-solid-svg-icons/faGear";import{faPlus as J}from"@fortawesome/free-solid-svg-icons/faPlus";import{faMinus as K}from"@fortawesome/free-solid-svg-icons/faMinus";import{faEllipsisH as X}from"@fortawesome/free-solid-svg-icons/faEllipsisH";import{faEllipsisV as Z}from"@fortawesome/free-solid-svg-icons/faEllipsisV";import{faStar as _}from"@fortawesome/free-solid-svg-icons/faStar";import{faPaperPlane as $}from"@fortawesome/free-solid-svg-icons/faPaperPlane";import{faHeart as j}from"@fortawesome/free-solid-svg-icons/faHeart";import{faUser as oo}from"@fortawesome/free-regular-svg-icons/faUser";import{faCheckCircle as ro}from"@fortawesome/free-regular-svg-icons/faCheckCircle";import{faQuestionCircle as io}from"@fortawesome/free-regular-svg-icons/faQuestionCircle";import{faEdit as to}from"@fortawesome/free-regular-svg-icons/faEdit";import{faCopy as no}from"@fortawesome/free-regular-svg-icons/faCopy";import{faFile as eo}from"@fortawesome/free-regular-svg-icons/faFile";import{faTrashAlt as ao}from"@fortawesome/free-regular-svg-icons/faTrashAlt";import{faImage as mo}from"@fortawesome/free-regular-svg-icons/faImage";const e=o=>{let m=o,{icon:p,
|
|
1
|
+
import{b as r,c as i,d as f}from"../chunk-VY3566IV.js";import{jsx as n}from"react/jsx-runtime";import l from"./Box";import{FontAwesomeIcon as s}from"@fortawesome/react-fontawesome";import{faTimes as h}from"@fortawesome/free-solid-svg-icons/faTimes";import{faAngleRight as C}from"@fortawesome/free-solid-svg-icons/faAngleRight";import{faAngleLeft as A}from"@fortawesome/free-solid-svg-icons/faAngleLeft";import{faAngleUp as g}from"@fortawesome/free-solid-svg-icons/faAngleUp";import{faAngleDown as w}from"@fortawesome/free-solid-svg-icons/faAngleDown";import{faChevronLeft as R}from"@fortawesome/free-solid-svg-icons/faChevronLeft";import{faChevronRight as u}from"@fortawesome/free-solid-svg-icons/faChevronRight";import{faChevronUp as L}from"@fortawesome/free-solid-svg-icons/faChevronUp";import{faChevronDown as S}from"@fortawesome/free-solid-svg-icons/faChevronDown";import{faCaretLeft as E}from"@fortawesome/free-solid-svg-icons/faCaretLeft";import{faCaretRight as x}from"@fortawesome/free-solid-svg-icons/faCaretRight";import{faCaretUp as I}from"@fortawesome/free-solid-svg-icons/faCaretUp";import{faCaretDown as P}from"@fortawesome/free-solid-svg-icons/faCaretDown";import{faArrowLeft as D}from"@fortawesome/free-solid-svg-icons/faArrowLeft";import{faArrowRight as d}from"@fortawesome/free-solid-svg-icons/faArrowRight";import{faArrowUp as k}from"@fortawesome/free-solid-svg-icons/faArrowUp";import{faArrowDown as y}from"@fortawesome/free-solid-svg-icons/faArrowDown";import{faRotate as U}from"@fortawesome/free-solid-svg-icons/faRotate";import{faRedo as F}from"@fortawesome/free-solid-svg-icons/faRedo";import{faCheck as v}from"@fortawesome/free-solid-svg-icons/faCheck";import{faQuestion as T}from"@fortawesome/free-solid-svg-icons/faQuestion";import{faExclamation as H}from"@fortawesome/free-solid-svg-icons/faExclamation";import{faExclamationTriangle as B}from"@fortawesome/free-solid-svg-icons/faExclamationTriangle";import{faHome as Q}from"@fortawesome/free-solid-svg-icons/faHome";import{faShare as M}from"@fortawesome/free-solid-svg-icons/faShare";import{faSearch as G}from"@fortawesome/free-solid-svg-icons/faSearch";import{faYenSign as V}from"@fortawesome/free-solid-svg-icons/faYenSign";import{faPen as Y}from"@fortawesome/free-solid-svg-icons/faPen";import{faBars as N}from"@fortawesome/free-solid-svg-icons/faBars";import{faDownload as O}from"@fortawesome/free-solid-svg-icons/faDownload";import{faLink as W}from"@fortawesome/free-solid-svg-icons/faLink";import{faLinkSlash as z}from"@fortawesome/free-solid-svg-icons/faLinkSlash";import{faExternalLinkAlt as b}from"@fortawesome/free-solid-svg-icons/faExternalLinkAlt";import{faGear as q}from"@fortawesome/free-solid-svg-icons/faGear";import{faPlus as J}from"@fortawesome/free-solid-svg-icons/faPlus";import{faMinus as K}from"@fortawesome/free-solid-svg-icons/faMinus";import{faEllipsisH as X}from"@fortawesome/free-solid-svg-icons/faEllipsisH";import{faEllipsisV as Z}from"@fortawesome/free-solid-svg-icons/faEllipsisV";import{faStar as _}from"@fortawesome/free-solid-svg-icons/faStar";import{faPaperPlane as $}from"@fortawesome/free-solid-svg-icons/faPaperPlane";import{faHeart as j}from"@fortawesome/free-solid-svg-icons/faHeart";import{faUser as oo}from"@fortawesome/free-regular-svg-icons/faUser";import{faCheckCircle as ro}from"@fortawesome/free-regular-svg-icons/faCheckCircle";import{faQuestionCircle as io}from"@fortawesome/free-regular-svg-icons/faQuestionCircle";import{faEdit as to}from"@fortawesome/free-regular-svg-icons/faEdit";import{faCopy as no}from"@fortawesome/free-regular-svg-icons/faCopy";import{faFile as eo}from"@fortawesome/free-regular-svg-icons/faFile";import{faTrashAlt as ao}from"@fortawesome/free-regular-svg-icons/faTrashAlt";import{faImage as mo}from"@fortawesome/free-regular-svg-icons/faImage";const e=o=>{let m=o,{icon:p,iconProps:a}=m,c=f(m,["icon","iconProps"]);return n(l,i(r({display:"inlineFlex",flexCenter:!0,position:"relative",freeCSS:{aspectRatio:"1"}},c),{children:n(s,i(r({icon:p,fixedWidth:!0,size:"sm"},a),{style:r({aspectRatio:1,minWidth:12*1,minHeight:12*1},a==null?void 0:a.style)}))}))},t=e;t.User=o=>n(e,i(r({},o),{icon:oo})),t.Times=o=>n(e,i(r({},o),{icon:h})),t.AngleRight=o=>n(e,i(r({},o),{icon:C})),t.AngleLeft=o=>n(e,i(r({},o),{icon:A})),t.AngleUp=o=>n(e,i(r({},o),{icon:g})),t.AngleDown=o=>n(e,i(r({},o),{icon:w})),t.ChevronLeft=o=>n(e,i(r({},o),{icon:R})),t.ChevronRight=o=>n(e,i(r({},o),{icon:u})),t.ChevronUp=o=>n(e,i(r({},o),{icon:L})),t.ChevronDown=o=>n(e,i(r({},o),{icon:S})),t.CaretLeft=o=>n(e,i(r({},o),{icon:E})),t.CaretRight=o=>n(e,i(r({},o),{icon:x})),t.CaretUp=o=>n(e,i(r({},o),{icon:I})),t.CaretDown=o=>n(e,i(r({},o),{icon:P})),t.ArrowLeft=o=>n(e,i(r({},o),{icon:D})),t.ArrowRight=o=>n(e,i(r({},o),{icon:d})),t.ArrowUp=o=>n(e,i(r({},o),{icon:k})),t.ArrowDown=o=>n(e,i(r({},o),{icon:y})),t.Rotate=o=>n(e,i(r({},o),{icon:U})),t.Redo=o=>n(e,i(r({},o),{icon:F})),t.Check=o=>n(e,i(r({},o),{icon:v})),t.CheckCircle=o=>n(e,i(r({},o),{icon:ro})),t.Question=o=>n(e,i(r({},o),{icon:T})),t.QuestionCircle=o=>n(e,i(r({},o),{icon:io})),t.Exclamation=o=>n(e,i(r({},o),{icon:H})),t.ExclamationTriangle=o=>n(e,i(r({},o),{icon:B})),t.Home=o=>n(e,i(r({},o),{icon:Q})),t.Share=o=>n(e,i(r({},o),{icon:M})),t.Search=o=>n(e,i(r({},o),{icon:G})),t.YenSign=o=>n(e,i(r({},o),{icon:V})),t.Heart=o=>n(e,i(r({},o),{icon:j})),t.Star=o=>n(e,i(r({},o),{icon:_})),t.Edit=o=>n(e,i(r({},o),{icon:to})),t.Pen=o=>n(e,i(r({},o),{icon:Y})),t.Copy=o=>n(e,i(r({},o),{icon:no})),t.File=o=>n(e,i(r({},o),{icon:eo})),t.TrashAlt=o=>n(e,i(r({},o),{icon:ao})),t.Bars=o=>n(e,i(r({},o),{icon:N})),t.Download=o=>n(e,i(r({},o),{icon:O})),t.Link=o=>n(e,i(r({},o),{icon:W})),t.LinkSlash=o=>n(e,i(r({},o),{icon:z})),t.ExternalLinkAlt=o=>n(e,i(r({},o),{icon:b})),t.Gear=o=>n(e,i(r({},o),{icon:q})),t.Plus=o=>n(e,i(r({},o),{icon:J})),t.Minus=o=>n(e,i(r({},o),{icon:K})),t.EllipsisH=o=>n(e,i(r({},o),{icon:X})),t.EllipsisV=o=>n(e,i(r({},o),{icon:Z})),t.PaperPlane=o=>n(e,i(r({},o),{icon:$})),t.Image=o=>n(e,i(r({},o),{icon:mo}));export{t as FAI,t as default};
|
package/dist/atoms/Flex.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t,c as r}from"../chunk-VY3566IV.js";import{jsx as
|
|
1
|
+
import{b as t,c as r}from"../chunk-VY3566IV.js";import{jsx as l}from"react/jsx-runtime";import o from"./Box";const a=e=>l(o,r(t({flexType:"row",flexWrap:!0,display:"flex"},e),{freeCSS:t({wordBreak:"break-word"},e.freeCSS)})),n=e=>l(o,t({width:1,flexSizing:"none"},e));export{a as Flex,n as FlexBr,a as default};
|
package/dist/atoms/Logo.d.ts
CHANGED
|
@@ -11,21 +11,21 @@ declare namespace Logo {
|
|
|
11
11
|
color?: 'normal' | 'white';
|
|
12
12
|
};
|
|
13
13
|
type Methods = {
|
|
14
|
-
Icon: (
|
|
15
|
-
Title: (
|
|
14
|
+
Icon: (p: ComponentInput) => JSX.Element;
|
|
15
|
+
Title: (p: ComponentInput) => JSX.Element;
|
|
16
16
|
Brands: {
|
|
17
|
-
MingooIcon: (
|
|
18
|
-
MingooTitle: (
|
|
19
|
-
MingooLogoH: (
|
|
20
|
-
MingooLogoV: (
|
|
21
|
-
ComunIcon: (
|
|
22
|
-
ComunTitle: (
|
|
23
|
-
ComunLogoH: (
|
|
24
|
-
ComunLogoV: (
|
|
25
|
-
Google: (
|
|
26
|
-
Facebook: (
|
|
27
|
-
Twitter: (
|
|
28
|
-
LINE: (
|
|
17
|
+
MingooIcon: (p: DefaultLogoInput) => JSX.Element;
|
|
18
|
+
MingooTitle: (p: DefaultLogoInput) => JSX.Element;
|
|
19
|
+
MingooLogoH: (p: DefaultLogoInput) => JSX.Element;
|
|
20
|
+
MingooLogoV: (p: DefaultLogoInput) => JSX.Element;
|
|
21
|
+
ComunIcon: (p: DefaultLogoInput) => JSX.Element;
|
|
22
|
+
ComunTitle: (p: DefaultLogoInput) => JSX.Element;
|
|
23
|
+
ComunLogoH: (p: DefaultLogoInput) => JSX.Element;
|
|
24
|
+
ComunLogoV: (p: DefaultLogoInput) => JSX.Element;
|
|
25
|
+
Google: (p: DefaultLogoInput) => JSX.Element;
|
|
26
|
+
Facebook: (p: DefaultLogoInput) => JSX.Element;
|
|
27
|
+
Twitter: (p: DefaultLogoInput) => JSX.Element;
|
|
28
|
+
LINE: (p: DefaultLogoInput) => JSX.Element;
|
|
29
29
|
};
|
|
30
30
|
Images: {
|
|
31
31
|
mingooIcon: string;
|
package/dist/atoms/Logo.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as l,c as
|
|
1
|
+
import{b as l,c as g,d as m}from"../chunk-VY3566IV.js";import{Fragment as A,jsx as e,jsxs as I}from"react/jsx-runtime";import h from"@mingoo/jsmin";import L from"./Flex";import S from"./Img";import{LogoClasses as i}from"../@styles/componentClasses";const T={ComunIcon:()=>e("svg",{viewBox:"0,0,1200,1200",className:i("ComunIcon"),children:I("g",{children:[e("path",{d:`
|
|
2
2
|
M
|
|
3
3
|
100,600
|
|
4
4
|
A 500,500 0 0,0 600,1100
|
|
@@ -40,7 +40,7 @@ import{b as l,c as a,d as m}from"../chunk-VY3566IV.js";import{Fragment as A,jsx
|
|
|
40
40
|
L600,600
|
|
41
41
|
L600,300
|
|
42
42
|
Z
|
|
43
|
-
`,className:[
|
|
43
|
+
`,className:[i("P"),i("P_"+t)].join(" "),style:{fill:"#c56ff0"}}),e("path",{d:`
|
|
44
44
|
M
|
|
45
45
|
600,300
|
|
46
46
|
A 45,45 0 0,1 600,390
|
|
@@ -48,4 +48,4 @@ import{b as l,c as a,d as m}from"../chunk-VY3566IV.js";import{Fragment as A,jsx
|
|
|
48
48
|
L600,600
|
|
49
49
|
L600,300
|
|
50
50
|
Z
|
|
51
|
-
`,className:[
|
|
51
|
+
`,className:[i("P"),i("P_"+t)].join(" "),style:{fill:"#ea6093"}})]});return I("svg",{viewBox:"0,0,1200,1200",className:i("MingooIcon"),children:[o(0),o(1),o(2),o(3),o(4),o(5),o(6),o(7),o(8)]})}},u={Icon:o=>e(a.Icon,g(l({},o),{children:e(T.MingooIcon,{})})),Title:o=>e(a.Title,g(l({height:"auto",className:i("ComunTitle")},o),{freeCSS:l({letterSpacing:"3px"},o.freeCSS),children:"mingoo"})),LogoH:o=>{let n=o,{size:t,color:c}=n,r=m(n,["size","color"]);return I(L,g(l({gap:"1/2",flexCenter:!0},r),{children:[e(u.Icon,{size:t,color:c}),e(u.Title,{size:t,color:c})]}))},LogoV:o=>{let n=o,{size:t,color:c}=n,r=m(n,["size","color"]);return I(L,g(l({flexType:"col",gap:"1/2"},r),{children:[e(u.Icon,{margin:"auto",size:t,color:c}),e(u.Title,{size:t,color:c})]}))}},p={Icon:o=>e(a.Icon,g(l({},o),{children:e(T.ComunIcon,{})})),Title:o=>e(a.Title,g(l({height:"auto",className:i("ComunTitle")},o),{freeCSS:l({letterSpacing:"3px"},o.freeCSS),children:"comun"})),LogoH:o=>{let n=o,{size:t,color:c}=n,r=m(n,["size","color"]);return I(L,g(l({gap:"1/2",flexCenter:!0},r),{children:[e(p.Icon,{size:t,color:c}),e(p.Title,{size:t,color:c})]}))},LogoV:o=>{let n=o,{size:t,color:c}=n,r=m(n,["size","color"]);return I(L,g(l({flexType:"col",gap:"1/2"},r),{children:[e(p.Icon,{margin:"auto",size:t,color:c}),e(p.Title,{size:t,color:c})]}))}};let s="https://cdn.amotify.com/";const a={Icon:o=>{let f=o,{size:t="R",color:c="normal",className:r="",children:n}=f,C=m(f,["size","color","className","children"]);return e(L,g(l({verticalAlign:"center",className:[r,i("Icon"),i("Size_"+t)].join(" ")},C),{children:h.is.function(n)?e(n,{}):n}))},Title:o=>{let f=o,{size:t="R",color:c="normal",className:r="",children:n}=f,C=m(f,["size","color","className","children"]);return e(L,g(l({verticalAlign:"center",fontColor:c=="white"?"white":"logo",className:[r,i("Title"),i("Size_"+t)].join(" ")},C),{freeCSS:l({lineHeight:"1.25"},C.freeCSS),children:h.is.function(n)?e(n,{}):n}))},Brands:{MingooIcon:u.Icon,MingooTitle:u.Title,MingooLogoH:u.LogoH,MingooLogoV:u.LogoV,ComunIcon:p.Icon,ComunTitle:p.Title,ComunLogoH:p.LogoH,ComunLogoV:p.LogoV,Google:o=>e(a.Icon,g(l({},o),{children:e(S,{src:s+"@env/@logos/brands/Google_Icon.svg",alt:""})})),Facebook:o=>e(a.Icon,g(l({},o),{children:e(S,{src:s+"@env/@logos/brands/FaceBook_Icon.svg",alt:""})})),Twitter:o=>e(a.Icon,g(l({},o),{children:e(S,{src:s+"@env/@logos/brands/Twitter_Icon.svg",alt:""})})),LINE:o=>e(a.Icon,g(l({},o),{children:e(S,{src:s+"@env/@logos/brands/Line_Icon.svg",alt:""})}))},Images:{mingooIcon:s+"@env/@logos/mingoo/icon.png",mingooIconClear:s+"@env/@logos/mingoo/iconClear.png",comunIcon:s+"@env/@logos/comun/icon.png",comunIconClear:s+"@env/@logos/comun/iconClear.png",defaultIcon:o=>s+"@env/@icon/"+(o||"image")+".png"}};export{a as Logo,a as default};
|
package/dist/fn/Button.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ declare namespace Button {
|
|
|
49
49
|
color?: Colors;
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
type
|
|
52
|
+
type States = TagProperty.BasicElement & {
|
|
53
53
|
tabIndex?: number;
|
|
54
54
|
children?: ReactElement;
|
|
55
55
|
'aria-label'?: string;
|
|
@@ -59,7 +59,7 @@ declare namespace Button {
|
|
|
59
59
|
isActiveClassName?: string;
|
|
60
60
|
};
|
|
61
61
|
type delegateClickEventProps = 'auxEnter' | 'enter' | 'space';
|
|
62
|
-
type ButtonInput =
|
|
62
|
+
type ButtonInput = States & {
|
|
63
63
|
submitOption?: {
|
|
64
64
|
formName: string;
|
|
65
65
|
acceptInvalidForm?: boolean;
|
|
@@ -67,10 +67,10 @@ declare namespace Button {
|
|
|
67
67
|
callback(form: plainObject, ok: boolean): void;
|
|
68
68
|
};
|
|
69
69
|
} & React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
70
|
-
type LabelInput =
|
|
70
|
+
type LabelInput = States & {
|
|
71
71
|
htmlFor?: string;
|
|
72
72
|
} & React.LabelHTMLAttributes<HTMLLabelElement>;
|
|
73
|
-
type AnchorInput =
|
|
73
|
+
type AnchorInput = States & {
|
|
74
74
|
href?: string;
|
|
75
75
|
newTab?: boolean;
|
|
76
76
|
sync?: boolean;
|
package/dist/fn/Button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as o,c as i,d as B,e as
|
|
1
|
+
import{b as o,c as i,d as B,e as g}from"../chunk-VY3566IV.js";import{jsx as d}from"react/jsx-runtime";import x from"@mingoo/jsmin";import{pageRouter as v,ReadStyleSet as N,collectForm as I,GenerateClassName as E}from"../@utils";import{ButtonClasses as c}from"../@styles/componentClasses";const P={Size:(r,t,n,s)=>{let e={fontSize:"inherit"};return n=n||"R",["Plain","Link"].includes(t)?{}:(n=="XS"?e=i(o({},e),{padding:["1/3","2/3"],fontSize:"0.xs",borderRadius:"3.tone.tertiary"}):n=="S"?e=i(o({},e),{padding:["1/2","3/4"],fontSize:"1.mini",borderRadius:"3.tone.tertiary"}):n=="R"?(e.padding=["3/4",1],t=="Prime"&&(e.padding=["3/4",2])):n=="L"&&(e.padding=[1,3],e.fontSize="3.paragraph",e.isSemiBoldFont=!0),e=o({borderRadius:"2.tone.secondary",transition:"middle",position:"relative",textAlign:"center"},e),e)},Tone:(r,t,n,s)=>{let e={display:"inlineBlock",fontWeight:"inherit",fontColor:"inherit",border:"unset"};return t=="Plain"||(t=="Link"?(e.fontColor="theme",e.textAlign="left",e.backgroundColor="trans"):t=="Normal"?e=i(o({},e),{backgroundColor:"trans"}):t=="Border"?e=i(o({},e),{backgroundColor:"layer.1",border:"2.normal",borderStyle:"solid",boxShadow:"0.thin"}):t=="Prime"?(e=i(o({},e),{isSemiBoldFont:!0,fontColor:"white",backgroundColor:s,boxShadow:"0.normal",ssEffectsOnActive:["shrink","push","ripple.white"]}),s=="white"&&(e=i(o({},e),{fontColor:"theme",ssEffectsOnActive:["shrink","push","ripple.cloud"]}))):t=="Sub"?e=i(o({},e),{fontColor:s,ssEffectsOnActive:["shrink","ripple.cloud"]}):t=="Clear"?e=i(o({},e),{fontColor:s,backgroundColor:"trans",ssEffectsOnActive:["shrink","ripple.cloud"]}):t=="FillToBorder"?e=i(o({},e),{boxShadow:"0.normal",border:"2.normal",borderWidth:2,borderColor:s,fontColor:s,backgroundColor:s}):t=="BorderToFill"&&(e=i(o({},e),{fontColor:s,boxShadow:"0.normal",border:"2.normal",borderWidth:2,borderColor:s,backgroundColor:s})),s=="cloud"&&(e.fontColor="3.blur"),t!="Link"&&(e=o({position:"relative",ssEffectsOnActive:["shrink","push"]},e))),e}},m=r=>{let t=N(o({isLocked:!1,isActive:!1,isActiveStyles:{},isActiveClassName:"",tabIndex:0,className:"",color:"theme","aria-label":x.uuid.gen()},r)),n=t.seed;{let{isLocked:S=!1,isActive:f=!1,isActiveStyles:b={},isActiveClassName:T="",tone:a="border",color:l="theme",className:u=""}=t;t=o(o(o({},P.Size(r.seed,r.tone,r.size,l)),P.Tone(r.seed,r.tone,r.size,l)),t),t.className=[u,c("Wrap"),c("isNeutral_"+!f),c("isLocked_"+S),c("Tone_"+a),c("Color_"+l),c("Tone_"+a+"_Color_"+l)].join(" "),f&&(t=o(o({className:[t.className,T].join(" ")},t),b)),t=E(t)}if(n=="Button"){let s=t,{isLocked:S,isActive:f,isActiveClassName:b,isActiveStyles:T,submitOption:a,onClick:l}=s,u=B(s,["isLocked","isActive","isActiveClassName","isActiveStyles","submitOption","onClick"]);return a&&(a=o({acceptInvalidForm:!1,submitDelegationKey:"auxEnter"},a),u=i(o({},u),{"data-form-submit-button":a.formName,"data-sdfike":x.flatArray(a.submitDelegationKey).join(",")})),d("button",o({onClick:C=>g(void 0,null,function*(){if(l&&l(C),!a)return;let y=yield I(a.formName);!a.acceptInvalidForm&&!y.valid||a.callback(y.data,y.valid)})},u))}else if(n=="Label"){let e=t,{isLocked:S,isActive:f,isActiveClassName:b,isActiveStyles:T}=e,a=B(e,["isLocked","isActive","isActiveClassName","isActiveStyles"]);return d("label",o({},a))}else if(n=="Anchor"){let A=t,{isLocked:S,isActive:f,isActiveClassName:b,isActiveStyles:T,href:a="",newTab:l,sync:u,shiftQueryParams:C}=A,y=B(A,["isLocked","isActive","isActiveClassName","isActiveStyles","href","newTab","sync","shiftQueryParams"]);return d("button",o({onClick:L=>{let z=L.ctrlKey||L.metaKey,R=l||!!z,h=a;C&&(h+=location.search),u?v.pushSync(h):v.push(h,!!R)}},y))}return null},p=(r,t)=>({XS:n=>d(m,i(o({},n),{seed:r,tone:t,size:"S"})),S:n=>d(m,i(o({},n),{seed:r,tone:t,size:"S"})),R:n=>d(m,i(o({},n),{seed:r,tone:t,size:"R"})),L:n=>d(m,i(o({},n),{seed:r,tone:t,size:"L"}))}),k=r=>({Plain:t=>d(m,i(o({},t),{seed:r,tone:"Plain",size:"R"})),Link:t=>d(m,i(o({},t),{seed:r,tone:"Link",size:"R"})),Normal:p(r,"Normal"),Border:p(r,"Border"),Prime:p(r,"Prime"),Sub:p(r,"Sub"),Clear:p(r,"Clear"),FillToBorder:p(r,"FillToBorder"),BorderToFill:p(r,"BorderToFill")}),F={Button:k("Button"),Label:k("Label"),Anchor:k("Anchor")};export{F as Button,F as default};
|
package/dist/fn/Cropper.d.ts
CHANGED
package/dist/fn/Cropper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as X,c as O,e as B}from"../chunk-VY3566IV.js";import{Fragment as $,jsx as p,jsxs as y}from"react/jsx-runtime";import b from"@mingoo/jsmin";import{$$fromRoot as j,useStore as M}from"../@utils";import{useState as z,useEffect as H}from"react";import V from"../atoms/Flex";import D from"../atoms/Box";import P from"../atoms/FAI";import T from"../mols/Column";import q from"../mols/Row";import Y from"./Button";import A from"./Sheet";import k from"./Loader";import W from"./Input";import{faPalette as K}from"@fortawesome/free-solid-svg-icons/faPalette";import{faBarsStaggered as Z}from"@fortawesome/free-solid-svg-icons/faBarsStaggered";import{faRotateLeft as J}from"@fortawesome/free-solid-svg-icons/faRotateLeft";import{faRotateRight as Q}from"@fortawesome/free-solid-svg-icons/faRotateRight";import{CropperClasses as L}from"../@styles/componentClasses";class ee{constructor(i){this.set_scale=i.set_scale,this.val_file=i.val_file,this.develops=i.develops,this.use=i.use,this.componentID=i.componentID,this.scale={current:i.scale.default,default:i.scale.default,min:i.scale.min,max:i.scale.max};let e=i.canvas,{width:l,height:t}=e,a=i.picture.image,{width:h,height:s}=a,c=h/s;this.Canvas={elm:e,ctx:e.getContext("2d")};let o=0,r=0;this.use=="square"?(o=e.width/3*2,r=e.height/3*2):this.use=="wallpaper.horizontal"?(o=e.width*(7/9),r=o/3):this.use=="wallpaper.vertical"&&(r=e.height*(7/9),o=r/2);let n=(e.width-o)/2,d=(e.height-r)/2,g=o/r;this.Picture={elm:a,originDataUrl:a.src,aspect:c,revisedAspect:g>c?o/h:r/s,rotate:i.picture.rotate,grayScale:i.picture.grayScale,tone:i.picture.tone},this.pst={frame:{x:n,y:d,w:o,h:r,aspect:g},outImage:{x:0,y:0,w:0,h:0},imageX:h/2,imageY:s/2,centerX:l/2,centerY:t/2},this.dragEffectInfo={origin:{x:0,y:0},frameExpandRate:{x:0,y:0}},this.pinchEffectInfo={origin:{x:0,y:0,scale:this.scale.current}},this.modifyImage()}dragEffect(i){let{eventType:e,x:l,y:t}=i;if(e=="start"){let a=this.Canvas.elm.position();this.dragEffectInfo={origin:{x:l,y:t},frameExpandRate:{x:this.Canvas.elm.width/a.width,y:this.Canvas.elm.height/a.height}}}else{let{origin:a,frameExpandRate:h}=this.dragEffectInfo,s=a.x-l,c=a.y-t,o=this.scale.current*this.Picture.revisedAspect/100,r=s/o*h.x,n=c/o*h.y;e=="move"?this.drawImage(this.pst.imageX+r,this.pst.imageY+n):e=="end"&&this.drawImage(this.pst.imageX+=r,this.pst.imageY+=n)}}pinchEffect(i){let{eventType:e,event:l}=i,{x:t,y:a}=b.getCursor(l.touches[0]),{x:h,y:s}=b.getCursor(l.touches[1]),c=h-t,o=s-a;if(e=="start")this.pinchEffectInfo.origin={x:c,y:o,scale:this.scale.current};else if(e=="move"){let{origin:r}=this.pinchEffectInfo,n=Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2)),g=Math.sqrt(Math.pow(c,2)+Math.pow(o,2))/n,C=Number(r.scale*g);this.set_scale(C)}}updateScale(i){let e=i;e=Math.max(e,this.scale.min),e=Math.min(e,this.scale.max),this.scale.current=e,this.drawImage()}updateFilter(i){this.Picture.grayScale=i.grayScale,this.Picture.tone=i.tone,this.Picture.rotate=i.rotate,this.modifyImage()}modifyImage(){return B(this,null,function*(){let{grayScale:i,tone:e,rotate:l}=this.Picture;const t=document.createElement("canvas");let a=t.getContext("2d"),h=yield b.ImageLoader(this.Picture.originDataUrl),s=h.width,c=h.height;(l==90||l==270)&&(s=h.height,c=h.width),t.width=s,t.height=c,i&&(a.filter="grayscale("+i+"%)"),l&&(a.translate(s/2,c/2),a.rotate(l*Math.PI/180),[90,270].includes(l)?a.translate(-c/2,-s/2):a.translate(-s/2,-c/2)),a.drawImage(h,0,0,h.width,h.height);let o=a.getImageData(0,0,t.width,t.height),r=o.data;{i/=100;let C=[[255,255,255],[255,200,100],[170,170,255],[240,200,145],[128,255,255],[255,128,255],[255,255,128],[128,158,169],[128,112,162],[50,192,87],[246,100,140]][e],x=C[0]/255,S=C[1]/255,m=C[2]/255;for(let u=0;u<c;u++)for(let v=0;v<s;v++){var n=(u*s+v)*4;if(i){let w=.3*r[n]+.59*r[n+1]+.11*r[n+2];for(var d=0;d<3;d++){let E=r[n+d];r[n+d]=E+(w-E)*i}}r[n]*=x,r[n+1]*=S,r[n+2]*=m}}a.putImageData(o,0,0);let g=t.toDataURL("image/jpeg");{let C=yield b.ImageLoader(g),{width:x,height:S}=C,m=x/S;this.Picture=O(X({},this.Picture),{elm:C,aspect:m,revisedAspect:this.pst.frame.aspect>m?this.pst.frame.w/x:this.pst.frame.h/S})}this.drawImage()})}drawImage(i,e){let{use:l,Canvas:{ctx:t},pst:{frame:a}}=this,h=i||this.pst.imageX,s=e||this.pst.imageY;{let c=this.scale.current/100,o=this.Picture.revisedAspect*c,r=this.pst.centerX-h*o,n=this.pst.centerY-s*o,d=this.Picture.elm.width*o,g=this.Picture.elm.height*o;{let C=this.pst.frame.x+this.pst.frame.w-d,x=this.pst.frame.x,S=this.pst.frame.y+this.pst.frame.h-g,m=this.pst.frame.y,u=0;r<C&&(u=r-C),r>x&&(u=r-x);let v=0;n<S&&(v=n-S),n>m&&(v=n-m),this.dragEffectInfo.origin.x+=u/2/this.dragEffectInfo.frameExpandRate.x,this.dragEffectInfo.origin.y+=v/2/this.dragEffectInfo.frameExpandRate.y,r=Math.min(Math.max(r,C),x),n=Math.min(Math.max(n,S),m)}this.pst.outImage={x:r,y:n,w:d,h:g},t.clearRect(0,0,this.Canvas.elm.width,this.Canvas.elm.height),t.drawImage(this.Picture.elm,0,0,this.Picture.elm.width,this.Picture.elm.height,r,n,d,g)}{l=="square"?(t.fillStyle="rgba( 20,24,20,.3 )",t.beginPath(),t.arc(this.Canvas.elm.width/2,this.Canvas.elm.height/2,this.Canvas.elm.width,0,Math.PI*2,!0),t.arc(this.Canvas.elm.width/2,this.Canvas.elm.height/2,this.Canvas.elm.width/3*2/2,0,Math.PI*2,!1),t.closePath(),t.fill()):(l=="wallpaper.horizontal"||l=="wallpaper.vertical")&&(t.fillStyle="rgba( 20,24,20,.3 )"),t.beginPath(),t.moveTo(0,0),t.lineTo(this.Canvas.elm.width,0),t.lineTo(this.Canvas.elm.width,this.Canvas.elm.height),t.lineTo(0,this.Canvas.elm.height),t.lineTo(0,0),t.closePath(),t.lineTo(a.x,a.y),t.lineTo(a.x,a.y+a.h),t.lineTo(a.x+a.w,a.y+a.h),t.lineTo(a.x+a.w,a.y),t.lineTo(a.x,a.y),t.fill();let o=b(document.body).getStyleProperty("--color-theme-hsl");t.lineWidth=this.Canvas.elm.width/200,t.strokeStyle=`hsla( ${o},1 )`,t.strokeRect(a.x,a.y,a.w,a.h)}}export(){return B(this,null,function*(){let{develops:i,Picture:e,pst:{outImage:l,frame:t}}=this,a=l.w/e.elm.width,h=l.h/e.elm.height,s=(t.x-l.x)/a,c=(t.x-l.x+t.w)/a,o=(t.y-l.y)/h,r=(t.y-l.y+t.h)/h,n=Array.from({length:i.length}),d="image/jpeg";for(let g=0;g<i.length;g++){let{size:C,maxSize:x}=i[g];x=x||{S:1024*20,R:1024*100,L:1024*350}[C];let S={S:144,R:576,L:1152}[C],m=S;this.use=="wallpaper.horizontal"?m=S/3*2:this.use=="wallpaper.vertical"&&(m=S*2);let u=document.createElement("canvas");u.width=S,u.height=m;let v=u.getContext("2d");if(!v)return;v.clearRect(0,0,S,m),v.drawImage(this.Picture.elm,s,o,c-s,r-o,0,0,S,m);let w=u.toDataURL(d),E=yield w.toBlob(d);if(!E)return;if(E.size>=x){let F=x/E.size;if(w=u.toDataURL(d,F*.92),E=yield w.toBlob(d),!E)return}let U=new File([E],this.val_file.name,{type:d});n[g]=U}return n})}}const G={Core:f=>{let{val_file:i,options:e,finishedCallback:l,abortCallback:t}=f,{use:a,develops:h=[]}=e,[s]=z(b.uuid.gen(32));const c={scale:{default:125,min:100,max:300},rotate:0,grayScale:0,tone:0};let[o,r]=z(c.scale.default),[n,d]=z(c.rotate),[g,C]=z(c.grayScale),[x,S]=z(c.tone);return H(()=>{M.set({key:s,value:{}}),B(void 0,null,function*(){k.fn.corner.active();let{target:m}=yield i.read();if(!m)return;let u=m.result,v=j("#Canvas-"+s)[0];if(!v)return;let w=new ee({set_scale:r,val_file:i,develops:h,use:a,scale:c.scale,componentID:s,canvas:v,picture:{image:yield b.ImageLoader(u),grayScale:c.grayScale,tone:c.tone,rotate:c.rotate}});M.set({key:s,value:{Instance:w}});const E=function(I){if(I.preventDefault(),I.touches&&I.touches.length>1)w.pinchEffect({eventType:"start",event:I}),b(document).addEvent({eventType:"touchmove",eventID:"CropperEffectMove",options:{passive:!1},callback:R=>{R.preventDefault(),w.pinchEffect({eventType:"move",event:R})}}).addEvent({eventType:"touchend",eventID:"CropperEffectEnd",options:{passive:!1},callback:F});else{w.dragEffect(X({eventType:"start"},b.getCursor(I)));let{type:R}=I;b(document).addEvent({eventType:R=="touchstart"?"touchmove":"mousemove",eventID:"CropperEffectMove",options:{passive:!1},callback:_=>{U("move",_)}}).addEvent({eventType:R=="touchstart"?"touchend":"mouseup",eventID:"CropperEffectEnd",options:{passive:!1},callback:_=>{U("end",_),F(_)}})}},U=function(I,R){R.preventDefault(),w.dragEffect(X({eventType:I},b.getCursor(R)))},F=function(I){I.preventDefault(),b(document).removeEvent(["CropperEffectMove","CropperEffectEnd"])};b(v).removeEvent(["CropperMouseWheel","CropperTouchStart","CropperMouseDown"]).addEvent({eventID:"CropperMouseWheel",eventType:"wheel",callback:I=>{I.preventDefault();let R=Number(I.wheelDelta*.04),_=w.scale.current+R;_=Math.max(_,w.scale.min),_=Math.min(_,w.scale.max),r(_)},options:{passive:!1}}).addEvent({eventType:"touchstart",eventID:"CropperTouchStart",callback:E,options:{passive:!1}}).addEvent({eventType:"mousedown",eventID:"CropperMouseDown",callback:E,options:{passive:!1}}),setTimeout(()=>{k.fn.corner.stop()},1e3)})},[i.id]),H(()=>{var u;let m=(u=M.get(s))==null?void 0:u.Instance;m&&m.updateScale(o)},[o]),H(()=>{var u;let m=(u=M.get(s))==null?void 0:u.Instance;m&&m.updateFilter({grayScale:g,tone:x,rotate:n})},[g,x,n]),p(A.Comps.Body,{children:y(V,{className:[L("Wrap"),L("Use_"+a)].join(" "),flexWrap:!1,position:"relative",overflow:"hidden",borderRadius:"inherit",boxShadow:"3.remark",UnderBreakPointStyles:{flexType:"col"},children:[p(D,{flexGrid:3,UnderBreakPointStyles:{width:1,padding:2},children:p(D,{overflow:"hidden",position:"relative",backgroundColor:"layer.4",freeCSS:{zIndex:1},UnderBreakPointStyles:{borderRadius:"1.tone.primary"},children:p("canvas",{width:"2400",height:a=="wallpaper.horizontal"?"1800":a=="wallpaper.vertical"?"3200":"2400",className:L("Canvas"),id:"Canvas-"+s})})}),y(T,{gap:0,flexGrid:2,boxShadow:"3.remark",UnderBreakPointStyles:{width:1,maxWidth:"unset"},freeCSS:{maxWidth:12*28},children:[y(T,{gap:1,flexSizing:0,overflow:"auto",padding:1.5,UnderBreakPointStyles:{flexSizing:"none"},children:[p(D,{flexSizing:"none",fontSize:"4.thirdTitle",isSemiBoldFont:!0,children:"\u30D5\u30A3\u30EB\u30BF\u30FC"}),p(G.SettingRegion,{DefaultOptions:c,val_scale:o,set_scale:r,val_tone:x,set_tone:S,val_grayScale:g,set_grayScale:C,val_rotate:n,set_rotate:d})]}),y(V,{padding:1.5,flexSizing:"none",gap:1,borderTop:!0,children:[p(Y.Button.Border.R,{onClick:()=>{t()},children:"\u30AD\u30E3\u30F3\u30BB\u30EB"}),p(Y.Button.Prime.R,{flexSizing:0,onClick:()=>B(void 0,null,function*(){var v;let m=(v=M.get(s))==null?void 0:v.Instance;if(!m)return;k.fn.mini.active("CropperExportation");let u=yield m.export();setTimeout(()=>{k.fn.mini.stop("CropperExportation"),l(u)},3e3)}),children:y(q.Center,{gap:"1/2",children:[p(k.White.R,{loaderID:"CropperExportation"}),"\u6C7A\u5B9A"]})})]})]})]})})},SettingRegion:f=>{let i=[];for(let e=1;e<=10;e++)i.push({value:e,label:y($,{children:[p(D,{className:[L("ToneBall"),L("ToneBall_"+e)].join(" ")}),p(D,{textAlign:"center",flexSizing:"auto",children:["","\u6696\u8272","\u5BD2\u8272","\u30BB\u30D4\u30A2","\u30B7\u30A2\u30F3","\u30DE\u30BC\u30F3\u30BF","\u30A4\u30A8\u30ED\u30FC","\u30AA\u30EA\u30B8\u30CA\u30EB1","\u30AA\u30EA\u30B8\u30CA\u30EB2","\u30AA\u30EA\u30B8\u30CA\u30EB3","\u30AA\u30EA\u30B8\u30CA\u30EB4"][e]})]})});return y($,{children:[y(T,{gap:"1/3",children:[y(D,{children:[p(P.Rotate,{fontSize:"3.paragraph",fontColor:"4.thin"})," Rotate"]}),y(q.Separate,{flexChilds:"even",paddingLeft:2,children:[y(Y.Button.Border.S,{onClick:()=>{let e=f.val_rotate-90;e<0&&(e+=360),f.set_rotate(e)},children:[p(P,{icon:J})," \u5DE6\u306B\u56DE\u8EE2"]}),y(Y.Button.Border.S,{onClick:()=>{f.set_rotate((f.val_rotate+90)%360)},children:["\u53F3\u306B\u56DE\u8EE2 ",p(P,{icon:Q})]})]})]}),y(T,{gap:"1/3",children:[y(D,{children:[p(P.Search,{fontSize:"3.paragraph",fontColor:"4.thin"})," Zoom"]}),p(D,{paddingLeft:2,children:p(W.Slider,{override:"force",value:f.val_scale-100,min:f.DefaultOptions.scale.min-100,max:f.DefaultOptions.scale.max-100,step:25,onUpdateValidValue:({eventType:e,value:l})=>{b.interval.clear("Cropper.UpdateScale"),b.interval.standBy("Cropper.UpdateScale",400,()=>{f.set_scale(l+100)})},legends:{enable:!0,custom:e=>"x"+Math.round(100+e)/100}})})]}),y(T,{gap:"1/3",children:[y(D,{children:[p(P,{icon:K,fontSize:"3.paragraph",fontColor:"4.thin"})," Gray Scale"]}),p(D,{paddingLeft:2,children:p(W.Slider,{value:f.val_grayScale,min:0,max:100,step:10,onUpdateValidValue:({value:e})=>{b.interval.clear("Cropper.GrayScale"),b.interval.standBy("Cropper.GrayScale",400,()=>{f.set_grayScale(e)})},legends:{enable:!0,custom:e=>e+"%"}})})]}),y(T,{gap:"1/3",children:[y(D,{children:[p(P,{icon:Z,fontSize:"3.paragraph",fontColor:"4.thin"})," Tone"]}),p(D,{paddingLeft:2,children:p(W.Radio,{value:f.val_tone,gap:"1/2",cellStyles:{isRounded:!0,borderWidth:2,borderColor:"1.thin",padding:"1/2",paddingRight:1,fontSize:"1.mini",gap:"1/3",flexSizing:"auto"},options:[{value:0,label:"\u306A\u3057",padding:["1/2",1],flexCenter:!0},...i],onUpdateValidValue:({value:e})=>{f.set_tone(e[0])}})})]})]})}},N={open:f=>B(void 0,null,function*(){let i=yield W.Filer.fn.openDialog({accept:"image",multiple:!1}),e="CropperImage";A.open({sheetID:e,type:"normal.middleCenter",size:"3L",freeCSS:{width:f.use=="wallpaper.horizontal"?12*100:12*80},content:p(G.Core,{val_file:i[0],options:f,finishedCallback:l=>{A.close(e),f.onProcessFinished(l)},abortCallback:()=>{A.close(e)}}),close_option:{escapeKeyDown:!1}})})};export{N as Cropper,N as default};
|
|
1
|
+
import{b as X,c as O,e as B}from"../chunk-VY3566IV.js";import{Fragment as $,jsx as p,jsxs as y}from"react/jsx-runtime";import b from"@mingoo/jsmin";import{$$fromRoot as j,useStore as M}from"../@utils";import{useState as z,useEffect as H}from"react";import V from"../atoms/Flex";import D from"../atoms/Box";import P from"../atoms/FAI";import T from"../mols/Column";import q from"../mols/Row";import Y from"./Button";import A from"./Sheet";import L from"./Loader";import W from"./Input";import{faPalette as K}from"@fortawesome/free-solid-svg-icons/faPalette";import{faBarsStaggered as Z}from"@fortawesome/free-solid-svg-icons/faBarsStaggered";import{faRotateLeft as J}from"@fortawesome/free-solid-svg-icons/faRotateLeft";import{faRotateRight as Q}from"@fortawesome/free-solid-svg-icons/faRotateRight";import{CropperClasses as U}from"../@styles/componentClasses";class ee{constructor(r){this.set_scale=r.set_scale,this.val_file=r.val_file,this.develops=r.develops,this.use=r.use,this.componentID=r.componentID,this.scale={current:r.scale.default,default:r.scale.default,min:r.scale.min,max:r.scale.max};let e=r.canvas,{width:l,height:t}=e,a=r.picture.image,{width:h,height:s}=a,c=h/s;this.Canvas={elm:e,ctx:e.getContext("2d")};let o=0,i=0;this.use=="square"?(o=e.width/3*2,i=e.height/3*2):this.use=="wallpaper.horizontal"?(o=e.width*(7/9),i=o/3):this.use=="wallpaper.vertical"&&(i=e.height*(7/9),o=i/2);let n=(e.width-o)/2,d=(e.height-i)/2,g=o/i;this.Picture={elm:a,originDataUrl:a.src,aspect:c,revisedAspect:g>c?o/h:i/s,rotate:r.picture.rotate,grayScale:r.picture.grayScale,tone:r.picture.tone},this.pst={frame:{x:n,y:d,w:o,h:i,aspect:g},outImage:{x:0,y:0,w:0,h:0},imageX:h/2,imageY:s/2,centerX:l/2,centerY:t/2},this.dragEffectInfo={origin:{x:0,y:0},frameExpandRate:{x:0,y:0}},this.pinchEffectInfo={origin:{x:0,y:0,scale:this.scale.current}},this.modifyImage()}dragEffect(r){let{eventType:e,x:l,y:t}=r;if(e=="start"){let a=this.Canvas.elm.position();this.dragEffectInfo={origin:{x:l,y:t},frameExpandRate:{x:this.Canvas.elm.width/a.width,y:this.Canvas.elm.height/a.height}}}else{let{origin:a,frameExpandRate:h}=this.dragEffectInfo,s=a.x-l,c=a.y-t,o=this.scale.current*this.Picture.revisedAspect/100,i=s/o*h.x,n=c/o*h.y;e=="move"?this.drawImage(this.pst.imageX+i,this.pst.imageY+n):e=="end"&&this.drawImage(this.pst.imageX+=i,this.pst.imageY+=n)}}pinchEffect(r){let{eventType:e,event:l}=r,{x:t,y:a}=b.getCursor(l.touches[0]),{x:h,y:s}=b.getCursor(l.touches[1]),c=h-t,o=s-a;if(e=="start")this.pinchEffectInfo.origin={x:c,y:o,scale:this.scale.current};else if(e=="move"){let{origin:i}=this.pinchEffectInfo,n=Math.sqrt(Math.pow(i.x,2)+Math.pow(i.y,2)),g=Math.sqrt(Math.pow(c,2)+Math.pow(o,2))/n,C=Number(i.scale*g);this.set_scale(C)}}updateScale(r){let e=r;e=Math.max(e,this.scale.min),e=Math.min(e,this.scale.max),this.scale.current=e,this.drawImage()}updateFilter(r){this.Picture.grayScale=r.grayScale,this.Picture.tone=r.tone,this.Picture.rotate=r.rotate,this.modifyImage()}modifyImage(){return B(this,null,function*(){let{grayScale:r,tone:e,rotate:l}=this.Picture;const t=document.createElement("canvas");let a=t.getContext("2d"),h=yield b.ImageLoader(this.Picture.originDataUrl),s=h.width,c=h.height;(l==90||l==270)&&(s=h.height,c=h.width),t.width=s,t.height=c,r&&(a.filter="grayscale("+r+"%)"),l&&(a.translate(s/2,c/2),a.rotate(l*Math.PI/180),[90,270].includes(l)?a.translate(-c/2,-s/2):a.translate(-s/2,-c/2)),a.drawImage(h,0,0,h.width,h.height);let o=a.getImageData(0,0,t.width,t.height),i=o.data;{r/=100;let C=[[255,255,255],[255,200,100],[170,170,255],[240,200,145],[128,255,255],[255,128,255],[255,255,128],[128,158,169],[128,112,162],[50,192,87],[246,100,140]][e],x=C[0]/255,S=C[1]/255,m=C[2]/255;for(let u=0;u<c;u++)for(let v=0;v<s;v++){var n=(u*s+v)*4;if(r){let w=.3*i[n]+.59*i[n+1]+.11*i[n+2];for(var d=0;d<3;d++){let E=i[n+d];i[n+d]=E+(w-E)*r}}i[n]*=x,i[n+1]*=S,i[n+2]*=m}}a.putImageData(o,0,0);let g=t.toDataURL("image/jpeg");{let C=yield b.ImageLoader(g),{width:x,height:S}=C,m=x/S;this.Picture=O(X({},this.Picture),{elm:C,aspect:m,revisedAspect:this.pst.frame.aspect>m?this.pst.frame.w/x:this.pst.frame.h/S})}this.drawImage()})}drawImage(r,e){let{use:l,Canvas:{ctx:t},pst:{frame:a}}=this,h=r||this.pst.imageX,s=e||this.pst.imageY;{let c=this.scale.current/100,o=this.Picture.revisedAspect*c,i=this.pst.centerX-h*o,n=this.pst.centerY-s*o,d=this.Picture.elm.width*o,g=this.Picture.elm.height*o;{let C=this.pst.frame.x+this.pst.frame.w-d,x=this.pst.frame.x,S=this.pst.frame.y+this.pst.frame.h-g,m=this.pst.frame.y,u=0;i<C&&(u=i-C),i>x&&(u=i-x);let v=0;n<S&&(v=n-S),n>m&&(v=n-m),this.dragEffectInfo.origin.x+=u/2/this.dragEffectInfo.frameExpandRate.x,this.dragEffectInfo.origin.y+=v/2/this.dragEffectInfo.frameExpandRate.y,i=Math.min(Math.max(i,C),x),n=Math.min(Math.max(n,S),m)}this.pst.outImage={x:i,y:n,w:d,h:g},t.clearRect(0,0,this.Canvas.elm.width,this.Canvas.elm.height),t.drawImage(this.Picture.elm,0,0,this.Picture.elm.width,this.Picture.elm.height,i,n,d,g)}{l=="square"?(t.fillStyle="rgba( 20,24,20,.3 )",t.beginPath(),t.arc(this.Canvas.elm.width/2,this.Canvas.elm.height/2,this.Canvas.elm.width,0,Math.PI*2,!0),t.arc(this.Canvas.elm.width/2,this.Canvas.elm.height/2,this.Canvas.elm.width/3*2/2,0,Math.PI*2,!1),t.closePath(),t.fill()):(l=="wallpaper.horizontal"||l=="wallpaper.vertical")&&(t.fillStyle="rgba( 20,24,20,.3 )"),t.beginPath(),t.moveTo(0,0),t.lineTo(this.Canvas.elm.width,0),t.lineTo(this.Canvas.elm.width,this.Canvas.elm.height),t.lineTo(0,this.Canvas.elm.height),t.lineTo(0,0),t.closePath(),t.lineTo(a.x,a.y),t.lineTo(a.x,a.y+a.h),t.lineTo(a.x+a.w,a.y+a.h),t.lineTo(a.x+a.w,a.y),t.lineTo(a.x,a.y),t.fill();let o=b(document.body).getStyleProperty("--color-theme-hsl");t.lineWidth=this.Canvas.elm.width/200,t.strokeStyle=`hsla( ${o},1 )`,t.strokeRect(a.x,a.y,a.w,a.h)}}export(){return B(this,null,function*(){let{develops:r,Picture:e,pst:{outImage:l,frame:t}}=this,a=l.w/e.elm.width,h=l.h/e.elm.height,s=(t.x-l.x)/a,c=(t.x-l.x+t.w)/a,o=(t.y-l.y)/h,i=(t.y-l.y+t.h)/h,n=Array.from({length:r.length}),d="image/jpeg";for(let g=0;g<r.length;g++){let{size:C,maxSize:x}=r[g];x=x||{S:1024*20,R:1024*100,L:1024*350}[C];let S={S:144,R:576,L:1152}[C],m=S;this.use=="wallpaper.horizontal"?m=S/3*2:this.use=="wallpaper.vertical"&&(m=S*2);let u=document.createElement("canvas");u.width=S,u.height=m;let v=u.getContext("2d");if(!v)return;v.clearRect(0,0,S,m),v.drawImage(this.Picture.elm,s,o,c-s,i-o,0,0,S,m);let w=u.toDataURL(d),E=yield w.toBlob(d);if(!E)return;if(E.size>=x){let F=x/E.size;if(w=u.toDataURL(d,F*.92),E=yield w.toBlob(d),!E)return}let k=new File([E],this.val_file.name,{type:d});n[g]=k}return n})}}const G={Core:f=>{let{val_file:r,options:e,finishedCallback:l,abortCallback:t}=f,{use:a,develops:h=[]}=e,[s]=z(b.uuid.gen(32));const c={scale:{default:125,min:100,max:300},rotate:0,grayScale:0,tone:0};let[o,i]=z(c.scale.default),[n,d]=z(c.rotate),[g,C]=z(c.grayScale),[x,S]=z(c.tone);return H(()=>{M.set({[s]:{}}),B(void 0,null,function*(){L.fn.corner.active();let{target:m}=yield r.read();if(!m)return;let u=m.result,v=j("#Canvas-"+s)[0];if(!v)return;let w=new ee({set_scale:i,val_file:r,develops:h,use:a,scale:c.scale,componentID:s,canvas:v,picture:{image:yield b.ImageLoader(u),grayScale:c.grayScale,tone:c.tone,rotate:c.rotate}});M.set({[s]:{Instance:w}});const E=function(I){if(I.preventDefault(),I.touches&&I.touches.length>1)w.pinchEffect({eventType:"start",event:I}),b(document).addEvent({eventType:"touchmove",eventID:"CropperEffectMove",options:{passive:!1},callback:R=>{R.preventDefault(),w.pinchEffect({eventType:"move",event:R})}}).addEvent({eventType:"touchend",eventID:"CropperEffectEnd",options:{passive:!1},callback:F});else{w.dragEffect(X({eventType:"start"},b.getCursor(I)));let{type:R}=I;b(document).addEvent({eventType:R=="touchstart"?"touchmove":"mousemove",eventID:"CropperEffectMove",options:{passive:!1},callback:_=>{k("move",_)}}).addEvent({eventType:R=="touchstart"?"touchend":"mouseup",eventID:"CropperEffectEnd",options:{passive:!1},callback:_=>{k("end",_),F(_)}})}},k=function(I,R){R.preventDefault(),w.dragEffect(X({eventType:I},b.getCursor(R)))},F=function(I){I.preventDefault(),b(document).removeEvent(["CropperEffectMove","CropperEffectEnd"])};b(v).removeEvent(["CropperMouseWheel","CropperTouchStart","CropperMouseDown"]).addEvent({eventID:"CropperMouseWheel",eventType:"wheel",callback:I=>{I.preventDefault();let R=Number(I.wheelDelta*.04),_=w.scale.current+R;_=Math.max(_,w.scale.min),_=Math.min(_,w.scale.max),i(_)},options:{passive:!1}}).addEvent({eventType:"touchstart",eventID:"CropperTouchStart",callback:E,options:{passive:!1}}).addEvent({eventType:"mousedown",eventID:"CropperMouseDown",callback:E,options:{passive:!1}}),setTimeout(()=>{L.fn.corner.stop()},1e3)})},[r.id]),H(()=>{var u;let m=(u=M.get(s))==null?void 0:u.Instance;m&&m.updateScale(o)},[o]),H(()=>{var u;let m=(u=M.get(s))==null?void 0:u.Instance;m&&m.updateFilter({grayScale:g,tone:x,rotate:n})},[g,x,n]),p(A.Comps.Body,{children:y(V,{className:[U("Wrap"),U("Use_"+a)].join(" "),flexWrap:!1,position:"relative",overflow:"hidden",borderRadius:"inherit",boxShadow:"3.remark",UnderBreakPointStyles:{flexType:"col"},children:[p(D,{flexGrid:3,UnderBreakPointStyles:{width:1,padding:2},children:p(D,{overflow:"hidden",position:"relative",backgroundColor:"layer.4",freeCSS:{zIndex:1},UnderBreakPointStyles:{borderRadius:"1.tone.primary"},children:p("canvas",{width:"2400",height:a=="wallpaper.horizontal"?"1800":a=="wallpaper.vertical"?"3200":"2400",className:U("Canvas"),id:"Canvas-"+s})})}),y(T,{gap:0,flexGrid:2,boxShadow:"3.remark",UnderBreakPointStyles:{width:1,maxWidth:"unset"},freeCSS:{maxWidth:12*28},children:[y(T,{gap:1,flexSizing:0,overflow:"auto",padding:1.5,UnderBreakPointStyles:{flexSizing:"none"},children:[p(D,{flexSizing:"none",fontSize:"4.thirdTitle",isSemiBoldFont:!0,children:"\u30D5\u30A3\u30EB\u30BF\u30FC"}),p(G.SettingRegion,{DefaultOptions:c,val_scale:o,set_scale:i,val_tone:x,set_tone:S,val_grayScale:g,set_grayScale:C,val_rotate:n,set_rotate:d})]}),y(V,{padding:1.5,flexSizing:"none",gap:1,borderTop:!0,children:[p(Y.Button.Border.R,{onClick:()=>{t()},children:"\u30AD\u30E3\u30F3\u30BB\u30EB"}),p(Y.Button.Prime.R,{flexSizing:0,onClick:()=>B(void 0,null,function*(){var v;let m=(v=M.get(s))==null?void 0:v.Instance;if(!m)return;L.fn.mini.active("CropperExportation");let u=yield m.export();setTimeout(()=>{L.fn.mini.stop("CropperExportation"),l(u)},3e3)}),children:y(q.Center,{gap:"1/2",children:[p(L.White.R,{loaderID:"CropperExportation"}),"\u6C7A\u5B9A"]})})]})]})]})})},SettingRegion:f=>{let r=[];for(let e=1;e<=10;e++)r.push({value:e,label:y($,{children:[p(D,{className:[U("ToneBall"),U("ToneBall_"+e)].join(" ")}),p(D,{textAlign:"center",flexSizing:"auto",children:["","\u6696\u8272","\u5BD2\u8272","\u30BB\u30D4\u30A2","\u30B7\u30A2\u30F3","\u30DE\u30BC\u30F3\u30BF","\u30A4\u30A8\u30ED\u30FC","\u30AA\u30EA\u30B8\u30CA\u30EB1","\u30AA\u30EA\u30B8\u30CA\u30EB2","\u30AA\u30EA\u30B8\u30CA\u30EB3","\u30AA\u30EA\u30B8\u30CA\u30EB4"][e]})]})});return y($,{children:[y(T,{gap:"1/3",children:[y(D,{children:[p(P.Rotate,{fontSize:"3.paragraph",fontColor:"4.thin"})," Rotate"]}),y(q.Separate,{flexChilds:"even",paddingLeft:2,children:[y(Y.Button.Border.S,{onClick:()=>{let e=f.val_rotate-90;e<0&&(e+=360),f.set_rotate(e)},children:[p(P,{icon:J})," \u5DE6\u306B\u56DE\u8EE2"]}),y(Y.Button.Border.S,{onClick:()=>{f.set_rotate((f.val_rotate+90)%360)},children:["\u53F3\u306B\u56DE\u8EE2 ",p(P,{icon:Q})]})]})]}),y(T,{gap:"1/3",children:[y(D,{children:[p(P.Search,{fontSize:"3.paragraph",fontColor:"4.thin"})," Zoom"]}),p(D,{paddingLeft:2,children:p(W.Slider,{override:"force",value:f.val_scale-100,min:f.DefaultOptions.scale.min-100,max:f.DefaultOptions.scale.max-100,step:25,onUpdateValidValue:({eventType:e,value:l})=>{b.interval.clear("Cropper.UpdateScale"),b.interval.standBy("Cropper.UpdateScale",400,()=>{f.set_scale(l+100)})},legends:{enable:!0,custom:e=>"x"+Math.round(100+e)/100}})})]}),y(T,{gap:"1/3",children:[y(D,{children:[p(P,{icon:K,fontSize:"3.paragraph",fontColor:"4.thin"})," Gray Scale"]}),p(D,{paddingLeft:2,children:p(W.Slider,{value:f.val_grayScale,min:0,max:100,step:10,onUpdateValidValue:({value:e})=>{b.interval.clear("Cropper.GrayScale"),b.interval.standBy("Cropper.GrayScale",400,()=>{f.set_grayScale(e)})},legends:{enable:!0,custom:e=>e+"%"}})})]}),y(T,{gap:"1/3",children:[y(D,{children:[p(P,{icon:Z,fontSize:"3.paragraph",fontColor:"4.thin"})," Tone"]}),p(D,{paddingLeft:2,children:p(W.Radio,{value:f.val_tone,gap:"1/2",cellStyles:{isRounded:!0,borderWidth:2,borderColor:"1.thin",padding:"1/2",paddingRight:1,fontSize:"1.mini",gap:"1/3",flexSizing:"auto"},options:[{value:0,label:"\u306A\u3057",padding:["1/2",1],flexCenter:!0},...r],onUpdateValidValue:({value:e})=>{f.set_tone(e[0])}})})]})]})}},N={open:f=>B(void 0,null,function*(){let r=yield W.Filer.fn.openDialog({accept:"image",multiple:!1}),e="CropperImage";A.open({sheetID:e,type:"normal.middleCenter",size:"3L",freeCSS:{width:f.use=="wallpaper.horizontal"?12*100:12*80},content:p(G.Core,{val_file:r[0],options:f,finishedCallback:l=>{A.close(e),f.onProcessFinished(l)},abortCallback:()=>{A.close(e)}}),close_option:{escapeKeyDown:!1}})})};export{N as Cropper,N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-VY3566IV.js";import t from"@mingoo/jsmin";import{Config as
|
|
1
|
+
import"../../chunk-VY3566IV.js";import t from"@mingoo/jsmin";import{Config as a}from"../../@utils";import{EffectClasses as e}from"../../@styles/componentClasses";const d={Wrapper:()=>(typeof window=="undefined"||t(a.get().appRoot).addEvent({eventType:"click",eventID:"PuddingClick",target:".eff_pudding",callback:function(n){t(n.target).removeClass(e("PuddingEffect")).await(1).addClass(e("PuddingEffect")).await(510).removeClass(e("PuddingEffect"))}}),null)};export{d as Pudding,d as default};
|
package/dist/fn/Effect/Ripple.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import"../../chunk-VY3566IV.js";import e from"@mingoo/jsmin";import{Config as u}from"../../@utils";import{EffectClasses as
|
|
2
|
-
<div class="${
|
|
3
|
-
</div>`).addEvent({eventID:"RippleMouseOut",eventType:"mouseout",callback:
|
|
1
|
+
import"../../chunk-VY3566IV.js";import e from"@mingoo/jsmin";import{Config as u}from"../../@utils";import{EffectClasses as n}from"../../@styles/componentClasses";let f="eff_ripple";const i={Start:t=>{let l=e.Time().ms,o=t.target,p=e(o);if(!p[0])return;let s=p.findClass(/^eff_ripple-/)[0];if(!s)return;let r=s.split("-")[1],a="RippleWrap-"+e.uuid.gen(),{left:d,top:E,height:I,width:R}=p.position(),{pageXOffset:h,pageYOffset:T}=e.getScreenSize(),{x:g,y}=e.getCursor(t),c=Math.min(R*1.5,300),M=Math.max(g-(d+h),0),C=Math.max(y-(E+T),0),m={RippleElement:p,startedAt:l,size:c};e(document).addEvent({eventID:"RippleMouseUp",eventType:"mouseup",callback:()=>{i.End(m)}}).addEvent({eventID:"RippleTouchEnd",eventType:"touchend",callback:()=>{setTimeout(()=>{i.End(m)},20)}}),e(p).addClass([n("RippleElement"),n("Color_"+r)]).append(`<div class="${n("RippleWrap")}" id="${a}">
|
|
2
|
+
<div class="${n("Wave")}" />
|
|
3
|
+
</div>`).addEvent({eventID:"RippleMouseOut",eventType:"mouseout",callback:w=>{i.End(m)}}).find("#"+a).find("."+n("Wave")).css({left:M,top:C}).await(10).css({height:c,width:c,opacity:".3",transition:".25s"})},End:t=>{let{RippleElement:l,startedAt:o,size:p}=t,r=e.Time().ms-o<=400?".75s":".55s",a=p*2.5;e(document).removeEvent(["RippleMouseUp","RippleTouchMove","RippleTouchEnd","RippleMouseOut"]),l.removeEvent(["RippleMouseOut"]).find("."+n("Wave")).css({height:a,width:a,opacity:"0",transition:r}).await(750).parent().callback(d=>{d.remove()})}},v={Wrapper:()=>(typeof window=="undefined"||e(u.get().appRoot).addEvent({eventType:"touchstart",eventID:"RippleTouchStart",target:"."+f,callback:t=>{i.Start(t)}}).addEvent({eventType:"mousedown",eventID:"RippleMouseDown",target:"."+f,callback:t=>{u.get().isTouchDevice||i.Start(t)}}),null)};export{v as Ripple,v as default};
|
|
@@ -2,5 +2,5 @@ import TextArea from './TextArea';
|
|
|
2
2
|
declare namespace AutoHeightText {
|
|
3
3
|
type Input = TextArea.Input;
|
|
4
4
|
}
|
|
5
|
-
declare const AutoHeightText: (
|
|
5
|
+
declare const AutoHeightText: (p: TextArea.Input) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export { AutoHeightText, AutoHeightText as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t,c as
|
|
1
|
+
import{b as t,c as l,e as d}from"../../chunk-VY3566IV.js";import{jsx as g,jsxs as z}from"react/jsx-runtime";import n from"@mingoo/jsmin";import{useEffect as I,useState as s}from"react";import y from"./TextArea";import w from"../../mols/Text";import{BoxWrapper as H}from"./core";import{InputAutoHeightClasses as f}from"../../@styles/componentClasses";const m=e=>{let[a]=s(n.uuid.gen()),[o,h]=s(String(e.value||""));I(()=>{n.scope(()=>d(void 0,null,function*(){let i=n('[data-id="origin_'+a+'"]')[0],r=n('[data-id="shallow_'+a+'"]')[0];if(!i||!r)return;let p=r.getClientRects()[0];if(!p)return;let{width:D,height:_}=p;i.style.height=_+"px"}))},[o]);let S={componentID:e.componentID,dataValue:e.value,eventType:"init",eventID:n.uuid.gen()},[c,x]=s(S),[v,A]=s({ok:!1,notice:[]}),T=!!o.match(/\n$/),u=o||e.placeholder;return T&&(u+="d"),z(H,{val_status:c,set_status:x,val_validate:v,states:e,children:[g(w.Description,l(t({padding:1,fontSize:"inherit",flexSizing:0,minHeight:1},e),{className:[e.className,f("Shallow")].join(" "),id:"shallow_"+a,position:"absolute",left:0,right:0,top:0,border:"0.trans",opacity:"trans",freeCSS:l(t({minHeight:16*2,resize:"none"},e.freeCSS),{color:"transparent",zIndex:3,pointerEvents:"none",lineHeight:"1.25",letterSpacing:"1px"}),"data-id":"shallow_"+a,children:u})),g(y,l(t({padding:1,fontSize:"inherit",overflow:"hidden",flexSizing:0},e),{wrapStyles:t({flexSizing:0},e.wrapStyles),className:[e.className,f("Origin")].join(" "),freeCSS:l(t({minHeight:16*1,resize:"none"},e.freeCSS),{lineHeight:"1.25",letterSpacing:"1px"}),value:o,"data-id":"origin_"+a,onUpdateValue:i=>{let r=i.value;h(r),e.onUpdateValue&&e.onUpdateValue(i)}}))]})};export{m as AutoHeightText,m as default};
|
|
@@ -7,11 +7,11 @@ declare namespace Checker {
|
|
|
7
7
|
tabIndex?: number;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
value?: boolean;
|
|
10
|
-
cellStyles?: TagProperty.
|
|
10
|
+
cellStyles?: TagProperty.States;
|
|
11
11
|
cellClassName?: string;
|
|
12
|
-
cellCheckedStyles?: TagProperty.
|
|
12
|
+
cellCheckedStyles?: TagProperty.States;
|
|
13
13
|
cellCheckedClassName?: string;
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
declare const Checker: (
|
|
16
|
+
declare const Checker: (p: Checker.Input) => import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
export { Checker, Checker as default };
|
package/dist/fn/Input/Checker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as l,c as t}from"../../chunk-VY3566IV.js";import{jsx as
|
|
1
|
+
import{b as l,c as t}from"../../chunk-VY3566IV.js";import{jsx as c}from"react/jsx-runtime";import r from"./List";const n=e=>(e=l({},e),c(r.Plain,t(l({},e),{tone:"plain",icon:!0,type:"checker",iconType:"checkbox",value:e.value?!0:null,cellStyles:l({padding:0},e.cellStyles),options:[{value:!0,label:e.label}],onUpdateValidValue:a=>{let o=!!a.value[0];e.onUpdateValidValue&&e.onUpdateValidValue(t(l({},a),{value:o}))}})));export{n as Checker,n as default};
|
|
@@ -9,7 +9,7 @@ declare namespace Selector {
|
|
|
9
9
|
limit?: number;
|
|
10
10
|
selected: Types.ChipsOptions[];
|
|
11
11
|
SelectorCellComponent: Types.SelectorCellComponentInput;
|
|
12
|
-
onUpdated(
|
|
12
|
+
onUpdated(p: {
|
|
13
13
|
values: any[];
|
|
14
14
|
}): void;
|
|
15
15
|
onDynamicSearch?: Types.onDynamicSearch;
|
|
@@ -27,14 +27,14 @@ declare namespace Selector {
|
|
|
27
27
|
options: Types.ChipsOptions[];
|
|
28
28
|
}>;
|
|
29
29
|
};
|
|
30
|
-
onUpdated(
|
|
30
|
+
onUpdated(p: {
|
|
31
31
|
values: any[];
|
|
32
32
|
}): void;
|
|
33
33
|
onClosed(): void;
|
|
34
34
|
SelectorCellComponent?: Types.SelectorCellComponentInput;
|
|
35
35
|
};
|
|
36
36
|
type Methods = {
|
|
37
|
-
openSelector(
|
|
37
|
+
openSelector(p: OpenSelectorInput): void;
|
|
38
38
|
closeSelector(selectorID: string): void;
|
|
39
39
|
updateOptions(selectorID: string, options: Types.ChipsOptions[]): void;
|
|
40
40
|
updateSelected(selectorID: string, selected: Types.ChipsOptions[]): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as E,c as J,d as W,e as K}from"../../../chunk-VY3566IV.js";import{Fragment as j,jsx as n,jsxs as O}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{b as E,c as J,d as W,e as K}from"../../../chunk-VY3566IV.js";import{Fragment as j,jsx as n,jsxs as O}from"react/jsx-runtime";import{useState as v,useEffect as R,useRef as L}from"react";import w from"@mingoo/jsmin";import{$$fromRoot as U,useStore as P}from"../../../@utils";import $ from"../../../atoms/Box";import _ from"../../../atoms/FAI";import z from"../../../atoms/Span";import H from"../../../mols/Column";import b from"../../../mols/Row";import V from"../../Button";import k from"../../Sheet";import G from"../../Loader";import Q from"../Text";import X from"../Parts";import{InputChipsClasses as Y}from"../../../@styles/componentClasses";const Z=e=>{let[h,i]=v("show"),[y,N]=v(""),[u]=v(w.uuid.gen()),[l,g]=v(e.options),[o,C]=v(l[0]||null),[S,x]=v(e.selected),[D,T]=v("init");R(()=>{P.set({[e.selectorID]:{updateOptions:t=>{g(t)},updateSelected:t=>{x(t)}}})},[]);const B=L(!1);R(()=>{B.current?k.reposition(e.selectorID):B.current=!0},[l]);const F=L(!1);R(()=>{F.current?(i("interlude"),C(l[0]||null),e.onDynamicSearch?(w.interval.clear(u+"-dynamicSearch"),w.interval.standBy(u+"-dynamicSearch",400,()=>K(void 0,null,function*(){let{options:t}=yield e.onDynamicSearch(y);g(t),i("show")}))):(w.interval.clear(u+"-staticSearch"),w.interval.standBy(u+"-staticSearch",400,()=>K(void 0,null,function*(){let t=new RegExp(y,"ig"),a=[];[...e.options].forEach(p=>{var c;!!(!y||((c=String(p.label))!=null?c:String(p.value)).match(t))&&a.push(p)}),g(a),i("show")})))):F.current=!0},[y]);const M=L(!1);R(()=>{M.current?e.onUpdated({values:S}):M.current=!0},[S]),R(()=>{w.scope(()=>{if(w.is.nullish(o)||D=="MouseEvent")return;let t=U("#"+u+"-Selector-Cell-Wrap");if(!t[0])return;let a=U('[data-chips-selector-cell="'+u+"-"+JSON.stringify((o==null?void 0:o.value)||"").replace(/\"/ig,"")+'"]');if(!a[0])return;let{top:p,height:I}=t.position(),{top:c,height:d}=a.position();if(p<=c&&c+d<=p+I)return;let r=t[0].scrollTop+(c-p);D=="ArrowDown"?r-=I-d-20:D=="ArrowUp"&&(r-=20),t[0].scrollTop=r})},[o]);let A=[];return h=="interlude"?A=[O(b.Center,{padding:2,gap:0,children:[n(G.Theme.R,{showInitial:!0}),n($,{padding:[0,1],fontSize:"1.mini",fontColor:"4.thin",children:"\u691C\u7D22\u4E2D..."})]})]:A=[l.map((t,a)=>{let{value:p,label:I}=t,c=String(JSON.stringify(p)),d=S.findIndex(f=>JSON.stringify(f.value)==c),r=d!=-1,s=JSON.stringify((o==null?void 0:o.value)||"")==c,m={};return(r||s)&&(m={fontColor:"theme",isSemiBoldFont:!0}),s&&(m.backgroundColor="cloud"),r&&(m.backgroundColor="theme.opa.few"),n(V.Button.Clear.R,J(E({borderRadius:"3.tone.tertiary",color:"cloud",padding:"1/3",tabIndex:-1,textAlign:"left","data-chips-selector-cell":u+"-"+c.replace(/\"/ig,""),isActive:r||s,isActiveStyles:m},m),{onMouseOver:()=>{T("MouseEvent"),C(t)},onClick:()=>{let f=[...S];r?f.splice(d,1):(f=[...f,t],e.limit&&f.length>e.limit&&f.shift()),x(f)},children:n(e.SelectorCellComponent,{isSelected:r,isFocused:s,value:p,label:I})}),a)})],O(j,{children:[O(H,{padding:"2/3",gap:"2/3",borderBottom:!0,children:[O(b.Separate,{children:[n(Q.Normal,{value:y,onUpdateValidValue:({value:t})=>{N(t)},id:e.selectorID+"-KeywordInput",padding:"2/3",placeholder:"\u691C\u7D22...",leftIcon:n(X.LeftIcon,{right:"2/3",fontSize:"1.mini",fontColor:"3.blur",children:n(_.Search,{})}),onKeyDown:t=>{let{key:a,metaKey:p,ctrlKey:I}=t,c=p||I;if(["ArrowDown","ArrowUp"].includes(a)){let d=+(a=="ArrowDown")*2-1;if(c){let r=l[d==1?l.length-1:0];C(r)}else{let r=l.findIndex(s=>JSON.stringify(s.value)==JSON.stringify((o==null?void 0:o.value)||""))+d;l[r]?C(l[r]):C(l[d==1?0:l.length-1]||null)}}else if(a=="Enter"){let d=S.findIndex(m=>JSON.stringify(m.value)==JSON.stringify((o==null?void 0:o.value)||"")),r=d!=-1,s=[...S];if(r)s.splice(d,1);else{let m=l.findIndex(f=>JSON.stringify(f.value)==JSON.stringify((o==null?void 0:o.value)||""));if(m==-1)return;s=[...s,l[m]],e.limit&&s.length>e.limit&&s.shift()}x(s)}T(a)}}),n(V.Button.Border.S,{marginRight:"1/3",ssSphere:2,backgroundColor:"cloud",borderRadius:"2.tone.secondary",onClick:()=>{k.close(e.selectorID)},children:n(_.Times,{})})]}),O(b.Separate,{children:[O(b.Left,{gap:"1/2",verticalAlign:"baseline",children:[n(z,{fontColor:"theme",children:l.length}),n($,{fontSize:"1.mini",fontColor:"3.blur",children:"\u4EF6\u306E\u30D2\u30C3\u30C8"})]}),n(b.Right,{children:!!e.limit&&O(z,{fontColor:"3.blur",fontSize:"1.mini",children:[n(z,{fontSize:"3.paragraph",fontColor:"theme",isSemiBoldFont:!0,children:S.length})," / ",e.limit," \u4EF6"]})})]})]}),n(H,{gap:"1/4",padding:"1/2",overflow:"auto",freeCSS:{maxHeight:12*26,maxWidth:12*26},id:u+"-Selector-Cell-Wrap",className:Y("SelectorWrapper"),children:A}),e.bottomContent]})},q={openSelector:e=>{let T=e,{selectorID:h,options:i,selected:y,limit:N,bottomContent:u,onDynamicSearch:l,SelectorCellComponent:g,onUpdated:o,onClosed:C,parent:S}=T,x=W(T,["selectorID","options","selected","limit","bottomContent","onDynamicSearch","SelectorCellComponent","onUpdated","onClosed","parent"]),D=h;g=g||(B=>n(b.Left,{children:B.label})),k.open(J(E({parent:S,sheetID:D,type:"custom",gravityPoint:22,padding:[1,0],hold_state:!0,close_option:{aroundClick:!0,escapeKeyDown:!0}},x),{content:n($,{borderRadius:"2.tone.secondary",backgroundColor:"layer.1",border:!0,boxShadow:"1.normal",overflow:"hidden",children:n(Z,{selectorID:h,options:i,limit:N,selected:y,onUpdated:o,SelectorCellComponent:g,bottomContent:u,onDynamicSearch:l},JSON.stringify(y))}),openAfter:()=>{U("#"+e.selectorID+"-KeywordInput").focus()},closeAfter:()=>{C()}}))},closeSelector:e=>{k.close(e)},updateOptions:(e,h)=>{let i=P.get(e);i&&i.updateOptions&&i.updateOptions(h)},updateSelected:(e,h)=>{let i=P.get(e);i&&i.updateSelected&&i.updateSelected(h)}};export{q as Selector,q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as r,c as h,d as
|
|
1
|
+
import{b as r,c as h,d as K}from"../../../chunk-VY3566IV.js";import{jsx as a,jsxs as b}from"react/jsx-runtime";import{useState as v,useEffect as L,useRef as H}from"react";import B from"@mingoo/jsmin";import{$$fromRoot as T}from"../../../@utils";import Q from"../../../atoms/Box";import N from"../../../atoms/FAI";import X from"../../../mols/Row";import U from"../../Button";import Y from"../../Sheet";import{Wrapper as Z,BoxWrapper as j,CommonEffects as ee,DefaultStyles as te}from"../core";import ne from"../Hidden";import W from"./Selector";function oe(e){let{value:s,states:u}=e,{required:o}=u,c=[];return o&&!s.length&&c.push({type:"invalid",label:"\u4E00\u3064\u4EE5\u4E0A\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044"}),{ok:!c.filter(({type:f})=>f=="invalid").length,notice:c}}const le=e=>{let w=e,{required:s,form:u,name:o,checkValidationAtFirst:c,onValidate:f,onUpdateValue:O,onUpdateValidValue:M,value:F=[],limit:A,leftIndicator:ie,rightIndicator:pe,leftIcon:re,rightIcon:se,SelectedCellComponent:g,AddButtonComponent:x,componentID:ue,defaultOptions:ce,enableFormSubmit:de,onDynamicSearch:me}=w,q=K(w,["required","form","name","checkValidationAtFirst","onValidate","onUpdateValue","onUpdateValidValue","value","limit","leftIndicator","rightIndicator","leftIcon","rightIcon","SelectedCellComponent","AddButtonComponent","componentID","defaultOptions","enableFormSubmit","onDynamicSearch"]);x=x;let[p]=v(B.uuid.gen()),[d,R]=v({componentID:e.componentID||"",dataValue:F.map(t=>t),eventID:B.uuid.gen(),eventType:"init"}),[D,z]=v({ok:!1,notice:[]}),[n,G]=v([...F]);ee({states:e,val_status:d,set_status:R,val_validate:D,set_validate:z,DefaultValidation:oe,onUpdateValue:O,onUpdateValidValue:M,ExtraOverrideStates:{formatValue:n,dataValue:n.map(t=>t)},ExtraStoreStates:{searchTimer:null}});const C=t=>{G(t),R(h(r({},d),{dataValue:t.map(i=>i),eventID:B.uuid.gen(),eventType:"update"}))};let E=`[data-chips-input-wrapper="${p}"]`;const y=()=>{W.openSelector({parent:E,gravityPoint:e.selectorGravityPoint,SelectorCellComponent:e.SelectorCellComponent,selectorID:p,options:e.defaultOptions||[],selected:n,limit:e.limit,onDynamicSearch:e.onDynamicSearch,onUpdated:t=>{C(t.values)},onClosed:()=>{T(E).focus()}})};let S=A&&A<=n.length;const _=H(!1);L(()=>{_.current?S&&(Y.close(p),T(`[data-chips-input-wrapper="${p}"]`).focus()):_.current=!0},[n]);let J=n.map(t=>{let{value:i,label:k}=t;g=g;const I=()=>{let l=n.findIndex(P=>P.value==i);if(l==-1)return;let m=[...n];m.splice(l,1),C(m),m.length||setTimeout(()=>{T(`[data-chips-input-wrapper="${p}"]`).focus()},200)};return a(g,{value:i,label:k,removeCallback:I,defaultRemoveButton:a(U.Button.Sub.S,{flexSizing:"none",color:"cloud",backgroundColor:"cloud",flexCenter:!0,isRounded:!0,freeCSS:{aspectRatio:"1/1"},onClick:()=>{I()},children:a(N.Times,{})}),openCallback:()=>{y()}},JSON.stringify(i))});return b(j,{val_status:d,set_status:R,val_validate:D,states:e,children:[a(ne,{"data-value":JSON.stringify(d.dataValue.map(t=>t.value)),name:o,form:u,"data-input-type":"chips-"+["single","multi"][+(e.limit!=1)],"data-validation":D.ok,componentID:d.componentID,"data-focusor":p}),b("button",h(r({"data-chips-input-wrapper":p,onKeyDown:t=>{let{key:i,ctrlKey:k,metaKey:I,keyCode:l}=t,m=k||I;if(l>=48&&l<=57||l>=65&&l<=90||l>=96&&l<=105){if(S)return;y()}else if(i!="Tab"){if(i=="Backspace"){if(!n.length)return;if(m)C([]);else{let $=[...n];$.pop(),C($)}}}},onClick:()=>{S||y()}},q),{children:[!S&&a(x,{selected:n,openCallback:y}),J]}))]})},ae=e=>{let u=[...e.value||[]].splice(0,e.limit||65535);return a(le,h(r({SelectedCellComponent:o=>{let{value:c,label:f,removeCallback:O}=o;return b(X.Left,{ssCardBox:!0,padding:"1/3",gap:0,isRounded:!0,textAlign:"left",children:[a(Q,{padding:[0,"1/2"],children:f}),o.defaultRemoveButton]})},AddButtonComponent:o=>e.limit&&e.limit<=o.selected.length?null:b(U.Button.Sub.R,{color:"cloud",padding:"1/2",onClick:()=>{o.openCallback()},children:[a(N.Plus,{}),"\u8FFD\u52A0\u3059\u308B"]})},e),{value:u}))},V=e=>{e=r({},e),e=r({gap:1,display:"flex",horizontalAlign:"left",verticalAlign:"center",flexWrap:!0},e);let s=te.Boxish(e);return a(Z,{componentID:e.componentID,children:ae,states:s})};V.fn=W;export{V as Chips,V as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{b as a,c as s,d as y}from"../../chunk-VY3566IV.js";import{jsx as p}from"react/jsx-runtime";import{useState as T}from"react";import g from"@mingoo/jsmin";import{Wrapper as _,BoxWrapper as k,SubmitForm as w,CommonEffects as L,DefaultStyles as F}from"./core";function B(t){let{value:e,states:n}=t,{required:o}=n,i=[];return o&&!e&&i.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!i.filter(({type:u})=>u=="invalid").length,notice:i}}const H=t=>{let v=t,{componentID:e,tone:n,required:o,form:i,value:u,enableFormSubmit:b,checkValidationAtFirst:M,onInput:m,onKeyDown:f,onValidate:W,onUpdateValue:D,onUpdateValidValue:R,children:C="",leftIndicator:q,rightIndicator:A,leftIcon:K,rightIcon:U}=v,V=y(v,["componentID","tone","required","form","value","enableFormSubmit","checkValidationAtFirst","onInput","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","children","leftIndicator","rightIndicator","leftIcon","rightIcon"]),E={componentID:e,dataValue:u,eventType:"init",eventID:g.uuid.gen()},[l,c]=T(E),[d,I]=T({ok:!1,notice:[]});return L({states:t,val_status:l,set_status:c,val_validate:d,set_validate:I,onUpdateValue:D,onUpdateValidValue:R,DefaultValidation:B}),p(k,{val_status:l,set_status:c,val_validate:d,states:t,children:p("div",s(a({contentEditable:!0,"data-form":i,"data-name":t.name,"data-input-type":"contenteditable","data-validation":d.ok,"data-value":l.dataValue,"data-component-id":l.componentID,onKeyDown:r=>{f&&f(r),b&&w(r)},onInput:r=>{let S=r.currentTarget,{innerHTML:$,innerText:x}=S;d.ok&&I({ok:!1,notice:[]}),c(s(a({},l),{dataValue:x,eventType:"update",eventID:g.uuid.gen()})),m&&m(r)}},V),{children:C}))})},h=t=>{var n,o;t=a({},t),t.rightIcon&&(t.paddingRight=(n=t.paddingRight)!=null?n:3),t.leftIcon&&(t.paddingLeft=(o=t.paddingLeft)!=null?o:3),t=s(a({},t),{freeCSS:a({whiteSpace:"pre-wrap"},t.freeCSS)});let e=F.Boxish(t);return e.rows=e.rows||5,p(_,{componentID:t.componentID,children:H,states:e})};export{h as Contenteditable,h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{b as e,c as m,d as T}from"../../chunk-VY3566IV.js";import{jsx as I,jsxs as Y}from"react/jsx-runtime";import{useState as V}from"react";import y from"@mingoo/jsmin";import{$$fromRoot as $}from"../../@utils";import{Wrapper as K,BoxWrapper as O,SubmitForm as q,CommonEffects as U,DefaultStyles as j}from"./core";import z from"../../atoms/Flex";import G from"./Hidden";import{InputClasses as w}from"../../@styles/componentClasses";function J(t){let{value:a,states:s}=t,{required:u,numericOnly:o=!1,digits:c}=s,l=[];return u&&!a&&l.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),a&&(o&&a.match(/\D/)&&l.push({type:"invalid",label:"\u6570\u5B57\u306E\u307F\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),a.length!=c&&l.push({type:"warn",label:"\u6700\u5F8C\u307E\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"})),{ok:!l.filter(({type:p})=>p=="invalid"||p=="warn").length,notice:l}}const Q=(t,a="")=>{let s=String(a),u=[];for(let o=0;o<t;o++)u[o]=s[o]||"";return{formatValue:u,dataValue:s}},R=(t="")=>{let a=t,s=a.join("");return{formatValue:a,dataValue:s}},X=t=>{let b=t,{tone:a,required:s,form:u,name:o,className:c="",digits:l,numericOnly:p=!1,enableFormSubmit:M,checkValidationAtFirst:Z,onChange:tt,onKeyDown:et,onValidate:at,onUpdateValue:_,onUpdateValidValue:k,value:A="",override:nt,componentID:it,listStyles:N}=b,B=T(b,["tone","required","form","name","className","digits","numericOnly","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","override","componentID","listStyles"]);p&&(t.inputMode=t.inputMode||"numeric");let E=m(e({componentID:t.componentID||""},Q(l,A)),{eventType:"init",eventID:y.uuid.gen()}),[n,f]=V(E),[h,H]=V({ok:!1,notice:[]});U({states:t,val_status:n,set_status:f,val_validate:h,set_validate:H,onUpdateValue:_,onUpdateValidValue:k,DefaultValidation:J});let v=[];for(let i=0;i<l;i++){let L=n.formatValue[i],W={},x=c;t.combineInput&&(x=[c,w("DigitCharacterCell"),w("Combined")].join(" ")),v.push(I("input",{type:"text",inputMode:t.inputMode||"text",value:L,"data-form-name":u,id:"Digit-"+i+"-"+n.componentID,className:x,style:e(e({},t.style),W),onKeyDown:D=>{let{key:g,code:P}=D;if(g=="Tab")return;D.preventDefault();let d=null;if(g=="Backspace"){let r=n.formatValue;r[i]="",f(m(e(e({},n),R(r)),{eventType:"update",eventID:y.uuid.gen()})),d=i-1}else if(["ArrowLeft","ArrowRight"].includes(g)){let r=+(g=="ArrowRight")*2-1;d=i+r}else M&&q(D),(()=>{let r=P.match(/^(Key(.)|Digit(\d)|Numpad(\d))/);if(!r)return;let C=r[2]||r[3]||r[4];if(p&&!C.match(/\d/)||!C)return;let S=n.formatValue;S[i]=C,f(m(e(e({},n),R(S)),{eventType:"update",eventID:y.uuid.gen()})),d=i+1})();y.is.exist(d)&&$("#Digit-"+d+"-"+n.componentID).focus()},onChange:()=>{}},i))}return Y(O,{val_status:n,set_status:f,val_validate:h,states:t,children:[I(G,e({name:o,"data-input-type":"digitCharacters","data-form":u,"data-validation":h.ok,componentID:n.componentID,"data-value":n.dataValue},B)),I(z,m(e({gap:"1/2",flexChilds:"even",flexWrap:!1,flexSizing:"auto"},N),{children:v}))]})},F=t=>{t=e({},t),t=e({textAlign:"center",width:0},t),t.combineInput&&(t=m(e({textAlign:"center",width:0},t),{freeCSS:e({minWidth:12*2,marginRight:-1},t.freeCSS),listStyles:e({borderRadius:"2.tone.secondary",border:"unset",gap:0},t.listStyles)}));let a=j.Boxish(t);return I(K,{componentID:t.componentID,children:X,states:a})};export{F as DigitCharacters,F as default};
|
package/dist/fn/Input/Filer.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare namespace Filer {
|
|
|
13
13
|
fileNameEdit?: boolean;
|
|
14
14
|
systemOnly?: boolean;
|
|
15
15
|
accept?: Accept;
|
|
16
|
-
cellStyles?: TagProperty.
|
|
16
|
+
cellStyles?: TagProperty.States;
|
|
17
17
|
cellClassName?: string;
|
|
18
18
|
};
|
|
19
19
|
type CustomFile = File & {
|
|
@@ -22,7 +22,7 @@ declare namespace Filer {
|
|
|
22
22
|
type Accept = 'image' | string;
|
|
23
23
|
type ListInput = {
|
|
24
24
|
files: File[];
|
|
25
|
-
|
|
25
|
+
states: Filer.Input;
|
|
26
26
|
val_status: InputTypes.Status.Plain;
|
|
27
27
|
set_status: React.Dispatch<React.SetStateAction<InputTypes.Status.Plain>>;
|
|
28
28
|
};
|
|
@@ -36,7 +36,7 @@ declare namespace Filer {
|
|
|
36
36
|
};
|
|
37
37
|
type FNs = {
|
|
38
38
|
fn: {
|
|
39
|
-
openDialog(
|
|
39
|
+
openDialog(p: {
|
|
40
40
|
accept?: Accept;
|
|
41
41
|
multiple?: boolean;
|
|
42
42
|
}): Promise<File[]>;
|