lupine.components 1.0.21 → 1.0.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lupine.components",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "license": "MIT",
5
5
  "author": "uuware.com",
6
6
  "homepage": "https://github.com/uuware/lupine.js",
@@ -1,4 +1,4 @@
1
- import { CssProps, RefProps, VNode, mountComponents } from 'lupine.web';
1
+ import { CssProps, RefProps, VNode, mountInnerComponent } from 'lupine.web';
2
2
 
3
3
  export type ActionSheetCloseProps = () => void;
4
4
 
@@ -147,7 +147,7 @@ export class ActionSheet {
147
147
  base.style.position = 'fixed';
148
148
  base.style.zIndex = zIndex || 'var(--layer-actionsheet-window)';
149
149
  document.body.appendChild(base);
150
- await mountComponents(base, component);
150
+ await mountInnerComponent(base, component);
151
151
  return handleClose;
152
152
  }
153
153
  }
@@ -1,4 +1,4 @@
1
- import { CssProps, RefProps, VNode, mountComponents } from 'lupine.web';
1
+ import { CssProps, RefProps, VNode, mountInnerComponent } from 'lupine.web';
2
2
  import { stopPropagation } from '../lib';
3
3
 
4
4
  export type FloatWindowCloseProps = () => void;
@@ -184,7 +184,7 @@ export class FloatWindow {
184
184
  base.style.position = 'fixed';
185
185
  base.style.zIndex = zIndex || 'var(--layer-float-window)';
186
186
  document.body.appendChild(base);
187
- await mountComponents(base, component);
187
+ await mountInnerComponent(base, component);
188
188
  return handleClose;
189
189
  }
190
190
 
@@ -6,7 +6,7 @@ export const HtmlVar = (initial?: string | VNode<any>): HtmlVarResult => {
6
6
  let _dirty = false;
7
7
  const waitUpdate = async (value: string | VNode<any>) => {
8
8
  if (!ref.current) return;
9
- await ref.loadContent!(value);
9
+ await ref.mountInnerComponent!(value);
10
10
  _dirty = false;
11
11
  };
12
12
  const ref: RefProps = {
@@ -1,4 +1,4 @@
1
- import { RefProps, VNode, mountComponents } from 'lupine.web';
1
+ import { RefProps, VNode, mountInnerComponent } from 'lupine.web';
2
2
  import { stopPropagation } from '../lib';
3
3
 
4
4
  export type TabsHookProps = {
@@ -86,8 +86,8 @@ export const Tabs = ({ pages, defaultIndex, topClassName, pagePadding, hook: ref
86
86
  ref.$(`.pages[data-refid=${ref.id}]`).insertBefore(newPage, pages[newPageIndex]);
87
87
  }
88
88
 
89
- await mountComponents(newTab, newTab2);
90
- await mountComponents(newPage, page);
89
+ await mountInnerComponent(newTab, newTab2);
90
+ await mountInnerComponent(newPage, page);
91
91
  updateIndex(newPageIndex);
92
92
  };
93
93
  const createTabHeader = (title: string, className: string) => {
@@ -32,5 +32,3 @@ export class DocumentReady {
32
32
  });
33
33
  }
34
34
  }
35
-
36
- export default new DocumentReady();
@@ -2,9 +2,7 @@
2
2
  * for my-apps
3
3
  */
4
4
  export class DynamicalLoad {
5
- constructor() {}
6
-
7
- loadScript(url: string, idForReplace?: string, removeOnLoaded = false): Promise<string> {
5
+ static loadScript(url: string, idForReplace?: string, removeOnLoaded = false): Promise<string> {
8
6
  return new Promise((resolve, reject) => {
9
7
  if (this.existScript(url, idForReplace)) {
10
8
  resolve(url);
@@ -36,7 +34,7 @@ export class DynamicalLoad {
36
34
  }
37
35
 
38
36
  // TODO: more accuracy
39
- existScript(url: string, id?: string) {
37
+ static existScript(url: string, id?: string) {
40
38
  if (id) {
41
39
  const scriptDom = document.getElementById(id);
42
40
  if (scriptDom && scriptDom.tagName === 'SCRIPT') {
@@ -56,7 +54,7 @@ export class DynamicalLoad {
56
54
  }
57
55
  }
58
56
 
59
- loadCss(url: string, idForReplace?: string): Promise<string> {
57
+ static loadCss(url: string, idForReplace?: string): Promise<string> {
60
58
  return new Promise((resolve, reject) => {
61
59
  if (this.existCss(url, idForReplace)) {
62
60
  resolve(url);
@@ -90,7 +88,7 @@ export class DynamicalLoad {
90
88
  }
91
89
 
92
90
  // TODO: more accuracy
93
- existCss(url: string, id?: string) {
91
+ static existCss(url: string, id?: string) {
94
92
  if (id) {
95
93
  const linkDom = document.getElementById(id);
96
94
  if (linkDom && linkDom.tagName === 'LINK') {
@@ -134,5 +132,3 @@ export class DynamicalLoad {
134
132
  // }
135
133
  // }
136
134
  }
137
-
138
- export default new DynamicalLoad();
@@ -223,5 +223,3 @@ export class LiteDom {
223
223
  return this.node.tagName.toUpperCase();
224
224
  }
225
225
  }
226
-
227
- export default LiteDom.queryOne;
@@ -79,7 +79,6 @@ export class MessageHub {
79
79
  }
80
80
  }
81
81
 
82
- export const defaultMessageHub = new MessageHub();
83
82
 
84
83
  // /*[TEST-START]*/
85
84
  // function TEST_sample() {
@@ -21,7 +21,12 @@ export const pathUtils = {
21
21
  p = p.replace(/\/+$/, '');
22
22
  const idx = p.lastIndexOf('/');
23
23
  let base = idx === -1 ? p : p.slice(idx + 1);
24
- if (ext && base.endsWith(ext)) {
24
+ if (!ext) {
25
+ const lastPot = p.lastIndexOf('.');
26
+ if (lastPot >= 0) {
27
+ base = base.slice(0, lastPot);
28
+ }
29
+ } else if (ext && base.endsWith(ext)) {
25
30
  base = base.slice(0, -ext.length);
26
31
  }
27
32
  return base;